aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: Silence warnings in check/return macros.Chia-I Wu2010-02-191-139/+147
| | | | | | The macros give warnings when compiled with -pedantic. This commit is based on a patch by Brian Paul, with minor changes to add do {} while(0) and rename the check macros.
* egl: Always lock a display before using it.Chia-I Wu2010-02-171-45/+80
| | | | | | | This gives a simple access control to the display. It is potentially slow, but a finer grained mutex can always be used in the future. The benefit of this simple approach is that drivers need not to worry about thread-safety.
* egl: Make eglGetDisplay atomic.Chia-I Wu2010-02-171-8/+2
| | | | | Merge _eglNewDisplay and _eglLinkDisplay into _eglFindDisplay. Remove unused _eglUnlinkDisplay.
* egl: eglGetError should return the status of the last call.Chia-I Wu2010-02-171-123/+226
| | | | | | Use macros to record the status of the function call before returning. This is the only way that eglGetError can return the status of the most recent function call.
* egl: Use new error checking macros.Chia-I Wu2010-02-171-115/+110
| | | | Replace all uses of _EGL_DECLARE_* and _eglCheck* by _EGL_CHECK_*.
* egl: Add new error checking macros.Chia-I Wu2010-02-171-94/+134
| | | | | | Add _EGL_CHECK_* which will replace _EGL_DECLARE_* for error checking. Move _eglCheck* earlier in the file so that the macros and the functions are grouped together.
* egl: Clean up header inclusions.Chia-I Wu2010-01-301-0/+1
| | | | Mainly to remove eglcurrent.h and egldisplay.h from eglglobals.h.
* egl: Correctly unbind contexts in eglReleaseThread.Chia-I Wu2010-01-281-0/+4
| | | | | MakeCurrent unbinds the current context of the current API. Modify the current API to make sure all contexts are correctly unbound.
* egl: eglMakeCurrent should accept an uninitialized display.Chia-I Wu2010-01-281-5/+13
| | | | | | 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.
* egl: Use a boolean to indicate whether a display is initialized.Chia-I Wu2010-01-281-16/+19
| | | | | | The driver pointer of the display was used to decide whether a display is initialized. Use a boolean for that purpose allows accessing the driver of an uninitialized display.
* egl: Remove _eglOpenDriver and _eglCloseDriver.Chia-I Wu2010-01-261-5/+2
| | | | | _eglCloseDriver is no-op and _eglOpenDriver does nothing but call _eglMatchDriver. Export _eglMatchDriver directly.
* egl: Remove _eglGetCurrentSurface and _eglGetCurrentDisplay.Chia-I Wu2010-01-261-2/+2
| | | | | They have little use in drivers since drivers need to work for multiple current contexts.
* egl: Fix leaks in eglReleaseThread.Chia-I Wu2010-01-261-6/+13
| | | | There may be multiple bound contexts that should be unbound.
* egl: Native types are renamed in EGL 1.3.Chia-I Wu2010-01-251-4/+4
| | | | Rename Native*Type to EGLNative*Type.
* egl: Add support for EGL_KHR_image.Chia-I Wu2010-01-251-0/+54
| | | | Individual drivers still need to implement the API hooks.
* egl: Update headers.Chia-I Wu2010-01-251-1/+2
| | | | | | Update to the current versions found at http://www.khronos.org/registry/egl/. There is one modification in khrplatform.h for GCC visibility.
* egl: Make surfaces and contexts resources.Chia-I Wu2010-01-241-3/+3
| | | | | Turn _EGLSurface and _EGLContext into _EGLResource so that they can be managed uniformly.
* egl: Use _eglPreloadDrivers.Chia-I Wu2010-01-201-3/+3
| | | | | Replace the use of _eglPreloadDriver by _eglPreloadDrivers. The latter supports EGL_DISPLAY which have a better chance to "just work".
* egl: Add _EGLDriver as the first argument to GetProcAddress.Chia-I Wu2010-01-121-1/+2
| | | | | The rest of the driver API has it as the first argument. It should be there so that a driver has access to itself.
* egl: Rework the synchronization primitives.Chia-I Wu2009-10-151-24/+42
| | | | | | | This adds error checking to the synchronization primitives. And eglWaitGL is now implemented by eglWaitClient. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Rework eglSwapInterval.Chia-I Wu2009-10-151-1/+11
| | | | | | | This adds error checking to eglSwapInterval and clamps the swap interval. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Rework error checking in eglSwapBuffers.Chia-I Wu2009-10-151-0/+15
| | | | Signed-off-by: Chia-I Wu <[email protected]>
* egl: Update comments about eglapi.c.Chia-I Wu2009-10-151-5/+20
| | | | | | Mention that opaque handles are looked up and checked. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Rework error checking in eglGetCurrentSurface.Chia-I Wu2009-10-151-2/+20
| | | | Signed-off-by: Chia-I Wu <[email protected]>
* egl: Allow binding to any client API.Chia-I Wu2009-10-131-29/+3
| | | | | | | 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 <[email protected]>
* egl: Preload a driver if eglGetProcAddress is called early.Chia-I Wu2009-10-131-0/+4
| | | | Signed-off-by: Chia-I Wu <[email protected]>
* egl: Remove core functions from eglGetProcAddress.Chia-I Wu2009-10-131-45/+16
| | | | | | | eglGetProcAddress may not be used to query core (non-extension) functions. Signed-off-by: Chia-I Wu <[email protected]>
* egl: _eglCloseDriver should be no-op.Chia-I Wu2009-08-181-1/+1
| | | | | | | Move drv->API.Terminate call to eglTerminate. Remove _eglReleaseDisplayResource as drivers are doing it. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Some per-driver data should be per-display.Chia-I Wu2009-08-181-5/+8
| | | | | | | Move some fields of _EGLDriver to _EGLDisplay. It also becomes unnecessary to pass _EGLDisplay to drivers when _eglMain is called. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Change the way drivers are loaded.Chia-I Wu2009-08-181-1/+1
| | | | | | | | | 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 <[email protected]>
* egl: Overhaul driver API.Chia-I Wu2009-08-181-174/+495
| | | | | | | | | | | | 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 <[email protected]>
* egl: Make _eglGlobal initialize statically.Chia-I Wu2009-08-111-1/+0
| | | | | | | Now that display and surface hash tables are moved out, _eglGlobal can be initialized statically. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Return the same EGL Display for the same native display.Chia-I Wu2009-07-171-3/+6
| | | | | | | 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 <[email protected]>
* egl: Add funtions to link contexts and surfaces to displays.Chia-I Wu2009-07-171-0/+2
| | | | | | | | | | | | | | | | | 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 <[email protected]>
* egl: Extend per-thread info for multiple current contexts.Chia-I Wu2009-07-171-4/+7
| | | | | | | EGL allows multiple current contexts, as long as they are bound to different client APIs. Signed-off-by: Chia-I Wu <[email protected]>
* egl: Support per-thread info.Chia-I Wu2009-07-171-4/+12
| | | | | | | | | 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 <[email protected]>
* egl: fix version handlingJonathan White2008-08-061-4/+13
|
* egl: new eglGetProcAddress() codeBrian Paul2008-05-301-5/+8
| | | | | The idea is to pass the call down to the device driver where an API-specific query can be made. Untested.
* egl: clean-up re-org of the client API stateBrian Paul2008-05-301-12/+27
|
* egl: added Name field to _EGLDriver so a driver name string can propogate up ↵Brian Paul2008-05-291-1/+2
| | | | through EGL_VERSION string
* egl: make sure EGL_VERSION_STRING query returns same version as eglInitialize()Brian Paul2008-05-281-2/+9
|
* egl: added args string to _eglMain()Brian Paul2008-05-281-1/+3
|
* minor overhaul/re-org of driver selection/loading codeBrian Paul2008-05-271-8/+19
|
* added _eglGet*Handle() functionsBrian Paul2008-05-271-12/+3
| | | | | | 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.
* added EGL_OPENGL_API caseBrian Paul2008-05-271-1/+10
|
* eliminate the context hash tableBrian Paul2008-05-271-4/+1
| | | | | In EGL 1.4 the opaque EGLContext type is a pointer so we can just cast between public EGLContext handles and private _EGLContext pointers.
* assorted changes to compile with new EGL 1.4 headers (untested)Brian Paul2008-05-271-33/+33
|
* some initial EGL 1.2 workBrian Paul2006-01-301-0/+89
|
* Some initial per-thread support.Brian Paul2005-12-101-5/+6
| | | | Rename eglShowSurfaceMESA to eglShowScreenSurfaceMESA.
* Move all the EGL API function pointers into a new _egl_api struct.Brian Paul2005-11-241-35/+34
|