[media] vivid: allow s_dv_timings if it is the same as the current
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 14 Mar 2015 12:35:23 +0000 (09:35 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 3 Apr 2015 00:09:35 +0000 (21:09 -0300)
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>
drivers/media/platform/vivid/vivid-vid-cap.c
drivers/media/platform/vivid/vivid-vid-out.c

index 1d9ea2d9d61a84d4b8d1cb4ebc4b37e33e5664cf..c942bf7ac95a3292f12e0db47c03bb6b78cea247 100644 (file)
@@ -1585,13 +1585,13 @@ int vivid_vid_cap_s_dv_timings(struct file *file, void *_fh,
 
        if (!vivid_is_hdmi_cap(dev))
                return -ENODATA;
-       if (vb2_is_busy(&dev->vb_vid_cap_q))
-               return -EBUSY;
        if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap,
                                0, NULL, NULL))
                return -EINVAL;
        if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0))
                return 0;
+       if (vb2_is_busy(&dev->vb_vid_cap_q))
+               return -EBUSY;
        dev->dv_timings_cap = *timings;
        vivid_update_format_cap(dev, false);
        return 0;
index 6c6deef3521c59325a441830bf7a41fd724e5e84..19eadddb5776ea3908a977a86de4f60b787e0f80 100644 (file)
@@ -1127,13 +1127,13 @@ int vivid_vid_out_s_dv_timings(struct file *file, void *_fh,
 
        if (!vivid_is_hdmi_out(dev))
                return -ENODATA;
-       if (vb2_is_busy(&dev->vb_vid_out_q))
-               return -EBUSY;
        if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap,
                                0, NULL, NULL))
                return -EINVAL;
        if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0))
                return 0;
+       if (vb2_is_busy(&dev->vb_vid_out_q))
+               return -EBUSY;
        dev->dv_timings_out = *timings;
        vivid_update_format_out(dev);
        return 0;