Commit Graph

21 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
Erik Faye-Lund 1613aa7341 egl: remove needless c99_compat.h includes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>
2022-06-02 13:09:16 +00:00
Emil Velikov b94344f1c7 egl: simplify _eglDebugReport* API
Instead of having three, almost identical but not quite,
_eglDebugReport* functions, simply fold them into one.

While doing so drop the unnecessary arguments 'command' and
'objectLabel'. Former is identical to funcName, while the latter is
already stored (yet unused) in _EGLThreadInfo::CurrentObjectLabel.

Cc: Kyle Brenneman <kbrenneman@nvidia.com>
Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (IRC)
2017-09-19 19:07:16 +01:00
Kyle Brenneman 6a5545d3ba egl: Track EGL_KHR_debug state when going through EGL API calls (v3)
This decorates every EGL entrypoint with _EGL_FUNC_START, which records
the function name and primary dispatch object label in the current
thread state. It also adds debug report functions and calls them when
appropriate.

This would be useful enough for debugging on its own, if the user set a
breakpoint when the report function was called. We will also need this
state tracked in order to expose EGL_KHR_debug.

v2:
- Clear the object label in more cases in _eglSetFuncName
- Pass draw surface (if any) to _EGL_FUNC_START in eglSwapInterval

v3:
- Set dummy thread's CurrentAPI to EGL_OPENGL_ES_API not zero
- Less ?: in _eglSetFuncName

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.veliko@collabora.com>
2016-10-05 11:40:51 -04:00
Kyle Brenneman 7206b3a556 egl: Add storage for EGL_KHR_debug's state to EGL objects
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-09-14 11:45: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
Emil Velikov 7563c39641 egl: treat EGL_OPENGL_API as invalid on Android
At the moment one can use OpenGL in eglBindAPI() only to clear the
EGL_OPENGL_BIT from RenderableType and Conformant for _each_ config.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
2016-08-30 14:49:24 +01:00
Marek Olšák 8c361e84ad Revert "egl: Check if API is supported when using eglBindAPI."
This reverts commit e8b38ca202.

It broke Glamor for Gallium at least.
2016-06-03 11:33:45 +02:00
Plamena Manolova e8b38ca202 egl: Check if API is supported when using eglBindAPI.
According to the EGL specifications before binding an API
we must check whether it's supported first. If not eglBindAPI
should return EGL_FALSE and generate a EGL_BAD_PARAMETER error.

Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-06-02 07:45:19 -07:00
Alexander von Gluck IV 8362068c1b egl: Add needed extern "C" for C++ access
* Haiku's egl driver is C++ due to the interface natively being C++

Reviewed-⁠by: Brian Paul <brianp@vmware.com>
2015-05-14 14:08:37 -04:00
Emil Velikov dd438ae34b egl/main: no longer export internal function
With the split of the gallium egl module we had previously it required
access to some of the internal functions. As the only build (automake)
that did this no longer builds it we can now appropriately hide those
functions.

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-05 14:45:53 +00:00
Emil Velikov 7bd1693877 egl/main: replace INLINE with inline
Drop the custom keyword in favour of the C99 one. All the places using
it now directly include c99_compat.h which should handle things on
platforms which lack it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-05 14:45:53 +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
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 94cb321b5d egl: Clean up header inclusions.
Mainly to remove eglcurrent.h and egldisplay.h from eglglobals.h.
2010-01-30 22:55:49 +08:00
Chia-I Wu a1717970e7 egl: Remove _eglGetCurrentSurface and _eglGetCurrentDisplay.
They have little use in drivers since drivers need to work for multiple
current contexts.
2010-01-26 18:46:05 +08:00
Chia-I Wu 6f6f3e4227 egl: Add _eglGetAPIContext.
It will return the currently bound context of the given API.
2010-01-26 18:46:05 +08:00
Chia-I Wu 897cb8950a egl: Fix breakage from -fvisibility=hidden.
Mark EGL API and driver functions as PUBLIC.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2010-01-05 11:23:52 -05:00
Chia-I Wu 310c76812e egl: Allow binding to any client API.
As a result, EGL_NONE is no longer a valid client API.  And it is
possible that no config supports the current bound API.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu 56d2119280 egl: Initialize current thread management on demand.
Current thread management was initialized in _eglInitGlobals, which is
called only in eglGetDisplay.  Since EGL does not require eglGetDisplay
to be called first, the initialization is better to be done on demand.

_eglFiniCurrent is removed, as it is not called at all.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-11 22:14:35 -06:00
Brian Paul 40fd101919 egl: commit missing eglcurrent.[ch] files
Not sure how these got left out from earlier commit.
2009-07-17 13:36:58 -06:00