[PATCH libXext (rev3) 5/5] Add XSyncAwaitFence()
James Jones
jajones at nvidia.com
Thu Dec 2 09:26:31 PST 2010
Add the XSynceFence version of XSyncAwait(). Waits
for fence objects to reach the triggered state.
Signed-off-by: James Jones <jajones at nvidia.com>
Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
---
include/X11/extensions/sync.h | 6 ++++++
src/XSync.c | 21 +++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/include/X11/extensions/sync.h b/include/X11/extensions/sync.h
index 6a44ab9..a00d9c5 100644
--- a/include/X11/extensions/sync.h
+++ b/include/X11/extensions/sync.h
@@ -362,6 +362,12 @@ extern Bool XSyncQueryFence(
Bool* /*triggered*/
);
+extern Bool XSyncAwaitFence(
+ Display* /*dpy*/,
+ const XSyncFence* /*fence_list*/,
+ int /*n_fences*/
+);
+
_XFUNCPROTOEND
#endif /* _SYNC_SERVER */
diff --git a/src/XSync.c b/src/XSync.c
index ca9a67c..2bdecfc 100644
--- a/src/XSync.c
+++ b/src/XSync.c
@@ -874,6 +874,27 @@ XSyncQueryFence(Display *dpy, XSyncFence fence, Bool *triggered)
return True;
}
+Bool
+XSyncAwaitFence(Display *dpy, const XSyncFence *fence_list, int n_fences)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xSyncAwaitFenceReq *req;
+
+ SyncCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(SyncAwaitFence, req);
+ req->reqType = info->codes->major_opcode;
+ req->syncReqType = X_SyncAwaitFence;
+ SetReqLen(req, n_fences, n_fences);
+
+ Data32(dpy, (char *)fence_list, sizeof(CARD32) * n_fences);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
/*
* Functions corresponding to the macros for manipulating 64-bit values
*/
--
1.7.1
More information about the xorg-devel
mailing list