panfrost: Disable AFBC on sRGB buffers
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Jun 2019 14:41:26 +0000 (07:41 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Jun 2019 16:59:29 +0000 (09:59 -0700)
The performance impact is slightly mitigated by tiling the render
target, but it's undeniably still slow compared to AFBC. Unfortunately,
it doesn't look like AFBC and sRGB play nice...

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_afbc.c

index 0bb9d2491c66fadde6033ee32a803c0ce9fe5304..4bef833f18201e4a89d277dd854881a5cbcfc603 100644 (file)
@@ -83,6 +83,13 @@ panfrost_format_supports_afbc(enum pipe_format format)
         const struct util_format_description *desc =
                 util_format_description(format);
 
+        /* sRGB cannot be AFBC, but it can be tiled. TODO: Verify. The blob
+         * does not do AFBC for SRGB8_ALPHA8, but it's not clear why it
+         * shouldn't be able to. */
+
+        if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB)
+                return false;
+
         if (util_format_is_rgba8_variant(desc))
                 return true;