[Mesa-dev] [PATCH 04/10] egl: add EGL_ANDROID_native_fence_sync

Chad Versace chadversary at chromium.org
Wed Nov 23 23:53:12 UTC 2016


On Fri 18 Nov 2016, Rob Clark wrote:
> From: Rob Clark <robclark at freedesktop.org>
> 
> With fixes from Chad squashed in, plus fixes for issues that Rafael
> found while writing piglit tests.
> 
> Cc: Chad Versace <chadversary at chromium.org>
> Cc: Rafael Antognolli <rafael.antognolli at intel.com>
> Signed-off-by: Rob Clark <robclark at freedesktop.org>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 58 ++++++++++++++++++++++++++++++++++++++++-
>  src/egl/main/eglapi.c           | 38 ++++++++++++++++++++++++---
>  src/egl/main/eglapi.h           |  2 ++
>  src/egl/main/egldisplay.h       |  1 +
>  src/egl/main/eglfallbacks.c     |  1 +
>  src/egl/main/eglsync.c          | 22 ++++++++++++++--
>  src/egl/main/eglsync.h          |  1 +
>  7 files changed, 117 insertions(+), 6 deletions(-)


> @@ -1630,6 +1631,10 @@ _eglCreateSync(_EGLDisplay *disp, EGLenum type, const EGLAttrib *attrib_list,

A small fix is needed here, in _eglCreateSync above the switch statement, to
avoid a segfault in Rafael's Piglit test
'eglCreateSyncKHR_native_no_current_context'. Credit goes to Rafael, who has
this hunk as a fixup patch in his tree.

    /* If type is EGL_SYNC_FENCE and no context is current for the bound API  
     * (i.e., eglGetCurrentContext returns EGL_NO_CONTEXT ), an EGL_BAD_MATCH 
     * error is generated.                                                    
     */                                                                       
-   if (!ctx && type == EGL_SYNC_FENCE_KHR)                                   
+   if (!ctx &&                                                               
+       (type == EGL_SYNC_FENCE_KHR || type == EGL_SYNC_NATIVE_FENCE_ANDROID))
       RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);                


[...]

>        if (!disp->Extensions.KHR_cl_event2)
>           RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
>        break;
> +   case EGL_SYNC_NATIVE_FENCE_ANDROID:
> +      if (!disp->Extensions.ANDROID_native_fence_sync)
> +         RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
> +      break;
>     default:
>        RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
>     }
> @@ -1702,7 +1707,8 @@ eglDestroySync(EGLDisplay dpy, EGLSync sync)

Thanks for squashing my fixes in.

With Rafael's hunk squashed in too, patch 4 is
Reviewed-by: Chad Versace <chadversary at chromium.org>
Tested-by: Chad Versace <chadversary at chromium.org>

Rafael, I'll resubmit my i965 patches after ickle's kernel patches land in an
upstream tree.


More information about the mesa-dev mailing list