Mesa (main): panfrost: Add pan_afbc_tile_size helper

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


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed May  4 09:59:35 2022 -0400

panfrost: Add pan_afbc_tile_size helper

To unify calculations with linear and tiled AFBC formats.

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

---

 src/panfrost/lib/pan_layout.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c
index b78a90493a0..b16a00d420f 100644
--- a/src/panfrost/lib/pan_layout.c
+++ b/src/panfrost/lib/pan_layout.c
@@ -130,6 +130,16 @@ panfrost_block_size(uint64_t modifier, enum pipe_format format)
                 return (struct pan_block_size) { 1, 1 };
 }
 
+/*
+ * Determine the tile size used by AFBC. This tiles superblocks themselves.
+ * Current GPUs support either 8x8 tiling or no tiling (1x1)
+ */
+static inline unsigned
+pan_afbc_tile_size(uint64_t modifier)
+{
+        return (modifier & AFBC_FORMAT_MOD_TILED) ? 8 : 1;
+}
+
 /*
  * Determine the number of bytes between header rows for an AFBC image. For an
  * image with linear headers, this is simply the number of header blocks



More information about the mesa-commit mailing list