panfrost: Move AFBC header_size to a sub-struct

So we can add more AFBC related fields under this struct.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>
This commit is contained in:
Boris Brezillon 2020-12-14 19:52:48 +01:00
parent 4dd7991422
commit a9a3b0e21f
3 changed files with 9 additions and 8 deletions

View file

@ -175,7 +175,7 @@ panfrost_mfbd_rt_set_buf(struct pipe_surface *surf,
else
rt->midgard.writeback_block_format = MALI_BLOCK_FORMAT_AFBC;
unsigned header_size = rsrc->layout.slices[level].header_size;
unsigned header_size = rsrc->layout.slices[level].afbc.header_size;
rt->afbc.header = base;
rt->afbc.chunk_size = 9;
@ -292,7 +292,7 @@ panfrost_mfbd_zs_crc_ext_set_bufs(struct panfrost_batch *batch,
ext->zs_msaa_v7 = nr_samples > 1 ? MALI_MSAA_LAYERED : MALI_MSAA_SINGLE;
if (drm_is_afbc(rsrc->layout.modifier)) {
unsigned header_size = rsrc->layout.slices[level].header_size;
unsigned header_size = rsrc->layout.slices[level].afbc.header_size;
ext->zs_afbc_header = base;
ext->zs_afbc_body = base + header_size;
ext->zs_afbc_body_size = 0x1000;

View file

@ -128,7 +128,7 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen,
}
if (drm_is_afbc(whandle->modifier)) {
rsc->layout.slices[0].header_size =
rsc->layout.slices[0].afbc.header_size =
panfrost_afbc_header_size(templat->width0, templat->height0);
}
@ -403,10 +403,10 @@ panfrost_setup_layout(struct panfrost_device *dev,
/* Compute AFBC sizes if necessary */
if (afbc) {
slice->header_size =
slice->afbc.header_size =
panfrost_afbc_header_size(width, height);
offset += slice->header_size;
offset += slice->afbc.header_size;
}
offset += slice_full_size;

View file

@ -44,9 +44,10 @@ struct panfrost_slice {
unsigned row_stride;
unsigned surface_stride;
/* If there is a header preceding each slice, how big is
* that header? Used for AFBC */
unsigned header_size;
struct {
/* Size of the AFBC header preceding each slice */
unsigned header_size;
} afbc;
/* If checksumming is enabled following the slice, what
* is its offset/stride? */