[Mesa-dev] [PATCH 00/14] anv: Implement VK_ANDROID_native_buffer (v3)

Chad Versace chad at kiwitree.net
Thu Sep 28 00:11:46 UTC 2017


This series adds Android support to Anvil. And Android requires
VK_ANDROID_native_buffer.


I tested the series on 64-bit ARC++ on a Skylake Chromebook with a 3.18
kernel. (ARC++ is the Android container in Chrome OS). (Yes, I said 3.18.
That's not a typo).


Here's my test results:

  - A little, spinning cube demo APK works, proving that the window
    system integration is, if not fully correct, at least good enough.

  - On Linux (non-Android), this patch series causes no regressions in
    VK-GL-CTS (master at dfcb8e87) under Wayland.

  - On Android, in patchset v1, dEQP from
    android-cts-7.1_r8-linux_x86-x86 had 1 failure. I'm still waiting
    for the results for patchset v2.

     Passed:         66889/81423 (82.2%)
     Failed:             1/81423 (0.0%)
     Not supported:  14529/81423 (17.8%)
     Warnings:           4/81423 (0.0%)

     The sole failure was
     dEQP-VK.pipeline.image_view.view_type.cube_array.format.r16g16_sint.component_swizzle.one_r_g_zero

This patch series lives at:
    git://git.kiwitree.net/~chadv/mesa refs/tags/chadv/review/anv-android-v03
    cgit http://git.kiwitree.net/cgit/~chadv/mesa/tag/?h=chadv/review/arc-android-v03

I tested tag anv-android-v03 on Wayland. To test on ARC++, I had to add
additional fixes. The branch I tested on ARC++ lives at:
    git://git.kiwitree.net/~chadv/mesa refs/tags/chadv/review/arc-vulkan-v03
    cgit http://git.kiwitree.net/cgit/~chadv/mesa/tag/?h=chadv/review/arc-vulkan-v03


Note that Mesa's ARC++ build uses Autotools, not Android.mk. This series
probably broke the Android.mk files. Someone, please review and test
that.


Each patch but the last is just prep. You should read the last patch
first to better understand the goal, then afterwards review the series
linearly from the beginning.


v2:
  - A few patches have already landed on master.
  - Drop the ugly flag params from anv_bo_cache_import(), for jekstrand.
  - Reject VkNativeBufferANDROID if the dma-buf's size is too small for
    the VkImage.
  - Stop abusing VkNativeBufferANDROID by passing it to vkAllocateMemory
    during vkCreateImage. Instead, directly import its dma-buf during
    vkCreateImage with anv_bo_cache_import(). [for jekstrand]
  - Rebase onto Tapani's VK_EXT_debug_report changes.


v3:
  - Omit v2 patches already upstreamed.
  - Many fixes to "anv: Implement VK_ANDROID_native_buffer".
  - Don't break the Android.mk buildsystem used by Android-IA.
  - Rebase onto the anv_image.c:needs_shadow changes in master.


Chad Versace (12):
  anv/android: Link to Android libraries in the autotools build
  intel: Move definition of LOG_TAG from header into Makefiles
  intel: Add simple logging façade for Android
  anv: Better support for Android logging (v2)
  anv/image: Better var names for image-create-info structs
  anv/image: Refactor how tiling is chosen (v2)
  anv/image: Refactor creation of aux surfaces (v2)
  anv: Add field anv_image::bo_is_owned
  anv: Move close(fd) from anv_bo_cache_import to its callers
  anv: Add sizeless anv_bo_cache_import()
  anv: Add func anv_gem_get_tiling()
  anv: Implement VK_ANDROID_native_buffer (v6)

Tapani Pälli (2):
  anv/android: Link to libsync, liblog in Android.mk
  anv: Install as Vulkan HAL module in Android.mk build

 src/intel/Android.blorp.mk              |   2 +
 src/intel/Android.common.mk             |   2 +
 src/intel/Android.vulkan.mk             |  34 ++-
 src/intel/Makefile.am                   |   3 +-
 src/intel/Makefile.sources              |   7 +-
 src/intel/Makefile.vulkan.am            |   7 +
 src/intel/common/gen_debug.h            |   1 -
 src/intel/common/intel_log.c            |  87 ++++++
 src/intel/common/intel_log.h            |  82 ++++++
 src/intel/vulkan/anv_allocator.c        | 126 +++++----
 src/intel/vulkan/anv_android.c          | 244 ++++++++++++++++
 src/intel/vulkan/anv_device.c           |  41 ++-
 src/intel/vulkan/anv_entrypoints_gen.py |  10 +-
 src/intel/vulkan/anv_extensions.py      |   1 +
 src/intel/vulkan/anv_gem.c              |  16 ++
 src/intel/vulkan/anv_image.c            | 475 ++++++++++++++++++++++----------
 src/intel/vulkan/anv_intel.c            |   6 +-
 src/intel/vulkan/anv_private.h          |  18 +-
 src/intel/vulkan/anv_queue.c            |   5 +-
 src/intel/vulkan/anv_util.c             |  21 +-
 src/intel/vulkan/genX_cmd_buffer.c      |   4 +-
 src/mesa/drivers/dri/i965/Android.mk    |  23 +-
 src/mesa/drivers/dri/i965/Makefile.am   |   1 +
 23 files changed, 960 insertions(+), 256 deletions(-)
 create mode 100644 src/intel/common/intel_log.c
 create mode 100644 src/intel/common/intel_log.h
 create mode 100644 src/intel/vulkan/anv_android.c

-- 
2.13.5



More information about the mesa-dev mailing list