summaryrefslogtreecommitdiff
path: root/test/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c
index 2e8649d..c1e92d9 100644
--- a/test/test.c
+++ b/test/test.c
@@ -72,6 +72,7 @@ main(int argc, char *argv[])
EGL_DRM_BUFFER_USE_MESA, EGL_DRM_BUFFER_USE_SCANOUT_MESA,
EGL_NONE
};
+ EGLSyncKHR esync;
num = wfdEnumerateDevices(NULL, 0, NULL);
printf("num: %d\n", num);
@@ -208,13 +209,28 @@ main(int argc, char *argv[])
sleep(1);
+ esync = eglCreateSyncKHR(edpy, EGL_SYNC_REUSABLE_KHR, NULL);
+ wfdDeviceEventAsync(dev, event, edpy, esync);
+
wfdBindSourceToPipeline(dev, pipeline, source[0],
WFD_TRANSITION_AT_VSYNC, NULL);
/* commit entire device should work as well :) */
wfdDeviceCommit(dev, WFD_COMMIT_ENTIRE_DEVICE, WFD_INVALID_HANDLE);
+ EGLint status = eglClientWaitSyncKHR(edpy, esync, 0, EGL_FOREVER_KHR);
+ switch (status) {
+ case EGL_CONDITION_SATISFIED_KHR:
+ printf("condition satisfied\n");
+ WFDEventType type = wfdDeviceEventWait(dev, event, WFD_FOREVER);
+ break;
+ default:
+ printf("ClientWaitSync badly returned: %d\n", status);
+ return 5;
+ }
+
sleep(1);
+ wfdDestroyEvent(dev, event);
wfdDestroySource(dev, source[0]);
wfdDestroySource(dev, source[1]);
wfdDestroyEvent(dev, event);