summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-09-22 07:44:59 +0200
committerLuca Barbieri <[email protected]>2010-09-22 08:01:49 +0200
commita0e510320009766faa5ff8c0ed744e87f8095df7 (patch)
treeca735328fd7aa20162521a7cdd414afef0e393ff /src/glx/dri2.c
parente1e7c8df7fd0670d0c133c006c02e0257be94bf9 (diff)
glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x build
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.
Diffstat (limited to 'src/glx/dri2.c')
-rw-r--r--src/glx/dri2.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index 30999c899a7..adfd3d1f7c8 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -98,16 +98,13 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
{
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
- __GLXDRIdrawable *pdraw;
- struct glx_display *glx_dpy = __glXInitialize(dpy);
/* Ignore swap events if we're not looking for them */
- pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable);
- if (!pdraw || !(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
- return False;
+ aevent->type = dri2GetSwapEventType(dpy, awire->drawable);
+ if(!aevent->type)
+ return False;
aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
- aevent->type = glx_dpy->codes->first_event + GLX_BufferSwapComplete;
aevent->send_event = (awire->type & 0x80) != 0;
aevent->display = dpy;
aevent->drawable = awire->drawable;