panfrost: Enable AFBC for RGB565
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 4 Jun 2020 21:35:40 +0000 (17:35 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 15 Jun 2020 21:53:09 +0000 (21:53 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5484>

src/panfrost/encoder/pan_afbc.c

index 27dacabddf32f46aa5b5f4d50815f2ef915b271b..272a713347836aa69501fd51cb67e14de1815348 100644 (file)
@@ -92,9 +92,16 @@ panfrost_format_supports_afbc(enum pipe_format format)
         if (util_format_is_rgba8_variant(desc))
                 return true;
 
-        /* Gross, but probably good enough */
-        if (format == PIPE_FORMAT_R8G8B8_UNORM)
+        /* List some special formats */
+        switch (format) {
+        case PIPE_FORMAT_R8G8B8_UNORM:
+        case PIPE_FORMAT_B8G8R8_UNORM:
+        case PIPE_FORMAT_R5G6B5_UNORM:
+        case PIPE_FORMAT_B5G6R5_UNORM:
                 return true;
+        default:
+                break;
+        }
 
         /* Only Z24S8 variants are compressible as Z/S */