aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivid
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2015-03-14 08:35:23 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-02 20:09:35 -0400
commit1bd0835a27a8651c0a2a06415a64fdab161cbeba (patch)
tree253cf108c3dc80fb21970768a97192157e4a953a /drivers/media/platform/vivid
parent02aa769d9fa12d51213e7b1db34bb9b200a967a3 (diff)
[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: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vivid')
-rw-r--r--drivers/media/platform/vivid/vivid-vid-cap.c4
-rw-r--r--drivers/media/platform/vivid/vivid-vid-out.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c
index 1d9ea2d9d61a..c942bf7ac95a 100644
--- a/drivers/media/platform/vivid/vivid-vid-cap.c
+++ b/drivers/media/platform/vivid/vivid-vid-cap.c
@@ -1585,13 +1585,13 @@ int vivid_vid_cap_s_dv_timings(struct file *file, void *_fh,
1585 1585
1586 if (!vivid_is_hdmi_cap(dev)) 1586 if (!vivid_is_hdmi_cap(dev))
1587 return -ENODATA; 1587 return -ENODATA;
1588 if (vb2_is_busy(&dev->vb_vid_cap_q))
1589 return -EBUSY;
1590 if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap, 1588 if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap,
1591 0, NULL, NULL)) 1589 0, NULL, NULL))
1592 return -EINVAL; 1590 return -EINVAL;
1593 if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0)) 1591 if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0))
1594 return 0; 1592 return 0;
1593 if (vb2_is_busy(&dev->vb_vid_cap_q))
1594 return -EBUSY;
1595 dev->dv_timings_cap = *timings; 1595 dev->dv_timings_cap = *timings;
1596 vivid_update_format_cap(dev, false); 1596 vivid_update_format_cap(dev, false);
1597 return 0; 1597 return 0;
diff --git a/drivers/media/platform/vivid/vivid-vid-out.c b/drivers/media/platform/vivid/vivid-vid-out.c
index 6c6deef3521c..19eadddb5776 100644
--- a/drivers/media/platform/vivid/vivid-vid-out.c
+++ b/drivers/media/platform/vivid/vivid-vid-out.c
@@ -1127,13 +1127,13 @@ int vivid_vid_out_s_dv_timings(struct file *file, void *_fh,
1127 1127
1128 if (!vivid_is_hdmi_out(dev)) 1128 if (!vivid_is_hdmi_out(dev))
1129 return -ENODATA; 1129 return -ENODATA;
1130 if (vb2_is_busy(&dev->vb_vid_out_q))
1131 return -EBUSY;
1132 if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap, 1130 if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap,
1133 0, NULL, NULL)) 1131 0, NULL, NULL))
1134 return -EINVAL; 1132 return -EINVAL;
1135 if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0)) 1133 if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0))
1136 return 0; 1134 return 0;
1135 if (vb2_is_busy(&dev->vb_vid_out_q))
1136 return -EBUSY;
1137 dev->dv_timings_out = *timings; 1137 dev->dv_timings_out = *timings;
1138 vivid_update_format_out(dev); 1138 vivid_update_format_out(dev);
1139 return 0; 1139 return 0;