]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: mediatek: vcodec: Don't try to decode 422/444 VP9
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 28 Nov 2025 19:16:16 +0000 (14:16 -0500)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 5 Jan 2026 14:56:31 +0000 (15:56 +0100)
This is not supported by the hardware and trying to decode
these leads to LAT timeout errors.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c

index 6598a9e160b7a5a952c118e873a893e21e2f71e7..8e1cf16a168a7769c71459483e785948e259a828 100644 (file)
@@ -518,6 +518,12 @@ static int mtk_vdec_s_ctrl(struct v4l2_ctrl *ctrl)
                        mtk_v4l2_vdec_err(ctx, "VP9: bit_depth:%d", frame->bit_depth);
                        return -EINVAL;
                }
+
+               if (!(frame->flags & V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING) ||
+                   !(frame->flags & V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING)) {
+                       mtk_v4l2_vdec_err(ctx, "VP9: only 420 subsampling is supported");
+                       return -EINVAL;
+               }
                break;
        case V4L2_CID_STATELESS_AV1_SEQUENCE:
                seq = (struct v4l2_ctrl_av1_sequence *)hdr_ctrl->p_new.p;