radeonsi/vcn: Return error when decoding 12bit VP9 and 4:2:2/4:4:4 AV1

This is not supported by VCN.
We indicate this limitation by not reporting YUV420_12 RT format
supported for VP9, and not reporting YUV422 and YUV444 for AV1.
Most applications however simply ignore this, and will pick some other
format that is supported, which obviously won't work.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32663>
This commit is contained in:
David Rosca 2024-12-16 17:26:09 +01:00 committed by Marge Bot
parent 245d8c8e99
commit 5621ce10a6

View file

@ -2401,6 +2401,30 @@ static void radeon_dec_begin_frame(struct pipe_video_codec *decoder,
assert(decoder);
switch (dec->stream_type) {
case RDECODE_CODEC_VP9: {
struct pipe_vp9_picture_desc *pic = (struct pipe_vp9_picture_desc *)picture;
/* Only 10 bit is supported for Profile 2 */
if (pic->picture_parameter.bit_depth > 10) {
dec->error = true;
return;
}
break;
}
case RDECODE_CODEC_AV1: {
struct pipe_av1_picture_desc *pic = (struct pipe_av1_picture_desc *)picture;
/* Only 4:2:0 is supported for Profile 2 */
if (!pic->picture_parameter.seq_info_fields.subsampling_x ||
!pic->picture_parameter.seq_info_fields.subsampling_y) {
dec->error = true;
return;
}
break;
}
default:
break;
}
frame = ++dec->frame_number;
if (dec->stream_type != RDECODE_CODEC_VP9 && dec->stream_type != RDECODE_CODEC_AV1
&& dec->stream_type != RDECODE_CODEC_H264_PERF)