panfrost: Add method to get size of AFBC subblocks
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
Thu, 31 Aug 2023 15:31:42 +0000 (11:31 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 25 Oct 2023 14:25:30 +0000 (14:25 +0000)
Each AFBC superblock is subdivised into subblocks that are
compressed individually. For all formats that we currently support,
the subblocks are 4x4 pixels.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>

src/panfrost/lib/pan_layout.c
src/panfrost/lib/pan_texture.h

index 04751c9..309f489 100644 (file)
@@ -105,6 +105,17 @@ panfrost_afbc_is_wide(uint64_t modifier)
 }
 
 /*
+ * Given an AFBC modifier, return the subblock size (subdivision of a
+ * superblock). This is always 4x4 for now as we only support one AFBC
+ * superblock layout.
+ */
+struct pan_block_size
+panfrost_afbc_subblock_size(uint64_t modifier)
+{
+   return (struct pan_block_size){4, 4};
+}
+
+/*
  * Given a format, determine the tile size used for u-interleaving. For formats
  * that are already block compressed, this is 4x4. For all other formats, this
  * is 16x16, hence the modifier name.
index 0018183..80028be 100644 (file)
@@ -249,6 +249,8 @@ unsigned panfrost_afbc_superblock_height(uint64_t modifier);
 
 bool panfrost_afbc_is_wide(uint64_t modifier);
 
+struct pan_block_size panfrost_afbc_subblock_size(uint64_t modifier);
+
 uint32_t pan_afbc_row_stride(uint64_t modifier, uint32_t width);
 
 uint32_t pan_afbc_stride_blocks(uint64_t modifier, uint32_t row_stride_bytes);