[Mesa-dev] [RFC 00/13] egl, i965: Support EGL_ANDROID_native_fence_sync

Chad Versace chad.versace at intel.com
Sat Jul 9 00:00:50 UTC 2016

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 (or at least
    I think he is).

  - Chris Wilson, Daniel Vetter, and I roughly agree on the how the i915
    interface should work. Add two new optional parameters to execbuf: an
    in-fence fd and an out-fence fd. (See [2] above).

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!'.

This exact patch series lives at
  git://git.kiwitree.net/~chadv/mesa review/i965-EGL_ANDROID_native_fence_sync-v01

My up-to-date, work-in-progress, continually changing branch lives at
  git://git.kiwitree.net/~chadv/mesa wip/i965-EGL_ANDROID_native_fence_sync

If you want to build this, you also need my libdrm branch:
  git://cgit.kiwitree.net/~chadv/libdrm wip/intel-fence-fds

Nothing is tested (but at least it builds). Before testing anything,
I plan to wait until I have a working kernel branch for the i915

Chad Versace (10):
  egl: Use atomic ops on _EGLResource::RefCount
  todo! dri: Questions about fence fd ownership
  squash! egl: add EGL_ANDROID_native_fence_sync
  squash! egl: add EGL_ANDROID_native_fence_sync
  todo! egl/dri2: Questions about sync fd ownership
  i965/sync: Stop cacheing fence's signal status
  i965/sync: Fold brw_fence_has_completed() into caller
  rfc! i965: Add intel_screen::has_fence_fd
  rfc! i965: Add intel_batchbuffer_flush_fence()
  rfc! i965/sync: Support EGL_ANDROID_native_fence_sync

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           |  53 +++++-
 src/egl/drivers/dri2/egl_dri2.c               |  69 +++++++-
 src/egl/main/eglapi.c                         |  36 +++-
 src/egl/main/eglapi.h                         |   2 +
 src/egl/main/egldisplay.c                     |  13 +-
 src/egl/main/egldisplay.h                     |   1 +
 src/egl/main/eglfallbacks.c                   |   1 +
 src/egl/main/eglsync.c                        |  35 +++-
 src/egl/main/eglsync.h                        |   1 +
 src/mesa/drivers/dri/i965/intel_batchbuffer.c |  30 +++-
 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 +-
 src/mesa/drivers/dri/i965/intel_syncobj.c     | 239 ++++++++++++++++++++------
 14 files changed, 415 insertions(+), 84 deletions(-)


More information about the mesa-dev mailing list