Commit Graph

87 Commits

Author SHA1 Message Date
Yonggang Luo bf2cd50019 egl: Remove usage of USE_ELF_TLS macro
After commit c47fd3dc00 ("windows: Use TLS context/dispatch with shared-glapi")
USE_ELF_TLS are always defined by
pre_args += '-DUSE_ELF_TLS'
So we can remove it safety

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
2022-07-29 23:59:11 +00:00
Tapani Pälli 0532365759 egl: support no error attribute set to false with ES 1.1
We advertise the extension so it should support case where context has
attribute EGL_CONTEXT_OPENGL_NO_ERROR_KHR set to EGL_FALSE indepdendent
of ES version used.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4586
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10102>
2021-04-09 08:02:21 +03:00
Eric Engestrom b981babb93 egl: drop unused _EGLDriver & _EGLDisplay from _eglQueryContext()
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241>
2020-08-16 13:49:18 +00:00
Eric Engestrom 9c6fa9421d egl: const _eglDriver
Converted using `s/_EGLDriver/const _EGLDriver/g` and dropped a couple
of irrelevant changes in comments, in the `_EGL_DRIVER_TYPECAST()` macro
and the typedef itself.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6129>
2020-08-01 17:12:20 +00:00
Kenneth Graunke 28c2ce7105 egl: Allow EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY in ES and GL
EGL annoyingly defines a few variants of this token:

   EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT - 0x3138
   EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR - 0x31BD
   EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY     - 0x31BD

The EGL_EXT_create_context_robustness extension specifies that the EXT
token is only valid for ES contexts, not GL.  The EGL_KHR_create_context
extension defines the KHR version, and says it is only allowed for GL
contexts, and specifically calls out that it's an error for ES contexts.

But EGL 1.5 includes the new suffixless token, which has the same value
as the KHR version, and specifically calls out that it's now valid to
use with both GL and ES contexts.  So we should allow this.

Fixes KHR-NoContext.es32.robustness.no_reset_notification and
KHR-NoContext.es32.robustness.lose_context_on_reset on iris, which
apparently is exposing EGL 1.5.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2019-05-17 15:13:15 -07:00
Andrii Simiklit 5c581b3dd6 egl: return correct error code for a case req ver < 3 with forward-compatible
The EGL_KHR_create_context spec says:
   "If an OpenGL context is requested and the values for attributes
    EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR,
    when considered together with the value for attribute
    EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
    version and feature set that are not defined, than an
    EGL_BAD_MATCH error is generated."

This case is already correctly handled a bit below in
the same source file.
The correct handling was added by commit: 63beb3df

Reported-by: Ian Romanick <idr@freedesktop.org>
Here: https://bugzilla.freedesktop.org/show_bug.cgi?id=92552#c9
Fixes: 11cabc45b7 "egl: rework handling EGL_CONTEXT_FLAGS"
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
2019-05-01 00:14:00 +00:00
Eric Engestrom 54fa5eceae egl: use coherent variable names
`EGLDisplay` variables (the opaque Khronos type) have mostly been
consistently called `dpy`, as this is the name used in the Khronos
specs.

However, `_EGLDisplay` variables (our internal struct) have been
randomly called `dpy` when there was no local variable clash with
`EGLDisplay`s, and `disp` otherwise.

Let's be consistent and use `dpy` for the Khronos type, and `disp`
for our struct.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
2019-02-06 11:53:24 +00:00
Eric Engestrom d75fbff667 egl: add missing includes
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
2019-01-11 14:37:47 +00:00
Chad Versace f48f9a78da egl: Simplify queries for EGL_RENDER_BUFFER
There exist *two* queryable EGL_RENDER_BUFFER states in EGL:
eglQuerySurface(EGL_RENDER_BUFFER) and
eglQueryContext(EGL_RENDER_BUFFER).

These changes eliminate potentially very fragile code in the upcoming
EGL_KHR_mutable_render_buffer implementation.

* eglQuerySurface(EGL_RENDER_BUFFER)

  The implementation of eglQuerySurface(EGL_RENDER_BUFFER) contained
  abstruse logic which required comprehending the specification
  complexities of how the two EGL_RENDER_BUFFER states interact.  The
  function sometimes returned _EGLContext::WindowRenderBuffer, sometimes
  _EGLSurface::RenderBuffer. Why? The function tried to encode the
  actual logic from the EGL spec. When did the function return which
  variable? Go study the EGL spec, hope you understand it, then hope
  Mesa mutated the EGL_RENDER_BUFFER state in all the correct places.
  Have fun.

  To simplify eglQuerySurface(EGL_RENDER_BUFFER), and to improve
  confidence in its correctness, flatten its indirect logic. For pixmap
  and pbuffer surfaces, simply return a hard-coded literal value, as the
  spec suggests. For window surfaces, simply return
  _EGLSurface::RequestedRenderBuffer.  Nothing difficult here.

* eglQueryContext(EGL_RENDER_BUFFER)

  The implementation of this suffered from the same issues as
  eglQuerySurface, and the solution is the same.  confidence in its
  correctness, flatten its indirect logic. For pixmap and pbuffer
  surfaces, simply return a hard-coded literal value, as the spec
  suggests. For window surfaces, simply return
  _EGLSurface::ActiveRenderBuffer.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2018-08-07 11:11:05 -07:00
Andres Gomez 40abffb295 egl: remove duplicated initialization
Found by inspection.

The line removed is a duplicate of the line literally just above the
the 3 lines context usually printed in a commit log.

v2: enhance the commit log (Emil).

Cc: Ian Romanick <ian.d.romanick@intel.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-05 15:55:53 +02:00
Adam Jackson c0be3aae6c egl: Implement EGL_KHR_context_flush_control
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-11-06 16:09:03 -05:00
Chris Wilson 95ecf3df62 egl: Support IMG_context_priority
IMG_context_priority
https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt

    "This extension allows an EGLContext to be created with a priority
    hint. It is possible that an implementation will not honour the
    hint, especially if there are constraints on the number of high
    priority contexts available in the system, or system policy limits
    access to high priority contexts to appropriate system privilege
    level. A query is provided to find the real priority level assigned
    to the context after creation."

The extension adds a new eglCreateContext attribute for choosing a
priority hint. This stub parses the attribute and copies into the base
struct _egl_context, and hooks up the query similarly.

Since the attribute is purely a hint, I have no qualms about the lack of
implementation before reporting back the value the user gave!

v2: Remember to set the default ContextPriority value to medium.
v3: Use the driRendererQuery interface to probe the backend for
supported priority values and use those to mask the EGL interface.
v4: Treat the priority attrib as a hint and gracefully mask any requests
not supported by the driver, the EGLContext will remain at medium
priority.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Emil Velikov <emli.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-20 11:28:17 +01:00
Grigori Goronzy 39bf7756b9 egl: move KHR_no_error vs debug/robustness check further down
We'll fail to flag an error if the context flags appear after the
no-error attribute in the context attribute list.

Delay the check to after attribute parsing to fix this.

Fixes: 4909519a66 ("egl: Add EGL_KHR_create_context_no_error support")
Cc: mesa-stable@lists.freedesktop.org
[Emil Velikov: add fixes/stable tags, commit message polish]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-26 11:50:32 +01:00
Grigori Goronzy 4909519a66 egl: Add EGL_KHR_create_context_no_error support
This only adds the EGL side, needs to be plumbed into Mesa frontend.

v2: Add check for extension availability.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-14 21:23:44 +02:00
Emil Velikov c58af5cbb2 egl: fold _eglError() + return EGL_FALSE
The function _eglError() already explicitly returns EGL_FALSE,
explicitly to simplify the callers. Make use of it.

While EGL_FALSE is numerically identical to false, NULL, EGL_NO_FOO,
storage is not the same so we cannot use it for "everything".

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-06-26 12:41:00 +01:00
Eric Anholt 3b7b6adf3a egl: Implement __DRI_BACKGROUND_CALLABLE
v2: (Timothy Arceri) use C99 initializers.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
2017-03-16 14:14:18 +11:00
Chad Versace b85c0b569f egl: Emit correct error when robust context creation fails
Fixes dEQP-EGL.functional.create_context_ext.robust_*
on Intel with GBM.

If the user sets the EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR in
EGL_CONTEXT_FLAGS_KHR when creating an OpenGL ES context, then
EGL_KHR_create_context spec requires that we unconditionally emit
EGL_BAD_ATTRIBUTE because that flag does not exist for OpenGL ES. When
creating an OpenGL context, the spec requires that we emit EGL_BAD_MATCH
if we can't support the request; that error is generated in the egl_dri2
layer where the driver capability is actually checked.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99188
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2016-12-27 10:21:29 -08:00
Adam Jackson d9f5b1915b egl: Rename MESA_configless_context bit to KHR_no_config_context
Keep the old name in the extension string, but refer to the KHR
extension internally.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-12 11:29:09 -04:00
Adam Jackson cc45a5c308 egl: QueryContext on a configless context returns zero
MESA_configless_context does not specify the interaction with
QueryContext at all, and the code to generate an error in this case
predates the Mesa extension. Since EGL_NO_CONFIG_{KHR,MESA} are
numerically identical there's no way to distinguish which one the
application asked for, so use the KHR behaviour.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-12 11:28:38 -04:00
Adam Jackson dbda375d6f egl: Fix up indentation on previous commit
This was requested in review but I pushed the wrong version.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-08 13:21:27 -04:00
Adam Jackson a279760536 egl: Document why EGL_OPENGL{, _ES}_API are mostly identical
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-09-08 13:19:58 -04:00
Kyle Brenneman 6e066f76ee EGL: Combine the GL and GLES current contexts (v2)
Only keep track of a single current context, instead of separate
contexts for GL and GLES.

In EGL 1.4 (and 1.5), EGL_OPENGL_API and EGL_OPENGL_ES_API are supposed
to be interchangeable for all purposes except for eglCreateContext.

The _EGLThreadInfo::CurrentContexts array is now a single pointer to the
current context, which may be a GL or GLES context. In addition, it now
keeps track of the current API as an enum instead of an index.

eglMakeCurrent will now replace the current context, regardless of which
client API is used for for the current and new contexts. It no longer
checks for a conflicting context. In addition, calling eglMakeCurrent
with EGL_NO_CONTEXT will now release the current context regardless of
the current API.

v2: Rebased against master (Adam Jackson)

Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-09-07 11:56:48 -04:00
Matthew Waters 11cabc45b7 egl: rework handling EGL_CONTEXT_FLAGS
As of version 15 of the EGL_KHR_create_context spec, debug contexts
are allowed for ES contexts.  We should allow creation instead of
erroring.

While we're here provide a more comprehensive checking for the other two
flags - ROBUST_ACCESS_BIT_KHR and FORWARD_COMPATIBLE_BIT_KHR

v2 [Emil Velikov] Rebase. Minor tweak in commit message.

Cc: Boyan Ding <boyan.j.ding@gmail.com>
Cc: Chad Versace <chad.versace@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91044
Signed-off-by: Matthew Waters <ystreet00@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-03 12:30:13 +01:00
Frank Binns d9603be038 egl: improve attribute checking for eglCreateContext
The EGL 1.4 spec states for eglCreateContext:

	"attribute EGL_CONTEXT_CLIENT_VERSION is only valid when the current
	 rendering API is EGL_OPENGL_ES_API"

Additionally, if the EGL_KHR_create_context EGL extension is supported
(this is mandatory in EGL 1.5) then the EGL_CONTEXT_MAJOR_VERSION_KHR,
which is an alias for EGL_CONTEXT_CLIENT_VERSION, and
EGL_CONTEXT_MINOR_VERSION_KHR attributes are also accepted by
eglCreateContext with the extension spec stating:

	"The values for attributes EGL_CONTEXT_MAJOR_VERSION_KHR and
	 EGL_CONTEXT_MINOR_VERSION_KHR specify the requested client API
	 version. They are only meaningful for OpenGL and OpenGL ES
	 contexts, and specifying them for other types of contexts will
	 generate an error."

Add the necessary checks against the extension and rendering APIs when
validating these attributes as part of eglCreateContext.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
[Emil Velikov: Add newline before the spec quote (Matt)]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-13 17:36:06 +01:00
Marek Olšák 706466f461 egl: add context attribs from EGL 1.5
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-06-05 19:44:33 +02:00
Marek Olšák f9f894447e egl: fix setting context flags
Cc: 10.6 10.5 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-06-05 19:44:33 +02:00
Anuj Phogat d308f57fe7 egl: Fix OpenGL ES version checks in _eglParseContextAttribList()
We would generate EGL_BAD_CONFIG because _eglGetContextAPIBit
returns zero for the combination of EGL_OPENGL_ES_API and a major
version > 3.  By just returning zero, the caller can't tell the
difference between a bad version (which should generate
EGL_BAD_MATCH) and a bad API (which should generate
EGL_BAD_CONFIG).  This patch causes us to filter out major
versions > 3 at a point where we can generate the correct error.

Fixes gles3 Khronos CTS test:
egl_create_context.egl_create_context

V2: Fix commit message as suggested by Ian.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-04 18:31:26 -07:00
Neil Roberts 551d459af4 Add the EGL_MESA_configless_context extension
This extension provides a way for an application to render to multiple
surfaces with different buffer formats without having to use multiple
contexts. An EGLContext can be created without an EGLConfig by passing
EGL_NO_CONFIG_MESA. In that case there are no restrictions on the surfaces
that can be used with the context apart from that they must be using the same
EGLDisplay.

_mesa_initialze_context can now take a NULL gl_config which will mark the
context as ‘configless’. It will memset the visual to zero in that case.
Previously the i965 and i915 drivers were explicitly creating a zeroed visual
whenever 0 is passed for the EGLConfig. Mesa needs to be aware that the
context is configless because it affects the initial value to use for
glDrawBuffer. The first time the context is bound it will set the initial
value for configless contexts depending on whether the framebuffer used is
double-buffered.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Chia-I Wu dc97e54d97 Revert "egl: Unhide functionality in _eglInitContext()"
This reverts commit 1456ed85f0.
_eglInitResource can and is supposed to be called on subclass objects.

Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-02-19 13:08:52 +08:00
Juha-Pekka Heikkila 1456ed85f0 egl: Unhide functionality in _eglInitContext()
_eglInitResource() was used to memset entire _EGLContext by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLContext,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
José Fonseca 8771285054 s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008.  Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

    $ cat tg2vmw.sed
    # Run as:
    #
    #   git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
    #

    # Rename copyrights
    s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
    /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
    s/TUNGSTEN GRAPHICS/VMWARE/g

    # Rename emails
    s/alanh@tungstengraphics.com/alanh@vmware.com/
    s/jens@tungstengraphics.com/jowen@vmware.com/g
    s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
    s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
    s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
    s/michel@tungstengraphics.com/daenzer@vmware.com/g
    s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
    s/zack@tungstengraphics.com/zackr@vmware.com/

    # Remove dead links
    s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

    # C string src/gallium/state_trackers/vega/api_misc.c
    s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 20:00:32 +00:00
Chad Versace eb09940e55 egl/dri2: Add plumbing for EGL_OPENGL_ES3_BIT_KHR
Fixes error EGL_BAD_ATTRIBUTE in the tests below on Intel Sandybridge:
    * piglit egl-create-context-verify-gl-flavor, testcase OpenGL ES 3.0
    * gles3conform, revision 19700, when runnning GL3Tests with -fbo

This plumbing is added in order to comply with the EGL_KHR_create_context
spec. According to the EGL_KHR_create_context spec, it is illegal to call
eglCreateContext(EGL_CONTEXT_MAJOR_VERSION_KHR=3) with a config whose
EGL_RENDERABLE_TYPE does not contain the EGL_OPENGL_ES3_BIT_KHR. The
pertinent
portion of the spec is quoted below; the key word is "respectively".

  * If <config> is not a valid EGLConfig, or does not support the
    requested client API, then an EGL_BAD_CONFIG error is generated
    (this includes requesting creation of an OpenGL ES 1.x, 2.0, or
    3.0 context when the EGL_RENDERABLE_TYPE attribute of <config>
    does not contain EGL_OPENGL_ES_BIT, EGL_OPENGL_ES2_BIT, or
    EGL_OPENGL_ES3_BIT_KHR respectively).

To create this patch, I searched for all the ES2 bit plumbing by calling
`git grep "ES2_BIT\|DRI_API_GLES2" src/egl`, and then at each location
added a case for ES3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:54 -08:00
Matt Turner 587d5db11d egl: Return EGL_BAD_MATCH for invalid profile attributes
Version 12 of the EGL_KHR_create_context spec changed this behavior.

NOTE: This is a candidate for the 9.0 branch
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-10 13:15:06 -07:00
Matt Turner 971750e1cd egl: fix invalid flag detection for EGL_KHR_create_context
We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-27 15:11:11 -07:00
Ian Romanick dbecb41300 egl: Allow OpenGL ES 3.0 as a version
In the DRI2 back-end this will get the same API as GLES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick f171571bfc egl: Implement front-end support for EGL_EXT_create_context_robustness
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick 63beb3df98 egl: Implement front-end support for EGL_KHR_create_context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick 3fd79dd988 egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersion
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick b50703aea5 egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_context
KHR extension name is reserved for Khronos ratified extensions, and there is
no such thing as EGL_KHR_surfaceless_{gles1,gles2,opengl}.  Replace these
three extensions with EGL_KHR_surfaceless_context since that extension
actually exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Chia-I Wu f957cac772 egl: remove #ifdef's for official extensions
There is no point in having them when we distribute eglext.h.

As for unofficial extensions, there is a chance that we might remove some of
them evetually.  Keeping the #ifdef's for now should make that easier.
2011-12-20 16:59:09 +08:00
Chia-I Wu f2001df508 egl: add copyright notices
The list of copyright holders could be incomplete.  Please update
directly or notify me if your name is missing.
2011-07-02 18:21:31 +09:00
Chia-I Wu 0d43cbed2f egl: Fix a false negative check in _eglCheckMakeCurrent.
This call sequence

  eglMakeCurrent(dpy, surf, surf, ctx1);
  eglMakeCurrent(dpy, surf, surf, ctx2);

should be valid if ctx1 and ctx2 have the same client API and are not
current in another thread.
2010-10-23 16:58:38 +08:00
Chia-I Wu d19afc57fe egl: Use reference counting to replace IsLinked or IsBound.
Remove all _egl<Res>IsLinked and _egl<Res>IsBound.  Update
_eglBindContext and drivers to do reference counting.
2010-10-23 15:26:28 +08:00
Chia-I Wu dc4f845c37 egl: Add reference count for resources.
This is a really simple mechanism.  There is no atomicity and the caller
is expected to hold the display lock.
2010-10-23 15:19:34 +08:00
Chia-I Wu 25328509c9 egl: Move fallback routines to eglfallbacks.c.
We do not want them to be all over the places.
2010-10-22 18:38:30 +08:00
Chia-I Wu 3fa21881b1 egl: Access config attributes directly.
Replace SET_CONFIG_ATTRIB/GET_CONFIG_ATTRIB by direct dereferences.
2010-10-14 17:16:14 +08:00
Chia-I Wu ea9e5dbbc2 egl: Simplify _eglBindContext.
Remove the hard-to-get-right _eglBindContextToSurfaces.  As well as fix
an assertion failure from b90a3e7d8b when
such call sequence is hit

  eglMakeCurrent(dpy, surf1, surf1, ctx1);
  eglMakeCurrent(dpy, surf2, surf2, ctx2);
  eglMakeCurrent(dpy, surf1, surf1, ctx1);
2010-09-10 18:41:14 +08:00
Chia-I Wu 5eb33596a0 egl: Fix context API check and be verbose.
The API of the context was not checked against EGL_RENDERABLE_TYPE when there
was no attribute list.  Move the check to _eglInitContext, and be verbose about
common mistakes (EGL_RENDERABLE_TYPE not set, EGL_CONTEXT_CLIENT_VERSION not
set, or eglBindAPI not called).
2010-08-20 19:22:51 +08:00
Kristian Høgsberg 2c343af098 egl: Fix deref before NULL-check 2010-07-28 23:54:16 -04:00
Kristian Høgsberg b90a3e7d8b egl: EGL_KHR_surfaceless_* extensions
These extensions allow an application to make a context current by
passing EGL_NO_SURFACE for the write and read surface in the call to
eglMakeCurrent.  The motivation is that applications that only want to
render to client API targets (such as OpenGL framebuffer objects)
should not need to create a throw-away EGL surface just to get a
current context.
2010-07-28 23:07:00 -04:00