Commit Graph

28 Commits

Author SHA1 Message Date
Chia-I Wu 6baa2c8d02 egl: Migrate drivers to use _eglBindContext.
_eglMakeCurrent is a big hammer that is not easy to use.  Migrate
drivers to use _eglBindContext and un-export _eglMakeCurrent.
2010-01-28 17:28:48 +08:00
Chia-I Wu 17330479b3 egl: eglMakeCurrent should accept an uninitialized display.
When no context or surface are given, the display is allowed to be
uninitialized.  Most drivers cannot handle an uninitialized display.
But they are updated to at least throw a fatal message.
2010-01-28 17:28:47 +08:00
Chia-I Wu 959481ad70 egl: Add _eglBindContext.
It works similar to _eglMakeCurrent, except that the old context and
surfaces are returned instead of destroyed.  _eglMakeCurrent is now
calling the new _eglBindContext.
2010-01-28 17:28:47 +08:00
Chia-I Wu 7c09296d4c egl: Refactor _eglMakeCurrent.
Refactor _eglMakeCurrent into _eglCheckMakeCurrent,
_eglBindContextToSurface, and _eglBindContextToThread.
2010-01-26 18:46:05 +08:00
Chia-I Wu ecb3b3102a egl: Make surfaces and contexts resources.
Turn _EGLSurface and _EGLContext into _EGLResource so that they can be
managed uniformly.
2010-01-24 20:38:16 +08:00
Chia-I Wu 5e66d18932 egl: Move context functions in egldisplay.[ch] to eglcontext.[ch].
Move functions to where they should be.  There should be no real change
here.
2010-01-24 20:38:15 +08:00
Chia-I Wu d845f2754b egl: Add support for querying render buffer.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:48 -06:00
Chia-I Wu 2f2cf461c5 egl: Overhaul driver API.
The motivation is so that drivers do not need to look up and check for
bad display, context, and etc.  It also becomes unnecessary for drivers
to call the link functions.

This commit makes eglapi.[ch] do the lookup and check.  As a result, the
driver API is overhauled, and almost all sources and drivers need
update.  The updates are mainly find and replace with human brains.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:44:34 -06:00
Chia-I Wu 8cdc6c66f9 egl: Make eglMakeCurrent more robust.
Now that a current surface points back to its binding context, and a
current context points back to its binding thread, make sure there is no
dangling pointers.  This commit reworks eglMakeCurrent, adds more checks
to avoid stealing context or surfaces from another thread, and correctly
destroys unlinked context and surfaces.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-03 11:35:14 -06:00
Chia-I Wu 07ee01365a egl: Replace IsBound by a pointer to the binding.
IsBound tells if a context or surface is current.  What it does not tell
is, to which thread a context is current, or to which context a surface
is current.  This commit replaces IsBound by a pointer to the binding
thread or context.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-03 11:34:37 -06:00
Chia-I Wu 15fdbc8361 egl: Remove redundant DeletePending flag.
A context or surface that is neither linked to a display nor current to
a thread should be destroyed.  Therefore, an unlinked context or surface
implies a pending delete automatically.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:56:00 -06:00
Chia-I Wu cca31340b5 egl: Use the link functions to manage resources.
This commit uses the newly introduced link functions to manage EGL
contexts and surfaces.  As a result of this, the API for drivers are
changed.  All drivers are updated for the change.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:53:03 -06:00
Chia-I Wu 18457cb263 egl: Add funtions to link contexts and surfaces to displays.
EGL contexts and surfaces are resources of displays.  They should be
managed by displays.  This commit adds a bunch of functions to
egldisplay.c to help establish the links between contexts/surfaces and
displays.  How links are established is considered opaque outside
display.  Functions like _eglGetSurfaceHandle or _eglLookupSurface are
therefore moved to egldisplay.c, with some small modifications.

The idea is also extended to display.  That is, displays need to link to
themselves to be looked up.

This commit only adds the functions.  A commit to use them should
follow.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:48:27 -06:00
Chia-I Wu 21b635ffa8 egl: Extend per-thread info for multiple current contexts.
EGL allows multiple current contexts, as long as they are bound to
different client APIs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:42:04 -06:00
Chia-I Wu 75da80b295 egl: Support per-thread info.
This commit introduces a "current" system to manage per-thread info.  It
uses TLS, if GLX_USE_TLS is defined, or pthread, if PTHREADS is defined.
If none of them are defined, it uses a dummy implementation that is just
like before.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:41:02 -06:00
Brian Paul 9f6a4e2a65 egl: fix assorted context-related bugs
Move memset() to proper place.
Added EGL_CONTEXT_CLIENT_VERSION query.
Fix bad return EGL_FALSE -> EGL_TRUE.
2008-06-19 21:19:33 -06:00
Brian Paul a8533d5493 egl: clean up prototype code, new _eglFindAPIs() function. 2008-06-19 16:26:20 -06:00
Brian Paul d5078b9432 egl: clean-up re-org of the client API state 2008-05-30 13:45:40 -06:00
Brian Paul 5e7dba5412 eliminate the context hash table
In EGL 1.4 the opaque EGLContext type is a pointer so we can just cast
between public EGLContext handles and private _EGLContext pointers.
2008-05-27 14:21:25 -06:00
Brian Paul 1ed1027e88 assorted changes to compile with new EGL 1.4 headers (untested) 2008-05-27 13:45:41 -06:00
Brian Paul b2006a40eb some initial EGL 1.2 work 2006-01-30 00:10:55 +00:00
Brian Paul 4882279633 Some initial per-thread support.
Rename eglShowSurfaceMESA to eglShowScreenSurfaceMESA.
2005-12-10 17:54:00 +00:00
Brian Paul d548bf41d3 Redo _eglInitSurface() so it can be used with all surface types.
Redo _eglInitContext() to do error checking, attribute list parsing, etc.
2005-11-27 23:57:19 +00:00
Brian Paul daf585d0f0 Move all the EGL API function pointers into a new _egl_api struct. 2005-11-24 04:02:16 +00:00
Brian Paul f9bad3dfea use EGLint instead of unsigned long for eglCopyContextMESA, added comments 2005-05-16 02:21:08 +00:00
Jon Smirl 1c606a9aa1 Add empty placeholder for eglCopyContextMESA 2005-05-14 14:54:38 +00:00
Jon Smirl 7012d01d88 First attempt at getting egl support up on dumb framebuffer.
Seems to be mostly working. Not all of egl API is implemented.
2005-05-13 18:31:35 +00:00
Brian Paul adbff7e977 initial EGL code 2005-04-22 21:09:39 +00:00