diff options
author | Marek Olšák <[email protected]> | 2015-04-10 23:35:39 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-04-30 14:38:38 +0200 |
commit | a2557b30d843d4f3dada6a022f27e8343adabca8 (patch) | |
tree | c7fd9cddf92a0f5d6d6a6981f3b4f1aab0f8f748 /src/egl/main/eglsync.c | |
parent | 290a3eb7507f7f2949753a77c425ed2bb6fd0dd1 (diff) |
egl/dri2: return the latest sync status in eglGetSyncAttribKHR
Diffstat (limited to 'src/egl/main/eglsync.c')
-rw-r--r-- | src/egl/main/eglsync.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c index 3b4a88902fd..8b8ab16b0d2 100644 --- a/src/egl/main/eglsync.c +++ b/src/egl/main/eglsync.c @@ -30,6 +30,7 @@ #include "eglsync.h" #include "eglcurrent.h" +#include "egldriver.h" #include "egllog.h" @@ -144,13 +145,19 @@ _eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLint attribute, EGLint *value) { if (!value) - return _eglError(EGL_BAD_PARAMETER, "eglGetConfigs"); + return _eglError(EGL_BAD_PARAMETER, "eglGetSyncAttribKHR"); switch (attribute) { case EGL_SYNC_TYPE_KHR: *value = sync->Type; break; case EGL_SYNC_STATUS_KHR: + /* update the sync status */ + if (sync->SyncStatus != EGL_SIGNALED_KHR && + (sync->Type == EGL_SYNC_FENCE_KHR || + sync->Type == EGL_SYNC_CL_EVENT_KHR)) + drv->API.ClientWaitSyncKHR(drv, dpy, sync, 0, 0); + *value = sync->SyncStatus; break; case EGL_SYNC_CONDITION_KHR: |