Mesa (main): panfrost: Add helper checking tiled AFBC support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 26 16:12:43 UTC 2022


Module: Mesa
Branch: main
Commit: 3fbfd356af209391eb72b836d189fe9ab1f215dc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3fbfd356af209391eb72b836d189fe9ab1f215dc

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue May 24 16:21:12 2022 -0400

panfrost: Add helper checking tiled AFBC support

Tiled AFBC support was introduced with v7. Add a helper encoding this fact.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16697>

---

 src/panfrost/lib/pan_afbc.c    | 10 ++++++++++
 src/panfrost/lib/pan_texture.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/src/panfrost/lib/pan_afbc.c b/src/panfrost/lib/pan_afbc.c
index bd8b3e710e6..96f2c831f10 100644
--- a/src/panfrost/lib/pan_afbc.c
+++ b/src/panfrost/lib/pan_afbc.c
@@ -146,3 +146,13 @@ panfrost_afbc_can_ytr(enum pipe_format format)
         /* The fourth channel if it exists doesn't matter */
         return desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB;
 }
+
+/*
+ * Check if the device supports AFBC with tiled headers (and hence also solid
+ * colour blocks).
+ */
+bool
+panfrost_afbc_can_tile(const struct panfrost_device *dev)
+{
+        return (dev->arch >= 7);
+}
diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h
index 9c9a3f21ee9..c43bd250579 100644
--- a/src/panfrost/lib/pan_texture.h
+++ b/src/panfrost/lib/pan_texture.h
@@ -171,6 +171,9 @@ panfrost_afbc_format(const struct panfrost_device *dev, enum pipe_format format)
 bool
 panfrost_afbc_can_ytr(enum pipe_format format);
 
+bool
+panfrost_afbc_can_tile(const struct panfrost_device *dev);
+
 /*
  * Represents the block size of a single plane. For AFBC, this represents the
  * superblock size. For u-interleaving, this represents the tile size.



More information about the mesa-commit mailing list