Commit Graph

36 Commits

Author SHA1 Message Date
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 7abf42626f egl: Add _EGLResource and _EGLResourceType.
Resources are objects managed by a display.  They can be linked to or
unlinked from a display.  It is also possible to check if a resource is
valid.
2010-01-24 20:38:15 +08:00
Chia-I Wu b4d2c97a2d egl: Move surface functions in egldisplay.[ch] to eglsurface.[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 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 f0c2871bf4 egl: Remove unused driver and display functions.
Remove _eglPreloadDriver, _eglLookupDriver, and _eglSplitDisplayString.
2010-01-20 17:40:07 +08:00
Chia-I Wu 57929eda3e egl: Use _eglPreloadDrivers.
Replace the use of _eglPreloadDriver by _eglPreloadDrivers.  The latter
supports EGL_DISPLAY which have a better chance to "just work".
2010-01-20 17:40:07 +08:00
Chia-I Wu e1d978775f egl: Remove Xdpy from EGLDisplay.
It is not used anymore.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-26 16:40:22 -06:00
Chia-I Wu 5a459d58fc egl: Remove dependency on libX11.
libX11 is used to determine the screen number, which is in turned used
to determine the DRI driver.  However, the sysfs interface for
determining the DRI driver is gone, and no working driver depends on
this mechanism.

Display string parsing is moved to a new function,
_eglSplitDisplayString.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-21 08:34:34 -06:00
Chia-I Wu 408db29792 egl: Check for null display in handle checking.
The display may be NULL when checking a handle.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-21 08:34:34 -06:00
Chia-I Wu 34d8c13bff egl: Remove eglhash.c and eglhash.h.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:50:12 -06:00
Chia-I Wu e484a92928 egl: Add back handle checking.
Handle checking was done using hash tables.  Now that they are gone, we
have to loop over the lists.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:50:06 -06:00
Chia-I Wu e3734e4685 egl: Make lookup functions static inline.
progs/egl/demo3.c is also changed since it uses an internal function.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:50:00 -06:00
Chia-I Wu 38feefdc4e egl: Remove hash table for displays.
The hash table was used to map a display to a handle.  It is simpler to
cast directly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:49:53 -06:00
Chia-I Wu 7a9f528009 egl: Remove hash table for surfaces.
The hash table was used to map a surface to a handle.  It is simpler to
cast directly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:49:34 -06:00
Chia-I Wu ccc2b0bc65 egl: _eglCloseDriver should be no-op.
Move drv->API.Terminate call to eglTerminate.  Remove
_eglReleaseDisplayResource as drivers are doing it.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:49:22 -06:00
Chia-I Wu 0eaa02c836 egl: Change the way drivers are loaded.
Driver is chosen and preloaded when eglGetDisplay is called.  Later when
eglInitialize is called, the same driver is matched to initialize the
display.  Also, add new, but unused, hooks to EGLDriver to allow a
driver to probe a display or unload itself.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-18 08:44:44 -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 64e7bb3262 egl: Use _eglAddAtExitCall to free thread infos and displays.
Thread infos and displays are usually not freed by applications.  This
commit add atexit calls to free them.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-11 22:14:35 -06:00
Chia-I Wu 413969a920 egl: Implement _eglFiniDisplay.
_eglFiniDisplay is called at exit time to free allocated displays.  It
is, however, not used right now.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-11 22:14:35 -06:00
Chia-I Wu 621801abd2 egl: Make display and surface hash tables local.
Move display and surface hash tables to egldisplay.c, and have them
initialized on demand.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-11 22:14:35 -06:00
Chia-Wu dc516d6e2a egl: Silence warnings on x86-64.
Casting an unsigned int to or from a pointer directly gives warnings on
x86-64.  Add wrappers to silence the warnings.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-31 07:30:13 -06:00
Chia-I Wu 3f7e0d5302 egl: Destroy display's resources upon termination.
eglTerminate should destroy the contexts and surfaces of the display.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:54:06 -06:00
Chia-I Wu be9d1ab171 egl: Return the same EGL Display for the same native display.
The latest revision of the spec explicitly requires the same handle to
be returned for the same native display.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:53:39 -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 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 677151ad71 egl: added null ptr check 2008-06-20 14:28:59 -06:00
Brian Paul 97035cb19a egl: in _eglAddConfig() just save a pointer to the config; don't copy the config
This allows subclassing by drivers.
2008-06-04 11:36:59 -06:00
Brian Paul 9843c6420d egl: bring card->driver lookup code into egldriver.c 2008-05-28 14:51:40 -06:00
Brian Paul 0c8908c411 egl: added args string to _eglMain() 2008-05-28 12:56:36 -06:00
Brian Paul 6052af172f minor overhaul/re-org of driver selection/loading code 2008-05-27 16:48:23 -06:00
Brian Paul 721ba15bf4 added _eglGet*Handle() functions
These are the inverse of the _eglLookup*() functions.
Returns the public handle for a private surface/config/display/etc.
Removes glapi.c's direct access of private fields.
2008-05-27 14:33:54 -06:00
Brian Paul 1ed1027e88 assorted changes to compile with new EGL 1.4 headers (untested) 2008-05-27 13:45:41 -06:00
Dave Airlie bc8390fa6c this needs to be calloced 2005-12-23 08:17:44 +00:00
Brian Paul 198d6d05b0 remove eglQueryDisplayMESA() 2005-05-17 13:22:13 +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