summaryrefslogtreecommitdiff
path: root/src/glx/x11/dri2.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@jbarnes-desktop.localdomain>2009-11-10 13:28:01 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-01-08 12:33:32 -0500
commitefc82e7c703f9160cfdbe6d97e166ca6f5e75d86 (patch)
treef0c5d65580be40ee818758b11276531dcb6142bd /src/glx/x11/dri2.c
parentdaf7fe69f7bd0caa955d30b43fc35b7ce0069b6b (diff)
DRI2: add SwapInterval support
Add support for the DRI2SwapInterval protocol request. This allows direct rendered clients to control their swap interval per the SGI_swap_control extension. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'src/glx/x11/dri2.c')
-rw-r--r--src/glx/x11/dri2.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c
index 922edbdcf5..9ce633c40d 100644
--- a/src/glx/x11/dri2.c
+++ b/src/glx/x11/dri2.c
@@ -537,4 +537,21 @@ Bool DRI2WaitSBC(Display *dpy, XID drawable, CARD64 target_sbc, CARD64 *ust,
return True;
}
+void DRI2SwapInterval(Display *dpy, XID drawable, int interval)
+{
+ XExtDisplayInfo *info = DRI2FindDisplay(dpy);
+ xDRI2SwapIntervalReq *req;
+
+ XextSimpleCheckExtension (dpy, info, dri2ExtensionName);
+
+ LockDisplay(dpy);
+ GetReq(DRI2SwapInterval, req);
+ req->reqType = info->codes->major_opcode;
+ req->dri2ReqType = X_DRI2SwapInterval;
+ req->drawable = drawable;
+ req->interval = interval;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
#endif /* GLX_DIRECT_RENDERING */