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 <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
(cherry picked from commit 25a8e124e0)
This commit is contained in:
Yiwei Zhang 2025-08-20 18:37:22 -07:00 committed by Eric Engestrom
parent 29c6a25747
commit 215521c03b
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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;