aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2016-07-17 05:03:15 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-24 08:40:18 -0400
commit605a74e62809396cfcb786934f12be84a0da2282 (patch)
treed9ad723756aa9db8658f683fbcaa9d40f85b6f1e
parent969ac39e3df0f76fdb534efc7060c77f22fb5ac5 (diff)
[media] cobalt: support reduced fps
Add support for reduced fps (i.e. 59.94 Hz instead of 60 Hz) for the HDMI output. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/pci/cobalt/cobalt-v4l2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c
index d05672fe9ff9..5c76637900d0 100644
--- a/drivers/media/pci/cobalt/cobalt-v4l2.c
+++ b/drivers/media/pci/cobalt/cobalt-v4l2.c
@@ -161,8 +161,11 @@ static void cobalt_enable_output(struct cobalt_stream *s)
161 struct v4l2_subdev_format sd_fmt = { 161 struct v4l2_subdev_format sd_fmt = {
162 .which = V4L2_SUBDEV_FORMAT_ACTIVE, 162 .which = V4L2_SUBDEV_FORMAT_ACTIVE,
163 }; 163 };
164 u64 clk = bt->pixelclock;
164 165
165 if (!cobalt_cpld_set_freq(cobalt, bt->pixelclock)) { 166 if (bt->flags & V4L2_DV_FL_REDUCED_FPS)
167 clk = div_u64(clk * 1000ULL, 1001);
168 if (!cobalt_cpld_set_freq(cobalt, clk)) {
166 cobalt_err("pixelclock out of range\n"); 169 cobalt_err("pixelclock out of range\n");
167 return; 170 return;
168 } 171 }
@@ -644,7 +647,7 @@ static int cobalt_s_dv_timings(struct file *file, void *priv_fh,
644 return 0; 647 return 0;
645 } 648 }
646 649
647 if (v4l2_match_dv_timings(timings, &s->timings, 0, false)) 650 if (v4l2_match_dv_timings(timings, &s->timings, 0, true))
648 return 0; 651 return 0;
649 652
650 if (vb2_is_busy(&s->q)) 653 if (vb2_is_busy(&s->q))