From fc07afb70bf8ca14ff4aa720199cf74c532328be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= Date: Fri, 25 Oct 2024 13:47:55 -0400 Subject: [PATCH] panfrost: disable CRC for AFBC-packed resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This shouldn't affect current behavior as CRC values are only used when using a resource as render target and it's impossible to render to a AFBC-P texture. However, it now properly updates the CRC-related properties for debugging and future usage. Signed-off-by: Louis-Francis Ratté-Boulianne Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 0673ef185f3..c6210b40a09 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -1659,6 +1659,11 @@ panfrost_pack_afbc(struct panfrost_context *ctx, dst_slice->row_stride = dst_stride * AFBC_HEADER_BYTES_PER_TILE; dst_slice->surface_stride = dst_slice->afbc.surface_stride; dst_slice->size = dst_slice->afbc.surface_stride; + + /* We can't write to AFBC-packed resource, so there is no reason to + * keep CRC data around */ + dst_slice->crc.offset = 0; + dst_slice->crc.size = 0; } total_size += dst_slice->afbc.surface_stride; } @@ -1694,6 +1699,8 @@ panfrost_pack_afbc(struct panfrost_context *ctx, panfrost_bo_unreference(prsrc->bo); prsrc->bo = dst; prsrc->image.data.base = dst->ptr.gpu; + prsrc->image.layout.crc = false; + prsrc->valid.crc = false; panfrost_bo_unreference(metadata_bo); }