From 215521c03ba767c72839fc58a83f7d08eb6b4d14 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 a5b13333962..9da88c7d301 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1974,7 +1974,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 cc18f1c5aae..4b65c87ac9f 100644 --- a/src/vulkan/runtime/vk_android.c +++ b/src/vulkan/runtime/vk_android.c @@ -645,6 +645,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;