diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-08-29 11:08:07 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-03 11:34:33 +0100 |
commit | 078859a3230c123ed9cb798fb1cd7f89b4fde102 (patch) | |
tree | f22c40d2ecab1ec44986555b18642331ec369570 /drivers/media/pci/cx88/cx88-blackbird.c | |
parent | [media] cx88: drop mpeg_active field (diff) | |
download | linux-078859a3230c123ed9cb798fb1cd7f89b4fde102.tar.xz linux-078859a3230c123ed9cb798fb1cd7f89b4fde102.zip |
[media] cx88: don't allow changes while vb2_is_busy
Make sure that changing the standard or format is not allowed while
one or more of the video, vbi or mpeg vb2 queues are busy.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/cx88/cx88-blackbird.c')
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index 13b8ed322693..ff7978212e9d 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c @@ -855,6 +855,11 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; + if (vb2_is_busy(&dev->vb2_mpegq)) + return -EBUSY; + if (core->v4ldev && (vb2_is_busy(&core->v4ldev->vb2_vidq) || + vb2_is_busy(&core->v4ldev->vb2_vbiq))) + return -EBUSY; vidioc_try_fmt_vid_cap(file, priv, f); core->width = f->fmt.pix.width; core->height = f->fmt.pix.height; @@ -1002,8 +1007,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id) struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; - cx88_set_tvnorm(core, id); - return 0; + return cx88_set_tvnorm(core, id); } static const struct v4l2_file_operations mpeg_fops = |