[Mesa-dev] [PATCH 00/21] anv: Add support for VK_KHX_external*

Jason Ekstrand jason at jlekstrand.net
Fri Apr 14 17:37:47 UTC 2017


This patch series adds support for a bunch of the VK_KHX_external
extensions.  This is mostly a re-send but there are a few bugfixes tucked
in here and there are also some new patches.  Changes of note:

 1) It's been freshly rebased on master

 2) The BO cache has undergone quite a few bugfixes.

 3) We're now setting EXEC_OBJECT_ASYNC on almost everything.

 4) Patches have been added to implement external semaphores using DRM sync
    objects as created by Dave Airlie.

The only non-new patch that has undergone extensive changes (beyond just
fixing rebase issues) is the BO cache patch.

The last two patches in this series are marked RFC because they add support
for using the new DRM sync object API from Dave Airlie.  I think I'm
relatively happy with the kernel API but would like to give the kernel
people a chance to chip in before we commit to it.  Hopefully, we can get
the sync object API and its semantics nailed down soon.

The series has also undergone significantly better testing.  I have written
a new crucible test (that I will push later today after cleaning it up
a bit) which seems to do a pretty good job of testing this stuff.  It then
took me a while to get the crucible test to fail because the kernel
currently works on a first-come-first-served model so zero synchronization
is needed in order to get the proper Vulkan behavior.  Thanks to Chris'
kernel series to add support for context priorities and the patch labled
"HACK" in this series, I was able to force one of the two contexts in my
test to run at significantly lower priority and things actually started
executing out of sync.  Once I finally had a test that failed, I was able
to prove that the patches work. :-)

In order to test it properly, you will need my drm-syncobj3 kernel branch
which contains patches from Chris Wilson, Dave Airlie, and myself.  It can
be found here:

https://cgit.freedesktop.org/~jekstrand/linux/log/?h=drm-syncobj3

This series can be found here:

https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/anv-external

I now consider this stuff to be in good enough shape to merge.  I intend to
do so as soon as it is reviewed and the 17.1 branch point is past.

Cc: Chad Versace <chadversary at chromium.org>
Cc: Dave Airlie <airlied at redhat.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>

Chad Versace (1):
  anv: Implement VK_KHX_external_memory_capabilities

Jason Ekstrand (20):
  anv: Add the pci_id into the shader cache UUID
  anv/cmd_buffer: Use the device allocator for QueueSubmit
  anv: Set EXEC_OBJECT_ASYNC when available
  anv: Refactor device_get_cache_uuid into physical_device_init_uuids
  anv/physical_device: Rename uuid to pipeline_cache_uuid
  anv: Implement VK_KHX_external_memory
  anv/allocator: Add a BO cache
  anv: Use the BO cache for DeviceMemory allocations
  anv: Implement VK_KHX_external_memory_fd
  anv: Move queues, events, and semaphores to their own file
  anv: Add a real semaphore struct
  anv: Implement VK_KHX_external_semaphore_capabilities
  anv: Implement VK_KHX_external_semaphore
  anv: Pull the guts of cmd_buffer_execbuf into a helper
  anv: Implement VK_KHX_external_semaphore_fd
  anv/gem: Use EXECBUFFER2_WR when the FENCE_OUT flag is set
  anv: Implement support for exporting semaphores as FENCE_FD
  HACK/anv: Set context priorities based on queue priorities
  anv/gem: Add a drm syncobj support
  anv: Use DRM sync objects for external semaphores when available

 src/intel/Makefile.sources              |   1 +
 src/intel/vulkan/anv_allocator.c        | 271 +++++++++++
 src/intel/vulkan/anv_batch_chain.c      | 263 +++++++++--
 src/intel/vulkan/anv_device.c           | 713 ++++++++--------------------
 src/intel/vulkan/anv_entrypoints_gen.py |   6 +
 src/intel/vulkan/anv_formats.c          | 118 ++++-
 src/intel/vulkan/anv_gem.c              | 133 +++++-
 src/intel/vulkan/anv_gem_stubs.c        |  31 ++
 src/intel/vulkan/anv_image.c            |   2 +-
 src/intel/vulkan/anv_intel.c            |  15 +-
 src/intel/vulkan/anv_pipeline_cache.c   |   4 +-
 src/intel/vulkan/anv_private.h          |  98 +++-
 src/intel/vulkan/anv_queue.c            | 793 ++++++++++++++++++++++++++++++++
 src/intel/vulkan/anv_wsi.c              |   7 +-
 14 files changed, 1888 insertions(+), 567 deletions(-)
 create mode 100644 src/intel/vulkan/anv_queue.c

-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list