ail: Introduce layer_alignment flag

The hardware uses this flag to determine whether layer strides are
implicitly aligned to the page size or not.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
This commit is contained in:
Asahi Lina
2022-11-28 17:29:17 +09:00
committed by Marge Bot
parent 974358a8c1
commit d88b546e65
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -168,6 +168,9 @@ ail_initialize_twiddled(struct ail_layout *layout)
*/
if ((layout->levels != 1 && layout->depth_px != 1 && offset_B > AIL_PAGESIZE)
|| layout->tiling != AIL_TILING_TWIDDLED_COMPRESSED)
layout->page_aligned_layers = true;
if (layout->page_aligned_layers)
layout->layer_stride_B = ALIGN_POT(offset_B, AIL_PAGESIZE);
else
layout->layer_stride_B = offset_B;
+6
View File
@@ -99,6 +99,12 @@ struct ail_layout {
*/
uint32_t layer_stride_B;
/**
* Whether the layer stride is aligned to the page size or not. The hardware
* needs this flag to compute the implicit layer stride.
*/
bool page_aligned_layers;
/**
* Offsets of mip levels within a layer.
*/