summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-05-02 13:16:28 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-05-02 14:00:59 +0200
commit8b0e1a179836ef4b97879831240db704eae057ae (patch)
tree0995f8c404c9e3c905d184e8f27b59cd42cf7094
parent4674126e57d84a52754bc6feccafdde3e3bea6a4 (diff)
egl_dri2: Implement EGL_MESA_reusable_sync_eventfdeglsync
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index f60b17e60f..7beae1cb39 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -474,6 +474,10 @@ dri2_create_screen(_EGLDisplay *disp)
disp->Extensions.KHR_reusable_sync = EGL_TRUE;
#endif
+#if EGL_MESA_reusable_sync_eventfd
+ disp->Extensions.MESA_reusable_sync_eventfd = EGL_TRUE;
+#endif
+
return EGL_TRUE;
cleanup_dri_screen:
@@ -1283,6 +1287,23 @@ dri2_create_sync(_EGLDriver *drv, _EGLDisplay *disp,
}
#endif
+#ifdef EGL_MESA_reusable_sync_eventfd
+
+static EGLint
+dri2_create_sync_eventfd(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync)
+{
+ struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
+
+ if (dri2_sync->base.Type != EGL_SYNC_REUSABLE_KHR) {
+ _eglError(EGL_BAD_MATCH, "eglCreateSyncEventfdMESA");
+ return -1;
+ }
+
+ return dup(dri2_sync->epoll_fd);
+}
+
+#endif
+
static void
dri2_unload(_EGLDriver *drv)
{
@@ -1380,6 +1401,10 @@ _EGL_MAIN(const char *args)
dri2_drv->base.API.SignalSyncKHR = dri2_signal_sync;
#endif
+#ifdef EGL_MESA_reusable_sync_eventfd
+ dri2_drv->base.API.CreateSyncEventfdMESA = dri2_create_sync_eventfd;
+#endif
+
dri2_drv->base.Name = "DRI2";
dri2_drv->base.Unload = dri2_unload;