[Mesa-dev] [RFC 01/12] egl: initialize SyncCondition after attr parsing

Chad Versace chadversary at chromium.org
Mon Oct 10 17:43:48 UTC 2016


From: Rob Clark <robclark at freedesktop.org>

Reduce the noise in the next patch.  For EGL_SYNC_NATIVE_FENCE_ANDROID
the sync condition is conditional on EGL_SYNC_NATIVE_FENCE_FD_ANDROID
attribute.

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/egl/main/eglsync.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c
index dea324b..eb9950d 100644
--- a/src/egl/main/eglsync.c
+++ b/src/egl/main/eglsync.c
@@ -84,6 +84,10 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
    sync->Type = type;
    sync->SyncStatus = EGL_UNSIGNALED_KHR;
 
+   err = _eglParseSyncAttribList(sync, attrib_list);
+   if (err != EGL_SUCCESS)
+      return _eglError(err, "eglCreateSyncKHR");
+
    switch (type) {
    case EGL_SYNC_CL_EVENT_KHR:
       sync->SyncCondition = EGL_SYNC_CL_EVENT_COMPLETE_KHR;
@@ -92,10 +96,6 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
       sync->SyncCondition = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR;
    }
 
-   err = _eglParseSyncAttribList(sync, attrib_list);
-   if (err != EGL_SUCCESS)
-      return _eglError(err, "eglCreateSyncKHR");
-
    if (type == EGL_SYNC_CL_EVENT_KHR && !sync->CLEvent)
       return _eglError(EGL_BAD_ATTRIBUTE, "eglCreateSyncKHR");
 
-- 
2.10.0



More information about the mesa-dev mailing list