egl: initialize SyncCondition after attr parsing
authorRob Clark <robclark@freedesktop.org>
Fri, 18 Nov 2016 13:39:30 +0000 (08:39 -0500)
committerChad Versace <chadversary@chromium.org>
Thu, 1 Dec 2016 18:52:55 +0000 (10:52 -0800)
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@freedesktop.org>
Tested-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Tested-by: Chad Versace <chadversary@chromium.org>
src/egl/main/eglsync.c

index dea324b114e1951a1b1d4ff58a6cefd0ce0e800c..005cb31fc31bb994fcb59dd544bf206d40ac6c19 100644 (file)
@@ -84,6 +84,8 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
    sync->Type = type;
    sync->SyncStatus = EGL_UNSIGNALED_KHR;
 
+   err = _eglParseSyncAttribList(sync, attrib_list);
+
    switch (type) {
    case EGL_SYNC_CL_EVENT_KHR:
       sync->SyncCondition = EGL_SYNC_CL_EVENT_COMPLETE_KHR;
@@ -92,7 +94,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");