From dc00bd9825db7d53d62370fd822e794e1cf79c72 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 5 Sep 2025 18:59:01 +0200 Subject: [PATCH] pan/desc: Upgrade writeback format to RAW32 on v9+ when AFBC(RAW24) AFBC(RAW24) is not supported on v9+. Use RAW32 instead, and let the AFBC compression mode select the actual size. No Fixes tag here, because AFBC(RAW24) is not a thing until we allow non-UNORM formats with AFBC. Signed-off-by: Boris Brezillon Reviewed-by: Eric R. Smith Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/lib/pan_desc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index f89ed8aed55..0c34251e27d 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -698,6 +698,13 @@ GENX(pan_emit_afbc_color_attachment)(const struct pan_fb_info *fb, cfg.write_enable = true; get_rt_formats(iview->format, &cfg.writeback_format, &cfg.internal_format, &cfg.swizzle); + + /* AFBC+RAW24 is not supported on v9+. Use RAW32 instead, and let the AFBC + * compression mode select the actual size. + */ + if (PAN_ARCH >= 9 && cfg.writeback_format == MALI_COLOR_FORMAT_RAW24) + cfg.writeback_format = MALI_COLOR_FORMAT_RAW32; + cfg.srgb = util_format_is_srgb(iview->format); cfg.writeback_block_format = get_afbc_block_format(image->props.modifier); cfg.yuv_transform = image->props.modifier & AFBC_FORMAT_MOD_YTR;