From 8f4c938c1e9a513bcfd67d6b6e896327db1e12f3 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 27 Jun 2025 00:30:52 -0700 Subject: [PATCH] anv: fix ANB gralloc usage query to not append display usage bits The consumer of the Android surface may or may not be display. e.g. it can also be a media encoder. When BufferQueue makes the allocation, it takes the gralloc usage bits from both the client API (EGL/Vulkan) and the consumer side. Cc: mesa-stable Acked-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_android.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c index a2f837b28a6..ff5853fb4fe 100644 --- a/src/intel/vulkan/anv_android.c +++ b/src/intel/vulkan/anv_android.c @@ -514,26 +514,6 @@ setup_gralloc0_usage(struct anv_device *device, VkFormat format, "swapchain", imageUsage); } - /* The below formats support GRALLOC_USAGE_HW_FB (that is, display - * scanout). This short list of formats is univserally supported on Intel - * but is incomplete. The full set of supported formats is dependent on - * kernel and hardware. - * - * FINISHME: Advertise all display-supported formats. - */ - switch (format) { - case VK_FORMAT_B8G8R8A8_UNORM: - case VK_FORMAT_R5G6B5_UNORM_PACK16: - case VK_FORMAT_R8G8B8A8_UNORM: - case VK_FORMAT_R8G8B8A8_SRGB: - *grallocUsage |= GRALLOC_USAGE_HW_FB | - GRALLOC_USAGE_HW_COMPOSER | - GRALLOC_USAGE_EXTERNAL_DISP; - break; - default: - mesa_logw("%s: unsupported format=%d", __func__, format); - } - if (*grallocUsage == 0) return VK_ERROR_FORMAT_NOT_SUPPORTED;