radv: improve externalMemoryFeatures for android ahb
authorChia-I Wu <olvaffe@gmail.com>
Fri, 21 Apr 2023 05:37:02 +0000 (22:37 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 May 2023 22:18:03 +0000 (22:18 +0000)
commit6aee7848bb00dd3742fbb1b8c65610188e77d939
treec4321561931f0be5512efd4b0879dfb091eea071
parenteaf1776586e80605860cb68a90a202b79ec8d699
radv: improve externalMemoryFeatures for android ahb

VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT should always be set, as
required by the spec.

VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT should be set when
radv_ahb_format_for_vk_format knowns the format.  That is,
radv_create_ahb_memory should at least know how to call
AHardwareBuffer_allocate.

VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT is always set.  We can't know
if gralloc can allocate the format/flags/usage combo or not (gralloc
might use a private format for the combo).

Fixed
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.*.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619>
src/amd/vulkan/radv_android.c
src/amd/vulkan/radv_formats.c