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>
This commit is contained in:
Boris Brezillon
2025-05-20 14:17:33 +02:00
committed by Marge Bot
parent fc92caf216
commit bba62e047e

View File

@@ -87,6 +87,10 @@ pan_afrc_get_format_info(enum pipe_format format)
if (desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS)
return info;
/* No AFRC(YUV) yet. */
if (pan_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)
@@ -97,19 +101,9 @@ pan_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;