[Mesa-dev] [RFC 00/12] egl, i965: Support EGL_ANDROID_native_fence_sync (v2)

Rob Clark robdclark at gmail.com
Mon Oct 10 19:41:05 UTC 2016


On Mon, Oct 10, 2016 at 1:43 PM, Chad Versace <chadversary at chromium.org> wrote:
> Background:
>
>     This extension is needed by Android (via ARC++) on Chrome OS.
>     Essentially, this extension provides a translation between EGLSync and
>     explicit cross-process synchronization points, represented as "sync
>     fds".  The relevant documentation is:
>
>       [1]: https://www.khronos.org/registry/egl/extensions/ANDROID/EGL_ANDROID_native_fence_sync.txt
>       [2]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/sync_file.txt?id=refs/tags/v4.7-rc6
>       [3]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/sync_file.h?id=refs/tags/v4.7-rc6
>       [4]: https://source.android.com/devices/graphics/index.html#synchronization_framework
>       [5]: https://source.android.com/devices/graphics/implement.html#explicit_synchronization
>
>     This series is only an RFC because the i915 kernel interface is not yet
>     upstream. Here's the upstream status:
>
>       - Core kernel support for sync files was merged into Linux 4.7. See
>        [2] and [3] above.
>
>       - Chris Wilson is actively working on the i915 interface.
>
>     This series builds on some of Rob Clark's previous RFC patches, which
>     are included here. Some of my patches make changes to Rob's or document
>     open questions about Rob's; those patches are prefixed with either
>     'squash!' or 'todo!'.
>
> Testing:
>
>     I haven't yet tested EGL_ANDROID_native_fence_sync with these patches, but
>     the series does build. I just wanted to get these patches on the list as a
>     status-update.  I'm slowly working on getting Rob Clark's hacked-up kmscube to
>     work on this series.
>
>     I did test that this series doesn't break any dEQP-EGL sync tests. But my
>     dEQP doesn't include any EGL_ANDROID_native_fence_sync tests.
>
> Branches:
>
>     mesa: This exact patch series lives at
>       http://cgit.kiwitree.net/~chadv/mesa/log/?h=review/fences-v02
>
>     mesa: My up-to-date, work-in-progress branch lives at
>       http://cgit.kiwitree.net/~chadv/mesa/log/?h=wip/fences
>
>     libdrm: If you want to build this, you also need my libdrm branch:
>       http://cgit.kiwitree.net/~chadv/libdrm/log/?h=wip/fences

btw, we might want a sync-fd ioctl wrapper somewhere..  I had stuck it
in libdrm (I might have needed it, or at least anticipated needing it
both in mesa and libdrm??)

https://github.com/freedreno/libdrm/commit/03479dee4fcaa85a81ed67e5112613f866b55467

Also, I should mention that Robert Foss was debugging some issue w/
this with drm/hwc2 on android.  Not entirely sure if the problem was
with the virgl backend code, or something more core/shared..  it is
only doing something slightly differently from kmscube
(eglCreateSync(EGL_NO_NATIVE_FENCE_FD_ANDROID) followed by glFlush()
instead of eglSwapBuffers() before eglDupNativeFence())  I was going
to debug that over the weekend but atm kernel is a bit broken on the
boards I have so didn't get very far yet..

BR,
-R

>     kernel: I have a kernel branch too where I collect other people's
>     patches. Be warned: if you run it, it will eat your machine's soul.
>       http://cgit.kiwitree.net/~chadv/linux/log/?h=wip/fences
>
> Chad Versace (9):
>   squash! egl: add EGL_ANDROID_native_fence_sync
>   squash! egl: add EGL_ANDROID_native_fence_sync
>   squash! egl: add EGL_ANDROID_native_fence_sync
>   i965: Add intel_screen::has_fence_fd
>   i965: Add intel_batchbuffer_flush_fence()
>   i965/sync: Add brw_fence::type
>   i965/sync: Fail sync creation with batchbuffer flush fails
>   i965/sync: Rename brw_fence_insert()
>   i965/sync: Implement fences based on Linux sync_file
>
> Rob Clark (3):
>   egl: initialize SyncCondition after attr parsing
>   dri: extend fence extension to support native fd fences
>   egl: add EGL_ANDROID_native_fence_sync
>
>  include/GL/internal/dri_interface.h           |  44 +++-
>  src/egl/drivers/dri2/egl_dri2.c               |  57 ++++-
>  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                        |  44 ++--
>  src/egl/main/eglsync.h                        |   1 +
>  src/mesa/drivers/dri/i965/brw_sync.c          | 297 ++++++++++++++++++++++----
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c |  25 ++-
>  src/mesa/drivers/dri/i965/intel_batchbuffer.h |  14 +-
>  src/mesa/drivers/dri/i965/intel_screen.c      |   3 +
>  src/mesa/drivers/dri/i965/intel_screen.h      |   2 +-
>  13 files changed, 456 insertions(+), 73 deletions(-)
>
> --
> 2.10.0
>


More information about the mesa-dev mailing list