From a4bd10c77395ddda8093ea38ec82c43f478c4e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Molinari?= Date: Wed, 11 Feb 2026 13:53:14 +0100 Subject: [PATCH] pan/crc: Enable CRC for multiple RTs on v6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v6 supports Transaction Elimination with multiple RTs at the condition the write buffer size of the enabled color attachments for a tile doesn't exceed 1600 bytes. Signed-off-by: Loïc Molinari --- src/panfrost/lib/pan_desc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index cd8eaf0bd85..0c5c0893ac5 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -1048,9 +1048,19 @@ pan_select_crc_rt(const struct pan_fb_info *fb) { int best_rt = -1; -#if PAN_ARCH <= 6 +#if PAN_ARCH <= 5 + /* CRC was introduced in v4 and MRT in v5 but unlike v6 there's no details + * how both work together. */ if (fb->rt_count > 1) return best_rt; + +#elif PAN_ARCH == 6 + /* On v6, all enabled RTs are used to compute a CRC (no crc_render_target + * field on the DBD). The write buffer size of the enabled color + * attachments for a tile must fit within 1600 bytes. */ + if (fb->rt_count > 1 && + pan_cbuf_bytes_per_pixel(fb) * fb->tile_size > 1600) + return best_rt; #endif for (unsigned i = 0; i < fb->rt_count; i++) {