]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: rkvdec: Enable capture buffer holding for H264
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 13 May 2022 20:29:18 +0000 (22:29 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 17 May 2022 08:08:52 +0000 (10:08 +0200)
In order to support interlaced video decoding, the driver must
allow holding the capture buffer so that the second field can
be decoded into it.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/rkvdec/rkvdec.c
drivers/staging/media/rkvdec/rkvdec.h

index 2bc4b1a409895d8f410e7f6ec91bf002985beda5..7bab7586918c11bbbb8a3315c187c97db5c42c53 100644 (file)
@@ -127,6 +127,7 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
                .ops = &rkvdec_h264_fmt_ops,
                .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts),
                .decoded_fmts = rkvdec_h264_vp9_decoded_fmts,
+               .subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF,
        },
        {
                .fourcc = V4L2_PIX_FMT_VP9_FRAME,
@@ -385,6 +386,9 @@ static int rkvdec_s_output_fmt(struct file *file, void *priv,
        cap_fmt->fmt.pix_mp.ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
        cap_fmt->fmt.pix_mp.quantization = f->fmt.pix_mp.quantization;
 
+       /* Enable format specific queue features */
+       vq->subsystem_flags |= desc->subsystem_flags;
+
        return 0;
 }
 
index 9df0fba799a484833d3c3c1ea7deda92a96e4941..633335ebb9c498bb69ae4072b772f30858a89e48 100644 (file)
@@ -82,6 +82,7 @@ struct rkvdec_coded_fmt_desc {
        const struct rkvdec_coded_fmt_ops *ops;
        unsigned int num_decoded_fmts;
        const u32 *decoded_fmts;
+       u32 subsystem_flags;
 };
 
 struct rkvdec_dev {