panfrost: Group CRC fields in a 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:50:08 +01:00
parent cbf68b21fb
commit 3c5fd5509f
5 changed files with 11 additions and 9 deletions

View file

@ -256,11 +256,11 @@ panfrost_mfbd_zs_crc_ext_set_bufs(struct panfrost_batch *batch,
unsigned level = c_surf->u.tex.level;
struct panfrost_slice *slice = &rsrc->slices[level];
ext->crc_row_stride = slice->checksum_stride;
ext->crc_row_stride = slice->crc.stride;
if (rsrc->checksum_bo)
ext->crc_base = rsrc->checksum_bo->ptr.gpu;
else
ext->crc_base = rsrc->bo->ptr.gpu + slice->checksum_offset;
ext->crc_base = rsrc->bo->ptr.gpu + slice->crc.offset;
if ((batch->clear & PIPE_CLEAR_COLOR0) && version >= 7) {
ext->crc_clear_color = batch->clear_color[0][0] |

View file

@ -420,7 +420,7 @@ panfrost_setup_slices(struct panfrost_device *dev,
/* Add a checksum region if necessary */
if (pres->checksummed) {
slice->checksum_offset = offset;
slice->crc.offset = offset;
unsigned size = panfrost_compute_checksum_size(
slice, width, height);

View file

@ -232,8 +232,8 @@ panfrost_sfbd_fragment(struct panfrost_batch *batch, bool has_draws)
unsigned level = surf->u.tex.level;
struct panfrost_slice *slice = &rsrc->slices[level];
params.crc_buffer.row_stride = slice->checksum_stride;
params.crc_buffer.base = bo->ptr.gpu + slice->checksum_offset;
params.crc_buffer.row_stride = slice->crc.stride;
params.crc_buffer.base = bo->ptr.gpu + slice->crc.offset;
}
}

View file

@ -509,9 +509,9 @@ panfrost_compute_checksum_size(
unsigned tile_count_x = aligned_width / CHECKSUM_TILE_WIDTH;
unsigned tile_count_y = aligned_height / CHECKSUM_TILE_HEIGHT;
slice->checksum_stride = tile_count_x * CHECKSUM_BYTES_PER_TILE;
slice->crc.stride = tile_count_x * CHECKSUM_BYTES_PER_TILE;
return slice->checksum_stride * tile_count_y;
return slice->crc.stride * tile_count_y;
}
unsigned

View file

@ -50,8 +50,10 @@ struct panfrost_slice {
/* If checksumming is enabled following the slice, what
* is its offset/stride? */
unsigned checksum_offset;
unsigned checksum_stride;
struct {
unsigned offset;
unsigned stride;
} crc;
/* Has anything been written to this slice? */
bool initialized;