Commit 1bd0835a authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vivid: allow s_dv_timings if it is the same as the current

Allow setting the same timings as the current timings (i.e., do nothing in that
case). The code was actually there, but the vb2_is_busy() call was done before
the timings check instead of afterwards.

Found by v4l2-compliance.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 02aa769d
...@@ -1585,13 +1585,13 @@ int vivid_vid_cap_s_dv_timings(struct file *file, void *_fh, ...@@ -1585,13 +1585,13 @@ int vivid_vid_cap_s_dv_timings(struct file *file, void *_fh,
if (!vivid_is_hdmi_cap(dev)) if (!vivid_is_hdmi_cap(dev))
return -ENODATA; return -ENODATA;
if (vb2_is_busy(&dev->vb_vid_cap_q))
return -EBUSY;
if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap, if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap,
0, NULL, NULL)) 0, NULL, NULL))
return -EINVAL; return -EINVAL;
if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0)) if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0))
return 0; return 0;
if (vb2_is_busy(&dev->vb_vid_cap_q))
return -EBUSY;
dev->dv_timings_cap = *timings; dev->dv_timings_cap = *timings;
vivid_update_format_cap(dev, false); vivid_update_format_cap(dev, false);
return 0; return 0;
......
...@@ -1127,13 +1127,13 @@ int vivid_vid_out_s_dv_timings(struct file *file, void *_fh, ...@@ -1127,13 +1127,13 @@ int vivid_vid_out_s_dv_timings(struct file *file, void *_fh,
if (!vivid_is_hdmi_out(dev)) if (!vivid_is_hdmi_out(dev))
return -ENODATA; return -ENODATA;
if (vb2_is_busy(&dev->vb_vid_out_q))
return -EBUSY;
if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap, if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap,
0, NULL, NULL)) 0, NULL, NULL))
return -EINVAL; return -EINVAL;
if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0)) if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0))
return 0; return 0;
if (vb2_is_busy(&dev->vb_vid_out_q))
return -EBUSY;
dev->dv_timings_out = *timings; dev->dv_timings_out = *timings;
vivid_update_format_out(dev); vivid_update_format_out(dev);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment