[Mesa-dev] [PATCH 0/1] VK_ANDROID_native_buffer RFC

Chad Versace chadversary at chromium.org
Sat Sep 2 08:51:43 UTC 2017


On Thu 31 Aug 2017, Tapani Pälli wrote:
> Hi;

Hi Tapani, I just sent my implementation to mesa-dev too. I see a few
major differences in our approaches:

  - I'm using Autotools. You used Android.mk. I probably broke the
    Android.mk build... sorry. I haven't found the time yet to test that
    buildsystem.

  - Your patches assume the incoming gralloc buffer is X-tiled, which I assume
    is correct on android-ia. On ARC++, hwcomposer is just a proxy for
    the Chrome browser's compositor, where Y-tiling can be used for
    better performance. To correctly handle Y-tiled gralloc buffers,
    I had to add some extra plumbing. Most importantly, the creation of
    auxiliary surfaces must be disabled for images created with
    VkNativeBufferANDROID.

  - I imported the dma_buf by hacking vkAllocateMemory to accept
    VkNativeBufferAndroid instead of relying on
    vkCreateImageDmaBufINTEL. Both are hacky.

  - I made an uninformed guess at what gralloc usage flags to expose in
    vkGetSwapchainGrallocUsageANDROID. I need to compare my choices with
    yours.

> Now as I noticed familiar patches from Louis-Francis removing the
> precious vkCreateDmaBufImageINTEL() function, I've decided to send
> this for comments or just generic mockery. The CreateImage part
> could be changed to use VK_KHX_external_memory_fd, like I've done
> here for HAL:
> 
> https://github.com/tpalli/external-vulkan_hal/tree/new-image-import
> 
> but I've been blocked waiting for VK_MESAX_external_memory_dma_buf
> to materialize, could use 'get_tiling ioctl' though.

I used the GET_TILING ioctl, because I'm never certain whether ARC++'s
gralloc is going to allocate X-tiled or Y-tiled on SKL+. I think
Gurchetan tried switching gralloc to Y-tiled some time ago, but I don't
recall whether experiment was merged.

> Tapani Pälli (1):
>   android: VK_ANDROID_native_buffer implementation WIP
> 
>  Android.common.mk                       |  3 ++
>  include/vulkan/vulkan_intel.h           | 12 +++++
>  src/intel/Android.vulkan.mk             |  4 +-
>  src/intel/Makefile.sources              |  3 ++
>  src/intel/vulkan/anv_entrypoints_gen.py | 24 ++++++++++
>  src/intel/vulkan/anv_extensions.py      |  1 +
>  src/intel/vulkan/anv_image.c            | 69 +++++++++++++++++++++++++++
>  src/intel/vulkan/anv_wsi_android.c      | 82 +++++++++++++++++++++++++++++++++
>  src/vulkan/registry/vk.xml              |  2 +-
>  9 files changed, 198 insertions(+), 2 deletions(-)
>  create mode 100644 src/intel/vulkan/anv_wsi_android.c
> 
> -- 
> 2.13.5
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list