venus: properly resolve AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED
Both AHardwareBuffer_Format
and the gralloc buffer info's drm_fourcc
are guest side requested format. However, AHardwareBuffer_Format
is lossier than DRM_FORMAT_*
when it comes to AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED
, which ends up with Venus impossible to resolve implementation defined format upon vkCreateSamplerYcbcrConversion
with VkExternalFormatANDROID
on the guest side. So this MR switches to use DRM format as AHB external format to fix the hack on guessing AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED
.
This MR also factors a header and removes those unsupported formats.
Test: no regressions in dEQP-VK.api.external.memory.android_hardware_buffer.*
Test: no regressions in Android graphics cts MediaVulkanGpuTest
and CameraVulkanGpuTest
Test: camera Vulkan interop demo app still works
/cc @olv