From 930e4fa2833a2a53f6017cf87973aac42cd90f75 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 24 May 2024 14:39:53 -0700 Subject: [PATCH] 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: 8732a619f13b ("vulkan/android: Add common vkGetAndroidHardwareBufferPropertiesANDROID") Signed-off-by: Rob Clark Reviewed-by: Roman Stratiienko Part-of: --- src/vulkan/runtime/vk_android.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vulkan/runtime/vk_android.c b/src/vulkan/runtime/vk_android.c index 71d13eb139c..3bc29fcde17 100644 --- a/src/vulkan/runtime/vk_android.c +++ b/src/vulkan/runtime/vk_android.c @@ -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: