Skip to content

Commit ed7bb87

Browse files
ndufresnemchehab
authored andcommitted
media: rkvdec: Enable capture buffer holding for H264
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 <[email protected]> Reviewed-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 6f32ea3 commit ed7bb87

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/staging/media/rkvdec/rkvdec.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
127127
.ops = &rkvdec_h264_fmt_ops,
128128
.num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts),
129129
.decoded_fmts = rkvdec_h264_vp9_decoded_fmts,
130+
.subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF,
130131
},
131132
{
132133
.fourcc = V4L2_PIX_FMT_VP9_FRAME,
@@ -385,6 +386,9 @@ static int rkvdec_s_output_fmt(struct file *file, void *priv,
385386
cap_fmt->fmt.pix_mp.ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
386387
cap_fmt->fmt.pix_mp.quantization = f->fmt.pix_mp.quantization;
387388

389+
/* Enable format specific queue features */
390+
vq->subsystem_flags |= desc->subsystem_flags;
391+
388392
return 0;
389393
}
390394

drivers/staging/media/rkvdec/rkvdec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct rkvdec_coded_fmt_desc {
8282
const struct rkvdec_coded_fmt_ops *ops;
8383
unsigned int num_decoded_fmts;
8484
const u32 *decoded_fmts;
85+
u32 subsystem_flags;
8586
};
8687

8788
struct rkvdec_dev {

0 commit comments

Comments
 (0)