summaryrefslogtreecommitdiff
path: root/src/glx/x11/dri2.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-01-20 03:01:14 +0000
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-01-25 15:40:56 -0800
commit7a9329ba99fe1242c07fbf4fd04e7a4dbeba2e72 (patch)
treed5e6f61d16534c8d8f9422a7d7a0038a55047bcf /src/glx/x11/dri2.c
parent9b22427911ad27efc1f36faee9462c6082d0417c (diff)
mesa: misc GLX_INTEL_swap_event fixes
Fixup a few issues found through testing: - update GLX names to match glproto - register DRI2WireToEvent so it actually gets called Signed-off-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'src/glx/x11/dri2.c')
-rw-r--r--src/glx/x11/dri2.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c
index 2cb5d3463a..832935a3ba 100644
--- a/src/glx/x11/dri2.c
+++ b/src/glx/x11/dri2.c
@@ -81,12 +81,15 @@ static XEXT_GENERATE_FIND_DISPLAY (DRI2FindDisplay,
dri2Info,
dri2ExtensionName,
&dri2ExtensionHooks,
- 0, NULL)
+ 1, NULL)
static Bool
DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
{
XExtDisplayInfo *info = DRI2FindDisplay(dpy);
+ XExtDisplayInfo *glx_info = __glXFindDisplay(dpy);
+ static int glx_event_base;
+ static Bool found_glx_info = False;
XextCheckExtension(dpy, info, dri2ExtensionName, False);
@@ -95,21 +98,26 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
{
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
- switch (awire->type) {
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->type =
+ (glx_info->codes->first_event + GLX_BufferSwapComplete) & 0x75;
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
+ aevent->drawable = awire->drawable;
+ switch (awire->event_type) {
case DRI2_EXCHANGE_COMPLETE:
- aevent->event_type = GLX_EXCHANGE_COMPLETE;
+ aevent->event_type = GLX_EXCHANGE_COMPLETE_INTEL;
break;
case DRI2_BLIT_COMPLETE:
- aevent->event_type = GLX_BLIT_COMPLETE;
+ aevent->event_type = GLX_BLIT_COMPLETE_INTEL;
break;
case DRI2_FLIP_COMPLETE:
- aevent->event_type = GLX_FLIP_COMPLETE;
+ aevent->event_type = GLX_FLIP_COMPLETE_INTEL;
break;
default:
/* unknown swap completion type */
return False;
}
- aevent->drawable = awire->drawable;
aevent->ust = ((CARD64)awire->ust_hi << 32) | awire->ust_lo;
aevent->msc = ((CARD64)awire->msc_hi << 32) | awire->msc_lo;
aevent->sbc = ((CARD64)awire->sbc_hi << 32) | awire->sbc_lo;