From ad057adfd47781de4625870245dde353b39c25c1 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 18 Mar 2026 15:48:19 +0100 Subject: [PATCH] pan/lib: set srgb-flag for afrc render-targets Without this, sRGB rendering to AFRC is broken. Fixes: 7a763bb0a3b ("pan/genxml: Rework the RT/ZS emission logic") Reviewed-by: Boris Brezillon Reviewed-by: Lars-Ivar Hesselberg Simonsen (cherry picked from commit b0c32fcc6629258ec15ae4610c5b8f1258597f88) Part-of: --- .pick_status.json | 2 +- src/panfrost/lib/pan_desc.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 2a1c4b1f126..b5443479ac4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5874,7 +5874,7 @@ "description": "pan/lib: set srgb-flag for afrc render-targets", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "7a763bb0a3b1cb48dce03a62fff2fe9eac3f0eaf", "notes": null diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index 09daca78810..69e63a59b9e 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -800,6 +800,7 @@ GENX(pan_emit_afrc_color_attachment)(const struct pan_fb_info *fb, cfg.afrc_format = pan_afrc_format(finfo, image->props.modifier, 0); get_rt_formats(iview->format, &cfg.writeback_format, &cfg.internal_format, &cfg.swizzle); + cfg.srgb = util_format_is_srgb(iview->format); cfg.writeback_buffer.base = base; cfg.writeback_buffer.row_stride = row_stride; cfg.writeback_buffer.surface_stride = surf_stride;