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>
}
/*
+ * 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.
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);