diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c index 309f4895c30..b5789e2a7b1 100644 --- a/src/panfrost/lib/pan_layout.c +++ b/src/panfrost/lib/pan_layout.c @@ -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)); diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 80028be275b..474bdc0b0da 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -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;