From: Hans Verkuil Date: Fri, 17 Jul 2015 11:29:40 +0000 (-0300) Subject: [media] cobalt: accept unchanged timings when vb2_is_busy() X-Git-Tag: firefly_0821_release~176^2~795^2~335 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=810c168c233fc531ecd3e7a6d9e0b5a3ffe85da7;p=firefly-linux-kernel-4.4.55.git [media] cobalt: accept unchanged timings when vb2_is_busy() When vb2_is_busy() it should still be possible to call S_DV_TIMINGS provided the new timings are the same as the current timings. For input 1 (test generator) the size is always 1080p, so just return that. Fixes a v4l2-compliance issue. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index b40c2d141b58..9756fd3e8af5 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -641,13 +642,17 @@ static int cobalt_s_dv_timings(struct file *file, void *priv_fh, struct cobalt_stream *s = video_drvdata(file); int err; - if (vb2_is_busy(&s->q)) - return -EBUSY; - if (s->input == 1) { *timings = cea1080p60; return 0; } + + if (v4l2_match_dv_timings(timings, &s->timings, 0)) + return 0; + + if (vb2_is_busy(&s->q)) + return -EBUSY; + err = v4l2_subdev_call(s->sd, video, s_dv_timings, timings); if (!err) {