summaryrefslogtreecommitdiffstats
path: root/src/egl/main
Commit message (Collapse)AuthorAgeFilesLines
* egl: Unbind the old context in _eglBindContext.Chia-I Wu2010-04-061-10/+9
| | | | The last commit incorrectly moved the code under an "else".
* egl: Fix eglMakeCurrent with different surfaces.Chia-I Wu2010-04-061-30/+45
| | | | | | 0a82fadcdd0b6ebbc345c7c302da0e0efce40a98 seems to trigger a bug in _eglBindContext. Rework the logics yet again. It is simpler, and hopefully correct this time.
* egl: Make _eglBindContextToSurfaces more readable.Chia-I Wu2010-03-281-11/+25
| | | | | | There is no effective changes given how the function is called. It is still not trivial, but it should be more readable and resemble _eglBindContextToThread a lot.
* egl: Always return the previously bound context.Chia-I Wu2010-03-281-9/+8
| | | | | | When a newly bound context is the same as the previously bound one, _eglBindContextToThread should still return the context instead of NULL. This gives the driver a chance to flush the context.
* Remove support for GCC older than 3.3.0Ian Romanick2010-03-031-3/+2
| | | | Signed-off-by: Ian Romanick <[email protected]>
* egl: Remove unused _EGL_SKIP_HANDLE_CHECK.Chia-I Wu2010-02-234-53/+0
| | | | | | It was added to skip checking EGLDisplay, EGLSurface, and etc. It is never defined and the spec does not allow the checks to be skipped. Remove it for good.
* egl: Silence warnings when compiled with -pedantic.Chia-I Wu2010-02-194-4/+10
| | | | Just follow gcc's advices here.
* 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: Revisit global data locking.Chia-I Wu2010-02-174-8/+23
| | | | | Lock the global mutex in _eglPreloadDrivers and _eglAllocScreenHandle. Add comments to why certain pathes do not need locking.
* egl: Always lock a display before using it.Chia-I Wu2010-02-172-45/+81
| | | | | | | 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-173-103/+22
| | | | | Merge _eglNewDisplay and _eglLinkDisplay into _eglFindDisplay. Remove unused _eglUnlinkDisplay.
* egl: Add a mutex to _EGLDisplay.Chia-I Wu2010-02-172-0/+4
| | | | | A display may be shared by multiple threads. Add a mutex for access control.
* 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: Always record error code.Chia-I Wu2010-02-171-4/+5
| | | | | The error code denotes the success or failure of the most recent function call. A call to _eglError should always update the error code.
* 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: Add debug messages to config validation and matching.Chia-I Wu2010-02-051-2/+23
| | | | It might be desirable find out which attribute went wrong.
* egl: Clean up eglconfig.h.Chia-I Wu2010-02-051-14/+7
| | | | | Update the comments to macros/functions. Remove unused _eglSetConfigAttrib.
* egl: Update the comments to typecast macros.Chia-I Wu2010-02-051-0/+6
| | | | | Put a note that the macros define functions and should not be ended with a semicolon when used.
* egl: Clarify IsLinked and IsBound.Chia-I Wu2010-02-052-0/+12
| | | | | | Both a link and a binding creates a reference to the resource. Drivers should not destroy the resource when there is a reference. The difference is better described in doc/egl.html.
* egl: Add macros to define typecast functions.Chia-I Wu2010-02-041-0/+21
| | | | | | | | | | There are standard typecast functions that are common to most drivers. They are used to typecast, for example, an _EGLSurface to a driver-defined type. This commits define _EGL_DRIVER_STANDARD_TYPECASTS and _EGL_DRIVER_TYPECAST that should hopefully save some typings for driver writers.
* egl: fix wrong argument. Use loader_data instead of loaderIgor Oliveira2010-02-041-1/+1
|
* egl: Rename _eglPreloadForEach callbacks.Chia-I Wu2010-02-031-12/+12
| | | | | | | Rename _eglPreloadFile to _eglLoaderFile, and _eglPreloadFile to _eglLoaderFile. There are several _eglPreload* functions. The callbacks do not belong to them and it should be better to give them a different prefix.
* egl: Fix a potential segfault in driver suffix matching.Chia-I Wu2010-02-031-3/+5
| | | | | The driver suffix might be NULL on some platforms. Perform the matching only when there is a suffix.
* egl: Remove unnecessary #ifdef's.Chia-I Wu2010-02-031-8/+0
| | | | | There were some refactorings with the addition of EGL_DRIVERS_PATH. They made some platform #ifdef's unnecessary.
* egl: Ignore certain environment variables when setuid/setgid.Chia-I Wu2010-02-031-2/+16
| | | | | Specifically, ignore EGL_DRIVERS_PATH when an application is setuid/setgid. And ignore EGL_DRIVER when there is a slash in it.
* egl: Add EGL_DRIVERS_PATH environment variable.Chia-I Wu2010-02-031-99/+191
| | | | | | | | | EGL_DRIVERS_PATH gives a list of colon-separated directories. The given directories will be searched when preloading drivers. This is based on Mike Stroyan's patch, which honors the variable in _eglPreloadDisplayDrivers. It is extended to honor the variable also in _eglPreloadUserDriver and _eglPreloadDefaultDriver in this version.
* egl: Remove unnecessary headers.Vinson Lee2010-01-313-3/+0
|
* egl: Clean up surface attributes.Chia-I Wu2010-01-313-57/+127
| | | | | | Add missing attributes and use correct types in _EGLSurface. Remove ifdef tests that serve no purpose. Update _eglQuerySurface and _eglSurfaceAttrib for missing queries and checks.
* egl: Add support for more EGLImage extensions to EGL core.Chia-I Wu2010-01-314-11/+60
| | | | | | Add support EGL_KHR_vg_parent_image and EGL_KHR_gl_*. This is as simple as adding some flags that can be enabled. Individual drivers need to implement the extensions before enbaling the flags.
* egl: Surface type validaction should depend on extensions supported.Chia-I Wu2010-01-311-1/+2
| | | | | EGL_SCREEN_BIT_MESA is a valid bit only when EGL_MESA_screen_surface is supported.
* egl: Initialize display configs with the display.Chia-I Wu2010-01-312-3/+5
| | | | This changes _eglInitConfig to take the display as its argument.
* egl: Initialize display resources with their display.Chia-I Wu2010-01-316-7/+10
| | | | | | | Change _eglInitSurface, _eglInitContext, and _eglInitImage to take an _EGLDisplay instead of an _EGLDriver. This is a more natural form, and plus, the display encodes information such as the extensions supported that might be required for attribute list parsing.
* egl: Refactor _eglInitImage.Chia-I Wu2010-01-311-10/+40
| | | | Refactor attribute list parsing code to _eglParseImageAttribList.
* egl: Refactor _eglInitContext.Chia-I Wu2010-01-311-19/+95
| | | | | Refactor attribute list parsing code to _eglParseContextAttribList. Add a check to make sure the config supports the client API.
* egl: Refactor _eglInitSurface.Chia-I Wu2010-01-311-141/+146
| | | | Refactor attribute list parsing code to _eglParseSurfaceAttribList.
* egl: Remove code blocks that are commented out.Chia-I Wu2010-01-314-113/+4
| | | | | | They are either unit tests or to demonstrate how functions are supposed to be used. The unit test is outdated and it should be better to take a look at any of the working drivers to see how a function is used.
* egl: Remove my_strdup.Chia-I Wu2010-01-301-17/+2
| | | | There is already _eglstrdup for the main library's use.
* egl: Remove unused VisibleRefCount.Chia-I Wu2010-01-301-3/+0
|
* egl: Rename Binding to CurrentContext in _EGLSurface.Chia-I Wu2010-01-302-15/+15
| | | | | A context can be bound to a surface just like it can be bound to a thread. CurrentContext is a more consistent name.
* egl: Clean up header inclusions.Chia-I Wu2010-01-3022-19/+26
| | | | Mainly to remove eglcurrent.h and egldisplay.h from eglglobals.h.
* egl: Remove unnecessary headers.Vinson Lee2010-01-285-5/+0
|
* egl: Migrate drivers to use _eglBindContext.Chia-I Wu2010-01-282-22/+3
| | | | | _eglMakeCurrent is a big hammer that is not easy to use. Migrate drivers to use _eglBindContext and un-export _eglMakeCurrent.
* 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-283-15/+27
| | | | | | 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: Add _eglBindContext.Chia-I Wu2010-01-282-53/+74
| | | | | | It works similar to _eglMakeCurrent, except that the old context and surfaces are returned instead of destroyed. _eglMakeCurrent is now calling the new _eglBindContext.
* egl: Use a boolean to indicate whether a display is initialized.Chia-I Wu2010-01-282-16/+20
| | | | | | 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-263-32/+4
| | | | | _eglCloseDriver is no-op and _eglOpenDriver does nothing but call _eglMatchDriver. Export _eglMatchDriver directly.
* egl: Fix a segfault when a display is initialized again.Chia-I Wu2010-01-261-0/+1
| | | | Reset dpy->MaxConfigs so that dpy->Configs is re-allocated.
* egl: Remove _eglGetCurrentSurface and _eglGetCurrentDisplay.Chia-I Wu2010-01-263-47/+2
| | | | | They have little use in drivers since drivers need to work for multiple current contexts.