summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcontext.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: Fix a false negative check in _eglCheckMakeCurrent.Chia-I Wu2010-10-231-9/+12
| | | | | | | | | | This call sequence eglMakeCurrent(dpy, surf, surf, ctx1); eglMakeCurrent(dpy, surf, surf, ctx2); should be valid if ctx1 and ctx2 have the same client API and are not current in another thread.
* egl: Use reference counting to replace IsLinked or IsBound.Chia-I Wu2010-10-231-32/+43
| | | | | Remove all _egl<Res>IsLinked and _egl<Res>IsBound. Update _eglBindContext and drivers to do reference counting.
* egl: Add reference count for resources.Chia-I Wu2010-10-231-2/+1
| | | | | This is a really simple mechanism. There is no atomicity and the caller is expected to hold the display lock.
* egl: Move fallback routines to eglfallbacks.c.Chia-I Wu2010-10-221-48/+0
| | | | We do not want them to be all over the places.
* egl: Access config attributes directly.Chia-I Wu2010-10-141-5/+6
| | | | Replace SET_CONFIG_ATTRIB/GET_CONFIG_ATTRIB by direct dereferences.
* egl: Simplify _eglBindContext.Chia-I Wu2010-09-101-77/+31
| | | | | | | | | | Remove the hard-to-get-right _eglBindContextToSurfaces. As well as fix an assertion failure from b90a3e7d8b1bcd412ddbf2a4803de2756dacd436 when such call sequence is hit eglMakeCurrent(dpy, surf1, surf1, ctx1); eglMakeCurrent(dpy, surf2, surf2, ctx2); eglMakeCurrent(dpy, surf1, surf1, ctx1);
* egl: Fix context API check and be verbose.Chia-I Wu2010-08-201-9/+11
| | | | | | | The API of the context was not checked against EGL_RENDERABLE_TYPE when there was no attribute list. Move the check to _eglInitContext, and be verbose about common mistakes (EGL_RENDERABLE_TYPE not set, EGL_CONTEXT_CLIENT_VERSION not set, or eglBindAPI not called).
* egl: Fix deref before NULL-checkKristian Høgsberg2010-07-281-1/+2
|
* egl: EGL_KHR_surfaceless_* extensionsKristian Høgsberg2010-07-281-35/+55
| | | | | | | | | 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: 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.
* egl: Initialize display resources with their display.Chia-I Wu2010-01-311-2/+3
| | | | | | | 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 _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: Remove code blocks that are commented out.Chia-I Wu2010-01-311-14/+0
| | | | | | 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: Rename Binding to CurrentContext in _EGLSurface.Chia-I Wu2010-01-301-8/+8
| | | | | 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-301-1/+1
| | | | Mainly to remove eglcurrent.h and egldisplay.h from eglglobals.h.
* egl: Migrate drivers to use _eglBindContext.Chia-I Wu2010-01-281-21/+2
| | | | | _eglMakeCurrent is a big hammer that is not easy to use. Migrate drivers to use _eglBindContext and un-export _eglMakeCurrent.
* egl: eglMakeCurrent should accept an uninitialized display.Chia-I Wu2010-01-281-10/+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: Add _eglBindContext.Chia-I Wu2010-01-281-53/+70
| | | | | | 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: Refactor _eglMakeCurrent.Chia-I Wu2010-01-261-78/+158
| | | | | Refactor _eglMakeCurrent into _eglCheckMakeCurrent, _eglBindContextToSurface, and _eglBindContextToThread.
* egl: Make surfaces and contexts resources.Chia-I Wu2010-01-241-69/+0
| | | | | Turn _EGLSurface and _EGLContext into _EGLResource so that they can be managed uniformly.
* egl: Move context functions in egldisplay.[ch] to eglcontext.[ch].Chia-I Wu2010-01-241-0/+69
| | | | | Move functions to where they should be. There should be no real change here.
* egl: Add support for querying render buffer.Chia-I Wu2009-09-291-7/+33
| | | | Signed-off-by: Chia-I Wu <[email protected]>
* egl: Overhaul driver API.Chia-I Wu2009-08-181-61/+19
| | | | | | | | | | | | 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 eglMakeCurrent more robust.Chia-I Wu2009-08-031-52/+46
| | | | | | | | | | 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 <[email protected]>
* egl: Replace IsBound by a pointer to the binding.Chia-I Wu2009-08-031-7/+7
| | | | | | | | | 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 <[email protected]>
* egl: Remove redundant DeletePending flag.Chia-I Wu2009-07-171-9/+5
| | | | | | | | 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 <[email protected]>
* egl: Use the link functions to manage resources.Chia-I Wu2009-07-171-33/+12
| | | | | | | | 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 <[email protected]>
* egl: Add funtions to link contexts and surfaces to displays.Chia-I Wu2009-07-171-25/+0
| | | | | | | | | | | | | | | | | 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-6/+34
| | | | | | | 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-11/+3
| | | | | | | | | 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 assorted context-related bugsBrian Paul2008-06-191-2/+6
| | | | | | Move memset() to proper place. Added EGL_CONTEXT_CLIENT_VERSION query. Fix bad return EGL_FALSE -> EGL_TRUE.
* egl: clean up prototype code, new _eglFindAPIs() function.Brian Paul2008-06-191-0/+2
|
* egl: clean-up re-org of the client API stateBrian Paul2008-05-301-1/+9
|
* eliminate the context hash tableBrian Paul2008-05-271-21/+32
| | | | | 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-6/+10
|
* some initial EGL 1.2 workBrian Paul2006-01-301-0/+5
|
* Some initial per-thread support.Brian Paul2005-12-101-3/+4
| | | | Rename eglShowSurfaceMESA to eglShowScreenSurfaceMESA.
* Redo _eglInitSurface() so it can be used with all surface types.Brian Paul2005-11-271-16/+46
| | | | Redo _eglInitContext() to do error checking, attribute list parsing, etc.
* Move all the EGL API function pointers into a new _egl_api struct.Brian Paul2005-11-241-3/+3
|
* use EGLint instead of unsigned long for eglCopyContextMESA, added commentsBrian Paul2005-05-161-2/+8
|
* Add empty placeholder for eglCopyContextMESAJon Smirl2005-05-141-0/+8
|
* First attempt at getting egl support up on dumb framebuffer.Jon Smirl2005-05-131-1/+1
| | | | Seems to be mostly working. Not all of egl API is implemented.
* initial EGL codeBrian Paul2005-04-221-0/+226