summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsync.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-08-15 17:09:48 +0800
committerChia-I Wu <[email protected]>2010-08-17 00:06:19 +0800
commit2b2c5c4f5cb4620044eeaa7cc308e696209c7046 (patch)
tree73491cce8ec3d2e3fcbd144a1f3560598cb38506 /src/egl/main/eglsync.c
parent4b2495661f3a5ac8ed07b68c5d5bf90adee2c37d (diff)
egl: Add support for EGL_KHR_fence_sync.
Individual drivers still need to support and enable the extension.
Diffstat (limited to 'src/egl/main/eglsync.c')
-rw-r--r--src/egl/main/eglsync.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c
index 3f51e89acd6..b6c62d0087d 100644
--- a/src/egl/main/eglsync.c
+++ b/src/egl/main/eglsync.c
@@ -46,7 +46,8 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
{
EGLint err;
- if (!(type == EGL_SYNC_REUSABLE_KHR && dpy->Extensions.KHR_reusable_sync))
+ if (!(type == EGL_SYNC_REUSABLE_KHR && dpy->Extensions.KHR_reusable_sync) &&
+ !(type == EGL_SYNC_FENCE_KHR && dpy->Extensions.KHR_fence_sync))
return _eglError(EGL_BAD_ATTRIBUTE, "eglCreateSyncKHR");
memset(sync, 0, sizeof(*sync));
@@ -55,6 +56,7 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
sync->Type = type;
sync->SyncStatus = EGL_UNSIGNALED_KHR;
+ sync->SyncCondition = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR;
err = _eglParseSyncAttribList(sync, attrib_list);
if (err != EGL_SUCCESS)
@@ -109,6 +111,11 @@ _eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
case EGL_SYNC_STATUS_KHR:
*value = sync->SyncStatus;
break;
+ case EGL_SYNC_CONDITION_KHR:
+ if (sync->Type != EGL_SYNC_FENCE_KHR)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglGetSyncAttribKHR");
+ *value = sync->SyncCondition;
+ break;
default:
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetSyncAttribKHR");
break;