summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2.c
Commit message (Collapse)AuthorAgeFilesLines
* glx: cleanup unneeded headersEmil Velikov2014-03-111-1/+0
| | | | | | | | | | | - xf86dri.h is the old dri1 header, not required by dri2 nor dri3 - fold xf86drm.h inclusiong inside dri2.h - dri3_glx does not have any drm specific dependencies - glapi.h is not required by the dri2 and dri3 codepaths Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jon TURNEY <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx: Add missing null check in DRI2WireToEventJuha-Pekka Heikkila2013-12-111-0/+2
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Replace DRI2SwapBuffers() custom protocol with XCB.Eric Anholt2012-10-091-44/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* glx: Replace DRI2SwapInterval custom protocol with XCB.Eric Anholt2012-10-091-19/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* glx: Replace DRI2GetMSC custom protocol with XCB.Eric Anholt2012-10-091-33/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* glx: Replace DRI2WaitForMSC custom protocol with XCB.Eric Anholt2012-10-091-46/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* glx: Replace DRI2WaitForSBC custom protocol with XCB.Eric Anholt2012-10-091-41/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* glx: move 'prime' var into #ifdef'd code blockBrian Paul2012-09-061-8/+10
| | | | | | To silence unused var warning. Reviewed-by: Jose Fonseca <[email protected]>
* Remove Xcalloc/Xmalloc/Xfree callsMatt Turner2012-09-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These calls allowed Xlib to use a custom memory allocator, but Xlib has used the standard C library functions since at least its initial import into git in 2003. It seems unlikely that it will grow a custom memory allocator. The functions now just add extra overhead. Replacing them will make future Coccinelle patches simpler. This patch has been generated by the following Coccinelle semantic patch: // Remove Xcalloc/Xmalloc/Xfree calls @@ expression E1, E2; @@ - Xcalloc (E1, E2) + calloc (E1, E2) @@ expression E; @@ - Xmalloc (E) + malloc (E) @@ expression E; @@ - Xfree (E) + free (E) @@ expression E; @@ - XFree (E) + free (E) Reviewed-by: Brian Paul <[email protected]>
* glx/dri2: add dri2 prime support.Dave Airlie2012-08-161-0/+13
| | | | | | | | | | This adds support for having libGL pick a different driver for prime support. DRI_PRIME env var is set to the value retrieved from the server randr provider calls, by the calling process. (generally DRI_PRIME=1 will be the right answer). Signed-off-by: Dave Airlie <[email protected]>
* glx/dri2: Paper over errors in DRI2Connect when indirectChristopher James Halse Rogers2011-08-051-0/+9
| | | | | | | | | | | | DRI2 will throw BadRequest for this when the client is not local, but DRI2 is an implementation detail and not something callers should have to know about. Silently swallow errors in this case, and just propagate the failure through DRI2Connect's return code. Note: This is a candidate for the stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125 Signed-off-by: Christopher James Halse Rogers <[email protected]>
* GLX/DRI2: handle swap event swap count wrappingJesse Barnes2011-07-081-1/+11
| | | | | | | | | | | Create a new GLX drawable struct to track client related info, and add a wrap counter to it drawable and track it as we receive events. This allows us to support the full 64 bits of the event structure we pass to the client even though the server only gives us a 32 bit count. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
* DRI2/GLX: use new swap event typesJesse Barnes2011-07-081-2/+2
| | | | | | | | Use the new swap event type so we get valid SBC values. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
* Revert "DRI2/GLX: make swap event handling match spec"Dave Airlie2011-05-051-1/+1
| | | | | | | This reverts commit 70227e21bbd4411956ceeb5039640140e64a11a8. revert this until we sort things out, with a new glproto release with compatible struct names.
* DRI2/GLX: make swap event handling match specJesse Barnes2011-05-041-1/+1
| | | | | | | We only handle a 32 bit swap count, so use the new structure definitions. Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
* glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x buildLuca Barbieri2010-09-221-6/+3
| | | | | | | | | | | | | | | The Gallium EGL state tracker reuses dri2.c but not the GLX code. Currently there is a bit of code in dri2.c that is incorrectly tied to GLX: instead, make it call an helper that both GLX and Gallium EGL implement, like dri2InvalidateBuffers. This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId is undefined. Note that we might want to move the whole event translation elsewhere, and probably stop using non-XCB DRI2 altogether, but this seems to be the minimal fix.
* glx: Ignore DRI2 event for drawables we've destroyedKristian Høgsberg2010-09-081-1/+1
| | | | | | Since we now actually destroy GLX drawables, we get into situations where we get events for drawables that no longer exist. Just ignore the event in that case.
* glx: Drop broken drawable garbage collectionKristian Høgsberg2010-09-081-0/+8
| | | | | | Doesn't work for pixmaps, was looking up the GLX XID and was never thread safe. Instead, just destroy the client side structures when the drawable is no long current for a context.
* glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types.Kristian Høgsberg2010-07-281-1/+1
|
* Avoid compiler warning for unused glx_dpy variable.Carl Worth2010-07-281-1/+1
| | | | | | | | | | My earlier attempt to eliminate this warning (c0ca2bfb2ad8c) was invalid as it removed the variable declaration. Jerome correctly reverted that (600c85efdb0ff) since the variable is used when X_DRI2SwapBuffers is defined. Here, instead of removing the declaration, we move it to inside the correct #ifdef.
* glx: Use _Xglobal_lock for protecting extension display listKristian Høgsberg2010-07-221-2/+2
| | | | Avoids double locking glXLock in the X wire to event handlers.
* Revert "dri2: Remove an unused variable."Jerome Glisse2010-07-211-0/+1
| | | | | glx_info is used if X_DRI2SwapBuffers is defined This reverts commit c0ca2bfb2ad8cf7fb9d756b5ae52cb77236ff605.
* dri2: Remove an unused variable.Carl Worth2010-07-211-1/+0
| | | | To quiet a compiler warning.
* glx: Fix drawable lookup in DRI2 event handlerKristian Høgsberg2010-07-191-1/+2
| | | | | | DRI2 events are sent to the X drawable ID used to create the DRI2 drawable, not the GLX drawable ID. So when an event comes in, we need to look up the __GLXDRIdrawable by its X drawable ID, which needs a new hash table.
* dri2: Track event mask in client code.Nick Bowler2010-07-141-0/+6
| | | | | | | | | | | | | | | | | | | When direct rendering is being used, DRI2 BufferSwapComplete events are sent unconditionally to clients, even if they haven't been requested. This causes error messages to be printed by every freeglut application of the form freeglut (./gears): Unknown X event type: 104 and might confuse other clients. This is a fixed up version of the patch by Jesse Barnes, which drops BufferSwapComplete events if they are not requested by clients. Fixes fdo bug 27962. Signed-off-by: Nick Bowler <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
* mesa: Purge macros NEED_EVENTS and NEED_REPLIESFernando Carrijo2010-07-011-1/+0
| | | | | Signed-off-by: Fernando Carrijo <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* DRI2: report swap events correctly in direct rendered caseJesse Barnes2010-04-131-2/+1
| | | | | | | In the direct rendered case, we need to convert DRI2 swap complete events to GLX events for the client to consume. This path had what looks like a stray "& 0x75" from some earlier debugging that prevented clients from seeing the right event code.
* Update to final names from GLX_INTEL_swap_event specIan Romanick2010-04-041-1/+1
| | | | Fixes bug #27454.
* glx: Suppress BadDrawable from DRI2CopyRegionKristian Høgsberg2010-03-221-1/+14
| | | | | | | | | | This can happen when an X window is destroyed behind our back. We use DRI2CopyRegion behind the scenes in many places (like flushing the fake front to the real front) so we have to ignore X errors triggered in that case. The glean test cases trigger this consistently as they don't destroy the GLX drawable nicely, they just destroy the X window.
* glx: Fix a couple of warningsKristian Høgsberg2010-02-161-2/+0
|
* glx: Only register wire handlers for the events the server supportsKristian Høgsberg2010-02-161-1/+20
|
* dri2: Event driven buffer validation.Francisco Jerez2010-02-161-1/+9
| | | | | | | | | | | | | | | | | | When a buffer invalidation event is received from the X server, the "invalidate" hook of the DRI2 flush extension is executed: A generic implementation (dri2InvalidateDrawable) is provided that just bumps the "pStamp" sequence number in __DRIdrawableRec. For old servers not supporting buffer invalidation events, the invalidate hook will be called before flushing the fake front/back buffer (that's typically once per frame -- not a lot worse than the situation we were in before). No effort has been made on preserving backwards compatibility with version 2 of the flush extension, but I think it's acceptable because AFAIK no released stack is making use of it. Signed-off-by: Kristian Høgsberg <[email protected]>
* Retire miniglx and move the actual glx code up to src/glxKristian Høgsberg2010-02-091-0/+645