mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
panfrost: Move checksum_bo to panfrost_resource
There's no reason to have the checksum_bo at the slice level since there can only be one external CRC BO per resource. Move this field to the panfrost_resource struct. Suggested-by: Icecream95 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:
parent
9ab45f4a63
commit
cbf68b21fb
5 changed files with 12 additions and 10 deletions
|
|
@ -558,8 +558,8 @@ panfrost_batch_add_resource_bos(struct panfrost_batch *batch,
|
|||
panfrost_batch_add_bo(batch, rsrc->bo, flags);
|
||||
|
||||
for (unsigned i = 0; i < MAX_MIP_LEVELS; i++)
|
||||
if (rsrc->slices[i].checksum_bo)
|
||||
panfrost_batch_add_bo(batch, rsrc->slices[i].checksum_bo, flags);
|
||||
if (rsrc->checksum_bo)
|
||||
panfrost_batch_add_bo(batch, rsrc->checksum_bo, flags);
|
||||
|
||||
if (rsrc->separate_stencil)
|
||||
panfrost_batch_add_bo(batch, rsrc->separate_stencil->bo, flags);
|
||||
|
|
|
|||
|
|
@ -257,8 +257,8 @@ panfrost_mfbd_zs_crc_ext_set_bufs(struct panfrost_batch *batch,
|
|||
struct panfrost_slice *slice = &rsrc->slices[level];
|
||||
|
||||
ext->crc_row_stride = slice->checksum_stride;
|
||||
if (slice->checksum_bo)
|
||||
ext->crc_base = slice->checksum_bo->ptr.gpu;
|
||||
if (rsrc->checksum_bo)
|
||||
ext->crc_base = rsrc->checksum_bo->ptr.gpu;
|
||||
else
|
||||
ext->crc_base = rsrc->bo->ptr.gpu + slice->checksum_offset;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen,
|
|||
templat->bind & PIPE_BIND_RENDER_TARGET) {
|
||||
unsigned size = panfrost_compute_checksum_size(
|
||||
&rsc->slices[0], templat->width0, templat->height0);
|
||||
rsc->slices[0].checksum_bo = panfrost_bo_create(dev, size, 0);
|
||||
rsc->checksum_bo = panfrost_bo_create(dev, size, 0);
|
||||
rsc->checksummed = true;
|
||||
}
|
||||
|
||||
|
|
@ -709,8 +709,8 @@ panfrost_resource_destroy(struct pipe_screen *screen,
|
|||
if (rsrc->bo)
|
||||
panfrost_bo_unreference(rsrc->bo);
|
||||
|
||||
if (rsrc->slices[0].checksum_bo)
|
||||
panfrost_bo_unreference(rsrc->slices[0].checksum_bo);
|
||||
if (rsrc->checksum_bo)
|
||||
panfrost_bo_unreference(rsrc->checksum_bo);
|
||||
|
||||
util_range_destroy(&rsrc->valid_buffer_range);
|
||||
ralloc_free(rsrc);
|
||||
|
|
@ -1036,8 +1036,8 @@ panfrost_ptr_unmap(struct pipe_context *pctx,
|
|||
if (panfrost_should_linear_convert(prsrc, transfer)) {
|
||||
|
||||
panfrost_bo_unreference(prsrc->bo);
|
||||
if (prsrc->slices[0].checksum_bo)
|
||||
panfrost_bo_unreference(prsrc->slices[0].checksum_bo);
|
||||
if (prsrc->checksum_bo)
|
||||
panfrost_bo_unreference(prsrc->checksum_bo);
|
||||
|
||||
panfrost_resource_setup(dev, prsrc, NULL, DRM_FORMAT_MOD_LINEAR);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ struct panfrost_resource {
|
|||
/* Is transaciton elimination enabled? */
|
||||
bool checksummed;
|
||||
|
||||
/* The CRC BO can be allocated separately */
|
||||
struct panfrost_bo *checksum_bo;
|
||||
|
||||
/* Used to decide when to convert to another modifier */
|
||||
uint16_t modifier_updates;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ struct panfrost_slice {
|
|||
* is its offset/stride? */
|
||||
unsigned checksum_offset;
|
||||
unsigned checksum_stride;
|
||||
struct panfrost_bo *checksum_bo;
|
||||
|
||||
/* Has anything been written to this slice? */
|
||||
bool initialized;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue