Mesa (master): panfrost: Don't advertise AFBC mods when the format is not supported

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 14 20:59:35 UTC 2021


Module: Mesa
Branch: master
Commit: 660b4d6e25011a2479538928419eed981a4cdf2f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=660b4d6e25011a2479538928419eed981a4cdf2f

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Wed Apr 14 11:08:03 2021 +0200

panfrost: Don't advertise AFBC mods when the format is not supported

On Bifrost, AFBC is not supported if the format has a non-identity
swizzle. For internal resources we fix the format at runtime, but this
fixup is not applicable when we export the resource. Don't advertise
AFBC modifiers on such formats.

Fixes: 44217be92134 ("panfrost: Adjust the format for AFBC textures on Bifrost v7")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Acked-by: Daniel Stone <daniels at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10233>

---

 src/gallium/drivers/panfrost/pan_screen.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 0ad365e602e..9ed17ddbfc7 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -560,6 +560,14 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen,
         /* Don't advertise AFBC before T760 */
         afbc &= !(dev->quirks & MIDGARD_NO_AFBC);
 
+        /* On Bifrost, AFBC is not supported if the format has a non-identity
+         * swizzle. For internal resources we fix the format at runtime, but
+         * this fixup is not applicable when we export the resource. Don't
+         * advertise AFBC modifiers on such formats.
+         */
+        if (panfrost_afbc_format_needs_fixup(dev, format))
+                afbc = false;
+
         unsigned count = 0;
 
         for (unsigned i = 0; i < PAN_MODIFIER_COUNT; ++i) {



More information about the mesa-commit mailing list