summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-04-10 12:04:18 +0200
committerMarek Olšák <[email protected]>2015-04-30 14:38:38 +0200
commita8617cc0428dcc8340cb85776e122c6534a0fa11 (patch)
tree4eaedf7960f231a088274771ccab2125e5b49ed7 /src/egl/drivers
parent9a0bda2430f10fbf43c64573412d97b6cc38e5d7 (diff)
egl/dri2: implement EGL_KHR_wait_sync
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 97175aef4d5..e096a7df282 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -530,6 +530,7 @@ dri2_setup_screen(_EGLDisplay *disp)
if (dri2_dpy->fence) {
disp->Extensions.KHR_fence_sync = EGL_TRUE;
+ disp->Extensions.KHR_wait_sync = EGL_TRUE;
}
if (dri2_dpy->image) {
@@ -2272,6 +2273,19 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
return ret;
}
+static EGLint
+dri2_server_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
+{
+ _EGLContext *ctx = _eglGetCurrentContext();
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
+ struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
+
+ dri2_dpy->fence->server_wait_sync(dri2_ctx->dri_context,
+ dri2_sync->fence, 0);
+ return EGL_TRUE;
+}
+
static void
dri2_unload(_EGLDriver *drv)
{
@@ -2386,6 +2400,7 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.GetSyncValuesCHROMIUM = dri2_get_sync_values_chromium;
dri2_drv->base.API.CreateSyncKHR = dri2_create_sync;
dri2_drv->base.API.ClientWaitSyncKHR = dri2_client_wait_sync;
+ dri2_drv->base.API.WaitSyncKHR = dri2_server_wait_sync;
dri2_drv->base.API.DestroySyncKHR = dri2_destroy_sync;
dri2_drv->base.Name = "DRI2";