From 433a8626db4be3d3514a2d65edfa0bf1df4b9778 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 20 May 2025 14:17:33 +0200 Subject: [PATCH] pan/afrc: Let's not pretend we support AFRC(YUV) Not only the is_yuv() check in pan_afrc_get_format_info() didn't work, because we use the multiplanar-RGB variants in panfrost, but we also need the plane index to pick the right format. Let's just assume AFRC(YUV) is not supported until someone decides to add the necessary bits. Fixes: 2dae926850ee ("panfrost: add utils for AFRC fixed-rate support") Signed-off-by: Boris Brezillon Tested-by: Eric R. Smith Reviewed-by: Eric R. Smith Reviewed-by: Mary Guillemard Part-of: (cherry picked from commit bba62e047e88612ae8de768e52858b561dd7f1dd) --- .pick_status.json | 2 +- src/panfrost/lib/pan_afrc.c | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index a36eace734d..efa32248272 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6514,7 +6514,7 @@ "description": "pan/afrc: Let's not pretend we support AFRC(YUV)", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "2dae926850ee7a0920e18d773afc55b0c68eb534", "notes": null diff --git a/src/panfrost/lib/pan_afrc.c b/src/panfrost/lib/pan_afrc.c index 8762e9d2e9c..e86609954fd 100644 --- a/src/panfrost/lib/pan_afrc.c +++ b/src/panfrost/lib/pan_afrc.c @@ -53,6 +53,10 @@ panfrost_afrc_get_format_info(enum pipe_format format) if (desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS) return info; + /* No AFRC(YUV) yet. */ + if (panfrost_format_is_yuv(format)) + return info; + unsigned bpc = 0; for (unsigned c = 0; c < desc->nr_channels; c++) { if (bpc && bpc != desc->channel[c].size) @@ -63,19 +67,9 @@ panfrost_afrc_get_format_info(enum pipe_format format) info.bpc = bpc; - if (desc->colorspace == UTIL_FORMAT_COLORSPACE_YUV) { - if (desc->layout != UTIL_FORMAT_LAYOUT_SUBSAMPLED) - info.ichange_fmt = PAN_AFRC_ICHANGE_FORMAT_YUV444; - else if (util_format_is_subsampled_422(format)) - info.ichange_fmt = PAN_AFRC_ICHANGE_FORMAT_YUV422; - else - info.ichange_fmt = PAN_AFRC_ICHANGE_FORMAT_YUV420; - } else { - assert(desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB || - desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB); - info.ichange_fmt = PAN_AFRC_ICHANGE_FORMAT_RAW; - } - + assert(desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB || + desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB); + info.ichange_fmt = PAN_AFRC_ICHANGE_FORMAT_RAW; info.num_planes = util_format_get_num_planes(format); info.num_comps = util_format_get_nr_components(format); return info;