vulkan/android: Fix suggestedYcbcrModel with !mapper4

Only mapper4 supports u_gralloc_get_buffer_color_info(), other gralloc
implementations do not.  So add a fallback, so that we aren't telling
the app that the suggestedYcbcrModel is RGB_IDENTITY.  We only go down
this path for YUV formats.

Fixes android.graphics.cts.BasicVulkanGpuTest#testBasicBufferImportAndRenderingExternalFormat

Fixes: 8732a619f1 ("vulkan/android: Add common vkGetAndroidHardwareBufferPropertiesANDROID")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29391>
This commit is contained in:
Rob Clark
2024-05-24 14:39:53 -07:00
committed by Marge Bot
parent 67a3c81286
commit 930e4fa283

View File

@@ -662,6 +662,8 @@ get_ahb_buffer_format_properties2(
VK_CHROMA_LOCATION_MIDPOINT : VK_CHROMA_LOCATION_COSITED_EVEN;
p->suggestedYChromaOffset = (color_info.vertical_siting == __DRI_YUV_CHROMA_SITING_0_5) ?
VK_CHROMA_LOCATION_MIDPOINT : VK_CHROMA_LOCATION_COSITED_EVEN;
} else {
p->suggestedYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601;
}
finish: