From d47b016a841b3add08dd20add3c937e2c5801625 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 10 Sep 2025 09:45:18 +0200 Subject: [PATCH] panvk: Don't allow AFBC if the format format is mutable on v7- We can't create texture descriptors with a format that's different from the image format, because the texture format encodes the compression mode on Bifrost. So let's forbid AFBC when VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT is set. Signed-off-by: Boris Brezillon Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/vulkan/panvk_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panfrost/vulkan/panvk_image.c b/src/panfrost/vulkan/panvk_image.c index 1ddabf0eff2..2e9b152d6a7 100644 --- a/src/panfrost/vulkan/panvk_image.c +++ b/src/panfrost/vulkan/panvk_image.c @@ -66,8 +66,8 @@ panvk_image_can_use_afbc( * - tiling is set to linear * - this is a 1D image * - this is a 3D image on a pre-v7 GPU - * - this is a mutable format image on v7 (the BGR emulation we have with - * the texture swizzle gets in the way). + * - this is a mutable format image on v7- (format re-interpretation is + * not possible on Bifrost hardware). * * Some of these checks are redundant with tests provided by the AFBC mod * handler when pan_image_test_props() is called, but we need them because @@ -82,7 +82,7 @@ panvk_image_can_use_afbc( pan_afbc_supports_format(arch, pfmt) && tiling == VK_IMAGE_TILING_OPTIMAL && type != VK_IMAGE_TYPE_1D && (type != VK_IMAGE_TYPE_3D || arch >= 7) && - (!(flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) || arch != 7); + (!(flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) || arch >= 9); } static enum mali_texture_dimension