anv/android: handle image bindings from gralloc buffers
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 11 Aug 2021 09:57:37 +0000 (12:57 +0300)
committerMarge Bot <eric+marge@anholt.net>
Fri, 13 Aug 2021 08:30:25 +0000 (08:30 +0000)
commit19b7bbba7300c013dca67f931cad3e55dfc3722b
treedd953ba79828766f0c99e0e9bff1c450aa9311e4
parent8d679f4f4e8d33402f11ab3da93ff815e4c44538
anv/android: handle image bindings from gralloc buffers

When creating an image out of a swapchain on Android, the android
layer call will detect a VkBindImageMemorySwapchainInfoKHR in the
pNext chain of the vkBindImageMemory2() call and add a
VkNativeBufferANDROID in the chain. This is what we should use as
backing memory for that image.

v2: Fix a couple of obvious mistakes (Tapani)

v3: Silence build warning (Lionel)
    Fix invalid object argument to vk_error() (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bc3c71b87ae0b8 ("anv: don't try to access Android swapchains")
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5180
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12244>
src/intel/vulkan/anv_android.c
src/intel/vulkan/anv_android.h
src/intel/vulkan/anv_android_stubs.c
src/intel/vulkan/anv_image.c