diff options
author | marha <marha@users.sourceforge.net> | 2013-11-21 08:45:16 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-11-21 08:45:16 +0100 |
commit | 6e90a0e707aa6d28622f654078f25066bef4dc80 (patch) | |
tree | cc95d3e984b2fc4503b5fc8ae731518a8c34fe7c /xorg-server/present/present_fence.c | |
parent | f75616ac3e99a6bb814803c823cb34533b9fc328 (diff) | |
parent | bb953a87489963f63e65c797a1f2837382ff7808 (diff) | |
download | vcxsrv-6e90a0e707aa6d28622f654078f25066bef4dc80.tar.gz vcxsrv-6e90a0e707aa6d28622f654078f25066bef4dc80.tar.bz2 vcxsrv-6e90a0e707aa6d28622f654078f25066bef4dc80.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
xserver mesa git update 21 nov 2013
Diffstat (limited to 'xorg-server/present/present_fence.c')
-rw-r--r-- | xorg-server/present/present_fence.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/xorg-server/present/present_fence.c b/xorg-server/present/present_fence.c index 99855ee57..8be32e1a7 100644 --- a/xorg-server/present/present_fence.c +++ b/xorg-server/present/present_fence.c @@ -37,6 +37,8 @@ struct present_fence { SyncTrigger trigger; SyncFence *fence; + void (*callback)(void *param); + void *param; }; /* @@ -45,12 +47,18 @@ struct present_fence { static Bool present_fence_sync_check_trigger(SyncTrigger *trigger, XSyncValue oldval) { - return FALSE; + struct present_fence *present_fence = container_of(trigger, struct present_fence, trigger); + + return present_fence->callback != NULL; } static void present_fence_sync_trigger_fired(SyncTrigger *trigger) { + struct present_fence *present_fence = container_of(trigger, struct present_fence, trigger); + + if (present_fence->callback) + (*present_fence->callback)(present_fence->param); } static void @@ -101,6 +109,25 @@ present_fence_set_triggered(struct present_fence *present_fence) (*present_fence->fence->funcs.SetTriggered) (present_fence->fence); } +Bool +present_fence_check_triggered(struct present_fence *present_fence) +{ + if (!present_fence) + return TRUE; + if (!present_fence->fence) + return TRUE; + return (*present_fence->fence->funcs.CheckTriggered)(present_fence->fence); +} + +void +present_fence_set_callback(struct present_fence *present_fence, + void (*callback) (void *param), + void *param) +{ + present_fence->callback = callback; + present_fence->param = param; +} + XID present_fence_id(struct present_fence *present_fence) { |