mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-11 06:28:09 +02:00
panfrost: Precalculate stride and nr of blocks for AFBC layouts
For AFBC packing, we will need to have the stride of the resource in terms of superblocks and the total number of blocks. It is easier to pre-calculate once when initializing the resource layout. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
This commit is contained in:
parent
9f3a79a6a3
commit
113d88f94d
2 changed files with 9 additions and 0 deletions
|
|
@ -410,6 +410,9 @@ pan_image_layout_init(const struct panfrost_device *dev,
|
|||
if (afbc) {
|
||||
slice->row_stride =
|
||||
pan_afbc_row_stride(layout->modifier, effective_width);
|
||||
slice->afbc.stride = effective_width / block_size.width;
|
||||
slice->afbc.nr_blocks =
|
||||
slice->afbc.stride * (effective_height / block_size.height);
|
||||
slice->afbc.header_size =
|
||||
ALIGN_POT(slice->row_stride * (effective_height / align_h),
|
||||
pan_afbc_body_align(layout->modifier));
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@ struct pan_image_slice_layout {
|
|||
unsigned surface_stride;
|
||||
|
||||
struct {
|
||||
/* Stride in number of superblocks */
|
||||
unsigned stride;
|
||||
|
||||
/* Number of superblocks */
|
||||
unsigned nr_blocks;
|
||||
|
||||
/* Size of the AFBC header preceding each slice */
|
||||
unsigned header_size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue