From 45f79c7ee55ffa741003afd6b0a7f78d80b06a83 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 20 Aug 2025 18:37:22 -0700 Subject: [PATCH] vulkan/android: amend a missing case for IMPLEMENTATION_DEFINED AHB An AHB with IMPLEMENTATION_DEFINED format is commonly backed by NV12 or XBGR8888. The former is the usual pick for camera <-> GPU interop, while the latter is mostly only seen in Android CTS. Ideally, we can rely on the queried fourcc to resolve everything instead of being on the fallback path, but keeping this a minimal fix is easy for porting. Cc: mesa-stable Reviewed-by: Lucas Fryzek Part-of: (cherry picked from commit 25a8e124e0991fea11dcf287aad11a02e6c2ef65) --- .pick_status.json | 2 +- src/vulkan/runtime/vk_android.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index de2dbec0f6f..aba6f725eea 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5594,7 +5594,7 @@ "description": "vulkan/android: amend a missing case for IMPLEMENTATION_DEFINED AHB", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/vulkan/runtime/vk_android.c b/src/vulkan/runtime/vk_android.c index 04b594ce629..9b2bfce2645 100644 --- a/src/vulkan/runtime/vk_android.c +++ b/src/vulkan/runtime/vk_android.c @@ -795,6 +795,10 @@ get_ahb_buffer_format_properties2( case DRM_FORMAT_NV12: external_format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; break; + case DRM_FORMAT_XBGR8888: + /* This can be resolved from IMPLEMENTATION_DEFINED AHB format */ + external_format = VK_FORMAT_R8G8B8A8_UNORM; + break; default: mesa_loge("Unsupported external DRM format: %d", info.drm_fourcc); return VK_ERROR_INVALID_EXTERNAL_HANDLE;