summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: Cleanup _EGLDisplay initialization.Chia-I Wu2011-01-131-6/+3
| | | | | Reorder/rename and document the fields that should be set by the driver during initialization. Drop the major/minor arguments from drv->API.Initialize.
* egl: Use reference counting to replace IsLinked or IsBound.Chia-I Wu2010-10-231-6/+11
| | | | | Remove all _egl<Res>IsLinked and _egl<Res>IsBound. Update _eglBindContext and drivers to do reference counting.
* egl: Drop dpy argument from the link functions.Chia-I Wu2010-10-231-9/+9
| | | | | All display resources are already initialized with a display. Linking simply links a resource to its display.
* egl: Check extensions.Chia-I Wu2010-09-301-11/+41
| | | | | Do not call into the driver if the extension for the called function is not enabled.
* egl: Use _EGL_CHECK_DISPLAY in eglCreateContext.Chia-I Wu2010-09-101-1/+1
| | | | | _EGL_CHECK_DISPLAY checks the display and returns from eglCreateContext on error.
* egl: Add EGL_MESA_drm_image extensionKristian Høgsberg2010-08-251-0/+43
| | | | Create EGLImages from DRM buffer handles.
* egl: Allow core functions to be queried.Chia-I Wu2010-08-201-1/+38
| | | | | When _EGL_GET_CORE_ADDRESSES is defined, eglGetProcAddress can be used to query core functions. This is non-standard, but some apps expect it.
* egl: Add support for EGL_KHR_reusable_sync.Chia-I Wu2010-08-171-0/+107
| | | | Individual drivers still need to support and enable the extension.
* egl: EGL_KHR_surfaceless_* extensionsKristian Høgsberg2010-07-281-1/+5
| | | | | | | | | 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.
* egl: Remove unnecessary headers.Vinson Lee2010-07-061-1/+0
|
* egl: Rework driver loading.Chia-I Wu2010-07-061-40/+8
| | | | | | | | | | | | | | | Driver loading is now splitted into two stages. In the first stage, an _EGLModule is created for each driver: user driver, default drivers, and all files in the search directories that start with "egl_". Modules are not loaded at this stage. In the second stage, each module is loaded to initialize a display. The process stops at the first module that can initialize the display. If eglGetProcAddress is called before eglInitialize, the same code path will be taken to find the first module that supports EGL_DEFAULT_DISPLAY. Because we do not want to initialize the display, drv->Probe is used instead in this case.
* egl: Always use EGLAPIENTRY in api function prototypesnobled2010-07-031-15/+15
| | | | Fixes the build on Windows.
* egl: Add support for EGL_MESA_drm_display.Chia-I Wu2010-06-231-0/+14
| | | | | | | The extension defines eglGetDRMDisplay that creates an EGLDisplay from a DRM fd. Calling eglCreateWindowSurace or eglCreatePixmapSurface with such displays will generate EGL_BAD_NATIVE_WINDOW or EGL_BAD_NATIVE_PIXMAP.
* egl: Introduce platform displays internally.Chia-I Wu2010-06-231-1/+8
| | | | | | | | | | | This commit introduces type-safe platform displays internally. A platform display consists of a generic pointer and an enum that specifies the platform. An EGLDisplay is created from a platform display. Native displays become platform displays whose platform is determined by _eglGetNativePlatform(). Platform windows and pixmaps may also be introduced if needed.
* egl: Use SConscript for Windows build.Chia-I Wu2010-05-311-1/+3
| | | | Fix several portability issues and add SConscript for Windows build.
* egl: Silence uninitialized variable warnings.Vinson Lee2010-05-141-1/+1
|
* egl: Implement EGL_NOK_swap_regionKristian Høgsberg2010-05-131-0/+32
| | | | | | | | | This extension adds a new function which provides an alternative to eglSwapBuffers. eglSwapBuffersRegionNOK accepts two new parameters in addition to those in eglSwapBuffers. The new parameters consist of a pointer to a list of 4-integer blocks defining rectangles (x, y, width, height) and an integer specifying the number of rectangles in the list.
* egl: Allow a prioritized list of default driversKristian Høgsberg2010-05-131-6/+8
| | | | | | | | | | | | | | When there is no user driver or any matching display drivers we fall back to the default driver. This patch lets us have a list of default drivers instead of just one. The drivers are loaded in turn and we attempt to initialize the display. If it fails we unload the driver and move on to the next one. Compared to the display driver mechanism, this avoids loading a number of drivers and then only using one. Also, we call Initialize to see if the driver will work instead of relying on Probe. To know for sure that a driver will work, Probe really have to do a full Initialize, so we will just use Initialize directly.
* 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]>