diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index d924c3c6cdd..bc1ca6be1ac 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -830,7 +830,7 @@ panfrost_should_checksum(const struct panfrost_device *dev, return pres->base.bind & PIPE_BIND_RENDER_TARGET && panfrost_is_2d(pres) && bytes_per_pixel <= bytes_per_pixel_max && - pres->base.last_level == 0 && !(dev->debug & PAN_DBG_NO_CRC); + !(dev->debug & PAN_DBG_NO_CRC); } static bool diff --git a/src/panfrost/lib/pan_image.h b/src/panfrost/lib/pan_image.h index 1f9a0db2ec1..e2a1a2a3500 100644 --- a/src/panfrost/lib/pan_image.h +++ b/src/panfrost/lib/pan_image.h @@ -146,7 +146,8 @@ pan_image_view_has_crc(const struct pan_image_view *iview) if (!p.image) return false; - return p.image->props.crc; + /* Only mip level 0 gets a CRC buffer allocated. */ + return p.image->props.crc && iview->first_level == 0; } static inline struct pan_image_plane_ref diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c index 67a47e65e06..b0114493623 100644 --- a/src/panfrost/lib/pan_layout.c +++ b/src/panfrost/lib/pan_layout.c @@ -125,8 +125,8 @@ pan_image_layout_init( layout_constraints.offset_B += slayout->size_B; - /* Add a checksum region if necessary */ - if (props->crc) { + /* Add a CRC buffer at level 0 if necessary */ + if (l == 0 && props->crc) { init_slice_crc_info(arch, slayout, mip_extent_px.width, mip_extent_px.height, layout_constraints.offset_B); layout_constraints.offset_B += slayout->crc.size_B;