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: 2dae926850 ("panfrost: add utils for AFRC fixed-rate support")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35015>
(cherry picked from commit bba62e047e)
This commit is contained in:
Boris Brezillon 2025-05-20 14:17:33 +02:00 committed by Eric Engestrom
parent 8f2192f460
commit 433a8626db
2 changed files with 8 additions and 14 deletions

View file

@ -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

View file

@ -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;