panfrost: Luminance-alpha AFBC unsupported on v7+
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 14 Dec 2022 05:11:43 +0000 (00:11 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 16 Dec 2022 18:27:47 +0000 (18:27 +0000)
The L8_UNORM, A8_UNORM, and L8A8_UNORM v7 formats do not support AFBC,
regardless of swizzling. We're about to lift the restrictions on swizzling with
AFBC on v7, so we'll need to handle these cases explicitly to avoid using AFBC
in these cases.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>

src/panfrost/lib/pan_afbc.c

index 7a524e5..73cc813 100644 (file)
@@ -118,6 +118,20 @@ unswizzled_format(enum pipe_format format)
 enum pipe_format
 panfrost_afbc_format(unsigned arch, enum pipe_format format)
 {
+        /* Luminance-alpha not supported for AFBC on v7+ */
+        switch (format) {
+        case PIPE_FORMAT_A8_UNORM:
+        case PIPE_FORMAT_L8_UNORM:
+        case PIPE_FORMAT_I8_UNORM:
+        case PIPE_FORMAT_L8A8_UNORM:
+                if (arch >= 7)
+                        return PIPE_FORMAT_NONE;
+                else
+                        break;
+        default:
+                break;
+        }
+
         /* sRGB does not change the pixel format itself, only the
          * interpretation. The interpretation is handled by conversion hardware
          * independent to the compression hardware, so we can compress sRGB