summaryrefslogtreecommitdiff
path: root/src/glx/dri2.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-02-08 19:27:56 +0100
committerKristian Høgsberg <krh@bitplanet.net>2010-02-16 10:38:50 -0500
commit61d26bc82e7c4100acfb551cbb0ba9d84bbc4ba5 (patch)
treecf096e387a6683a976e152586c355339de3c133e /src/glx/dri2.c
parent925b901ba313a3ddd7567eca088951be39414430 (diff)
dri2: Event driven buffer validation.
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 <krh@bitplanet.net>
Diffstat (limited to 'src/glx/dri2.c')
-rw-r--r--src/glx/dri2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index 91053d3fb6..a7a8cb50aa 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -81,7 +81,7 @@ static XEXT_GENERATE_FIND_DISPLAY (DRI2FindDisplay,
dri2Info,
dri2ExtensionName,
&dri2ExtensionHooks,
- 1, NULL)
+ DRI2NumberEvents, NULL)
static Bool
DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
@@ -126,7 +126,15 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
return True;
}
#endif
+#ifdef DRI2_InvalidateBuffers
+ case DRI2_InvalidateBuffers:
+ {
+ xDRI2InvalidateBuffers *awire = (xDRI2InvalidateBuffers *)wire;
+ dri2InvalidateBuffers(dpy, awire->drawable);
+ return False;
+ }
+#endif
default:
/* client doesn't support server event */
break;