From 2cef9cd9133ecfcb478f1129eb43e7eea4d35b86 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 25 Oct 2024 10:14:54 +0200 Subject: [PATCH] pan/desc: Fix the CRC validity update when clean tiles are not written MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRCs don't become valid if the GPU omits pushing clean tiles to memory. Signed-off-by: Boris Brezillon Reviewed-by: Louis-Francis Ratté-Boulianne Part-of: --- src/panfrost/lib/pan_desc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index a7bf1f23110..cb2ed69d235 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -812,15 +812,25 @@ GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx, bool full = !fb->extent.minx && !fb->extent.miny && fb->extent.maxx == (fb->width - 1) && fb->extent.maxy == (fb->height - 1); + bool clean_tile_write = fb->rts[crc_rt].clear; + +#if PAN_ARCH >= 6 + clean_tile_write |= pan_force_clean_write_rt(fb->rts[crc_rt].view, tile_size); +#endif + + /* If the CRC was valid it stays valid, if it wasn't, we must ensure + * the render operation covers the full frame, and clean tiles are + * pushed to memory. */ + bool new_valid = *valid | (full && clean_tile_write); cfg.crc_read_enable = *valid; /* If the data is currently invalid, still write CRC * data if we are doing a full write, so that it is * valid for next time. */ - cfg.crc_write_enable = *valid || full; + cfg.crc_write_enable = new_valid; - *valid |= full; + *valid = new_valid; } #if PAN_ARCH >= 9