Allows callers to query whether or not a given fence sync object is currently triggered.
Signed-off-by: James Jones <jajo...@nvidia.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> Reviewed-by: Robert Morell <rmor...@nvidia.com> --- Xext/sync.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/Xext/sync.c b/Xext/sync.c index 18d2477..96c848a 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -1874,6 +1874,38 @@ ProcSyncDestroyFence(ClientPtr client) return client->noClientException; } +static int +ProcSyncQueryFence(ClientPtr client) +{ + REQUEST(xSyncQueryFenceReq); + xSyncQueryFenceReply rep; + SyncFence *pFence; + int rc; + + REQUEST_SIZE_MATCH(xSyncQueryFenceReq); + + rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, + RTFence, client, DixReadAccess); + if (rc != Success) + return rc; + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.triggered = pFence->triggered; + + if (client->swapped) + { + char n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + } + + WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep); + return client->noClientException; +} + /* * ** Given an extension request, call the appropriate request procedure */ @@ -1920,6 +1952,8 @@ ProcSyncDispatch(ClientPtr client) return ProcSyncResetFence(client); case X_SyncDestroyFence: return ProcSyncDestroyFence(client); + case X_SyncQueryFence: + return ProcSyncQueryFence(client); default: return BadRequest; } @@ -2172,6 +2206,19 @@ SProcSyncDestroyFence(ClientPtr client) } static int +SProcSyncQueryFence(ClientPtr client) +{ + REQUEST(xSyncQueryFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH (xSyncQueryFenceReq); + swapl(&stuff->fid, n); + + return ProcSyncQueryFence(client); +} + +static int SProcSyncDispatch(ClientPtr client) { REQUEST(xReq); @@ -2214,6 +2261,8 @@ SProcSyncDispatch(ClientPtr client) return SProcSyncResetFence(client); case X_SyncDestroyFence: return SProcSyncDestroyFence(client); + case X_SyncQueryFence: + return SProcSyncQueryFence(client); default: return BadRequest; } -- 1.7.1 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel