You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/bcm27xx/patches-5.4/950-0328-staging-bcm2835-co...

38 lines
1.3 KiB
Diff

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