To unify calculations with linear and tiled AFBC formats.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16697>
}
/*
+ * 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
* (=superblocks) per row times the numbers of bytes per header block.