panfrost: Group CRC fields in a struct
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 14 Dec 2020 18:50:08 +0000 (19:50 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Mon, 4 Jan 2021 16:05:42 +0000 (17:05 +0100)
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>

src/gallium/drivers/panfrost/pan_mfbd.c
src/gallium/drivers/panfrost/pan_resource.c
src/gallium/drivers/panfrost/pan_sfbd.c
src/panfrost/lib/pan_texture.c
src/panfrost/lib/pan_texture.h

index 7cc1aa8..7fe9b96 100644 (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] |
index bf8ec46..5e4a720 100644 (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);
index c82bc9b..3fcaf3c 100644 (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;
                         }
                 }
 
index 1cf6f77..05c9c48 100644 (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
index 5aebaae..d2343f3 100644 (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;