diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-03-02 14:37:38 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-04-15 10:54:35 +0300 |
commit | b2943a0e9a7859c52d75f2f5cce532e04c4320a9 (patch) | |
tree | ff232f1159a9e1e8c0e0f6f154a6bcbbe442384d /drivers/media/common/saa7146 | |
parent | ff6dad2f95fb6a3474fdf3ee9edf6892908302dd (diff) | |
download | linux-b2943a0e9a7859c52d75f2f5cce532e04c4320a9.tar.xz |
media: common: saa7146: allow S_STD(G_STD)
If the requested TV standard is identical to the current
TV standard, then return 0, even when the vb2 queues are
busy.
This fixes a V4L2 compliance issue.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/common/saa7146')
-rw-r--r-- | drivers/media/common/saa7146/saa7146_video.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c index 65045f7aa28d..aa1e55c5df71 100644 --- a/drivers/media/common/saa7146/saa7146_video.c +++ b/drivers/media/common/saa7146/saa7146_video.c @@ -463,14 +463,19 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id) DEB_EE("VIDIOC_S_STD\n"); + for (i = 0; i < dev->ext_vv_data->num_stds; i++) + if (id & dev->ext_vv_data->stds[i].id) + break; + + if (i != dev->ext_vv_data->num_stds && + vv->standard == &dev->ext_vv_data->stds[i]) + return 0; + if (vb2_is_busy(&vv->video_dmaq.q) || vb2_is_busy(&vv->vbi_dmaq.q)) { DEB_D("cannot change video standard while streaming capture is active\n"); return -EBUSY; } - for (i = 0; i < dev->ext_vv_data->num_stds; i++) - if (id & dev->ext_vv_data->stds[i].id) - break; if (i != dev->ext_vv_data->num_stds) { vv->standard = &dev->ext_vv_data->stds[i]; if (NULL != dev->ext_vv_data->std_callback) |