1 From 4d6c40ebfe10dd2fdc64bd7607e51275d5524e47 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Fri, 13 Sep 2019 17:23:26 +0100
4 Subject: [PATCH] staging: bcm2835-codec: Set default and error check
7 G_PARM default was invalid as 0/0, and the driver didn't check
8 the value set in S_PARM wasn't 0/0.
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 7 +++++++
13 1 file changed, 7 insertions(+)
15 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
16 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
17 @@ -1423,6 +1423,10 @@ static int vidioc_s_parm(struct file *fi
18 if (parm->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
21 + if (!parm->parm.output.timeperframe.denominator ||
22 + !parm->parm.output.timeperframe.numerator)
26 parm->parm.output.timeperframe.denominator;
27 ctx->framerate_denom =
28 @@ -2390,6 +2394,9 @@ static int bcm2835_codec_open(struct fil
29 ctx->colorspace = V4L2_COLORSPACE_REC709;
30 ctx->bitrate = 10 * 1000 * 1000;
32 + ctx->framerate_num = 30;
33 + ctx->framerate_denom = 1;
35 /* Initialise V4L2 contexts */
36 v4l2_fh_init(&ctx->fh, video_devdata(file));
37 file->private_data = &ctx->fh;