Message ID | 070c9e71b359c0f6da7410b5ab9207210925549a.1490095965.git.joabreu@synopsys.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1cqIIy-0000cS-QY; Tue, 21 Mar 2017 11:50:24 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-5) with esmtp id 1cqIIw-0005mS-8M; Tue, 21 Mar 2017 12:50:24 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757215AbdCULuO (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Tue, 21 Mar 2017 07:50:14 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:48132 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757196AbdCULuM (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 21 Mar 2017 07:50:12 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 210F910C0FB0; Tue, 21 Mar 2017 04:49:56 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 0C4715FF; Tue, 21 Mar 2017 04:49:56 -0700 (PDT) Received: from joabreu-VirtualBox.internal.synopsys.com (joabreu-e7440.internal.synopsys.com [10.107.19.91]) by mailhost.synopsys.com (Postfix) with ESMTP id 7A3DF5FD; Tue, 21 Mar 2017 04:49:54 -0700 (PDT) From: Jose Abreu <Jose.Abreu@synopsys.com> To: linux-media@vger.kernel.org Cc: Jose Abreu <Jose.Abreu@synopsys.com>, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Hans Verkuil <hans.verkuil@cisco.com>, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] [media] cobalt: Use v4l2_calc_timeperframe helper Date: Tue, 21 Mar 2017 11:49:18 +0000 Message-Id: <070c9e71b359c0f6da7410b5ab9207210925549a.1490095965.git.joabreu@synopsys.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <cover.1490095965.git.joabreu@synopsys.com> References: <cover.1490095965.git.joabreu@synopsys.com> In-Reply-To: <cover.1490095965.git.joabreu@synopsys.com> References: <cover.1490095965.git.joabreu@synopsys.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.3.21.114517 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, REFERENCES 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MULTIPLE_RCPTS_CC_X2 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Jose Abreu
March 21, 2017, 11:49 a.m. UTC
Currently, cobalt driver always returns 60fps in g_parm.
This patch uses the new v4l2_calc_timeperframe helper to
calculate the time per frame value.
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/media/pci/cobalt/cobalt-v4l2.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Comments
Hi Jose, On 21/03/17 12:49, Jose Abreu wrote: > Currently, cobalt driver always returns 60fps in g_parm. > This patch uses the new v4l2_calc_timeperframe helper to > calculate the time per frame value. I can verify that g_parm works, so: Tested-by: Hans Verkuil <hans.verkuil@cisco.com> However, the adv7604 pixelclock detection resolution is only 0.25 MHz, so it can't tell the difference between 24 and 23.97 Hz. I can't set the new V4L2_DV_FL_CAN_DETECT_REDUCED_FPS flag there. It might be possible to implement this for the adv7842 receiver, I think that that hardware is much more precise. I would have to try this, but that will have to wait until Friday next week. Regards, Hans > > Signed-off-by: Jose Abreu <joabreu@synopsys.com> > Cc: Carlos Palminha <palminha@synopsys.com> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org> > Cc: Hans Verkuil <hans.verkuil@cisco.com> > Cc: linux-media@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/media/pci/cobalt/cobalt-v4l2.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c > index def4a3b..25532ae 100644 > --- a/drivers/media/pci/cobalt/cobalt-v4l2.c > +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c > @@ -1076,10 +1076,15 @@ static int cobalt_subscribe_event(struct v4l2_fh *fh, > > static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) > { > + struct cobalt_stream *s = video_drvdata(file); > + struct v4l2_fract fps; > + > if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) > return -EINVAL; > - a->parm.capture.timeperframe.numerator = 1; > - a->parm.capture.timeperframe.denominator = 60; > + > + fps = v4l2_calc_timeperframe(&s->timings); > + a->parm.capture.timeperframe.numerator = fps.numerator; > + a->parm.capture.timeperframe.denominator = fps.denominator; > a->parm.capture.readbuffers = 3; > return 0; > } >
Hi Hans, On 30-03-2017 14:42, Hans Verkuil wrote: > Hi Jose, > > On 21/03/17 12:49, Jose Abreu wrote: >> Currently, cobalt driver always returns 60fps in g_parm. >> This patch uses the new v4l2_calc_timeperframe helper to >> calculate the time per frame value. > I can verify that g_parm works, so: > > Tested-by: Hans Verkuil <hans.verkuil@cisco.com> > > However, the adv7604 pixelclock detection resolution is only 0.25 MHz, so it > can't tell the difference between 24 and 23.97 Hz. I can't set the new > V4L2_DV_FL_CAN_DETECT_REDUCED_FPS flag there. > > It might be possible to implement this for the adv7842 receiver, I think that > that hardware is much more precise. > > I would have to try this, but that will have to wait until Friday next week. Thanks! Yes, maybe its better to test with a different receiver, if it has more precision then its great. Let me know if you need any help :) Best regards, Jose Miguel Abreu > > Regards, > > Hans > >> Signed-off-by: Jose Abreu <joabreu@synopsys.com> >> Cc: Carlos Palminha <palminha@synopsys.com> >> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> >> Cc: Hans Verkuil <hans.verkuil@cisco.com> >> Cc: linux-media@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> --- >> drivers/media/pci/cobalt/cobalt-v4l2.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c >> index def4a3b..25532ae 100644 >> --- a/drivers/media/pci/cobalt/cobalt-v4l2.c >> +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c >> @@ -1076,10 +1076,15 @@ static int cobalt_subscribe_event(struct v4l2_fh *fh, >> >> static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) >> { >> + struct cobalt_stream *s = video_drvdata(file); >> + struct v4l2_fract fps; >> + >> if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) >> return -EINVAL; >> - a->parm.capture.timeperframe.numerator = 1; >> - a->parm.capture.timeperframe.denominator = 60; >> + >> + fps = v4l2_calc_timeperframe(&s->timings); >> + a->parm.capture.timeperframe.numerator = fps.numerator; >> + a->parm.capture.timeperframe.denominator = fps.denominator; >> a->parm.capture.readbuffers = 3; >> return 0; >> } >>
Hi Hans, On 31-03-2017 09:59, Jose Abreu wrote: > Hi Hans, > > > On 30-03-2017 14:42, Hans Verkuil wrote: >> Hi Jose, >> >> On 21/03/17 12:49, Jose Abreu wrote: >>> Currently, cobalt driver always returns 60fps in g_parm. >>> This patch uses the new v4l2_calc_timeperframe helper to >>> calculate the time per frame value. >> I can verify that g_parm works, so: >> >> Tested-by: Hans Verkuil <hans.verkuil@cisco.com> >> >> However, the adv7604 pixelclock detection resolution is only 0.25 MHz, so it >> can't tell the difference between 24 and 23.97 Hz. I can't set the new >> V4L2_DV_FL_CAN_DETECT_REDUCED_FPS flag there. >> >> It might be possible to implement this for the adv7842 receiver, I think that >> that hardware is much more precise. >> >> I would have to try this, but that will have to wait until Friday next week. > Thanks! Yes, maybe its better to test with a different receiver, > if it has more precision then its great. Let me know if you need > any help :) Any news regarding this? Best regards, Jose Miguel Abreu > > Best regards, > Jose Miguel Abreu > >> Regards, >> >> Hans >> >>> Signed-off-by: Jose Abreu <joabreu@synopsys.com> >>> Cc: Carlos Palminha <palminha@synopsys.com> >>> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> >>> Cc: Hans Verkuil <hans.verkuil@cisco.com> >>> Cc: linux-media@vger.kernel.org >>> Cc: linux-kernel@vger.kernel.org >>> --- >>> drivers/media/pci/cobalt/cobalt-v4l2.c | 9 +++++++-- >>> 1 file changed, 7 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c >>> index def4a3b..25532ae 100644 >>> --- a/drivers/media/pci/cobalt/cobalt-v4l2.c >>> +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c >>> @@ -1076,10 +1076,15 @@ static int cobalt_subscribe_event(struct v4l2_fh *fh, >>> >>> static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) >>> { >>> + struct cobalt_stream *s = video_drvdata(file); >>> + struct v4l2_fract fps; >>> + >>> if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) >>> return -EINVAL; >>> - a->parm.capture.timeperframe.numerator = 1; >>> - a->parm.capture.timeperframe.denominator = 60; >>> + >>> + fps = v4l2_calc_timeperframe(&s->timings); >>> + a->parm.capture.timeperframe.numerator = fps.numerator; >>> + a->parm.capture.timeperframe.denominator = fps.denominator; >>> a->parm.capture.readbuffers = 3; >>> return 0; >>> } >>>
diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index def4a3b..25532ae 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -1076,10 +1076,15 @@ static int cobalt_subscribe_event(struct v4l2_fh *fh, static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) { + struct cobalt_stream *s = video_drvdata(file); + struct v4l2_fract fps; + if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; - a->parm.capture.timeperframe.numerator = 1; - a->parm.capture.timeperframe.denominator = 60; + + fps = v4l2_calc_timeperframe(&s->timings); + a->parm.capture.timeperframe.numerator = fps.numerator; + a->parm.capture.timeperframe.denominator = fps.denominator; a->parm.capture.readbuffers = 3; return 0; }