From patchwork Wed Jun 24 13:52:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prashant Laddha X-Patchwork-Id: 6667821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78DC0C05AC for ; Wed, 24 Jun 2015 13:52:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFC61206E3 for ; Wed, 24 Jun 2015 13:52:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C796206DE for ; Wed, 24 Jun 2015 13:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbbFXNwb (ORCPT ); Wed, 24 Jun 2015 09:52:31 -0400 Received: from bgl-iport-3.cisco.com ([72.163.197.27]:60938 "EHLO bgl-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753563AbbFXNwS (ORCPT ); Wed, 24 Jun 2015 09:52:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3277; q=dns/txt; s=iport; t=1435153938; x=1436363538; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=qkb5iTQQ+T2yRDl23QRF6anBtZo8lyn6yCrUzpvqt+U=; b=FfOVOkGfo+9TJWRhv41ZuUMid5EtNSSu6umaOYT9qeiritOosP2aWyyY AzZr+2xz1GMwoIEqxWcrFFVu50g6E2pLjj2LSxwL4p/NkSveaaPZdRZr+ ut76pAgoVK4eq67q2wm+KP+qmn8u2RRZxEJNO6nR4K95qDTXzSMe7Sj4+ o=; X-IronPort-AV: E=Sophos;i="5.13,672,1427760000"; d="scan'208";a="18504139" Received: from vla196-nat.cisco.com (HELO bgl-core-4.cisco.com) ([72.163.197.24]) by bgl-iport-3.cisco.com with ESMTP; 24 Jun 2015 13:52:16 +0000 Received: from pla-VB.cisco.com ([10.142.61.237]) by bgl-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id t5ODqFdo010067; Wed, 24 Jun 2015 13:52:16 GMT From: Prashant Laddha To: linux-media@vger.kernel.org Cc: Hans Verkuil , Prashant Laddha Subject: [RFC PATCH v2 2/2] v4l2-utils: extend set-dv-timings to support reduced fps Date: Wed, 24 Jun 2015 19:22:15 +0530 Message-Id: <1435153935-11403-3-git-send-email-prladdha@cisco.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435153935-11403-1-git-send-email-prladdha@cisco.com> References: <1435153935-11403-1-git-send-email-prladdha@cisco.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-15.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Extended command line option for set-dv-timings to support timings calculations for reduced fps. This will allow supporting NTSC frame rates like 29.97 or 59.94. Cc: Hans Verkuil Signed-off-by: Prashant Laddha --- utils/v4l2-ctl/v4l2-ctl-stds.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-stds.cpp b/utils/v4l2-ctl/v4l2-ctl-stds.cpp index e969d08..3987ba1 100644 --- a/utils/v4l2-ctl/v4l2-ctl-stds.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-stds.cpp @@ -41,11 +41,15 @@ void stds_usage(void) " index=: use the index as provided by --list-dv-timings\n" " or specify timings using cvt/gtf options as follows:\n" " cvt/gtf,width=,height=,fps=\n" - " interlaced=<0/1>,reduced-blanking=<0/1/2>\n" + " interlaced=<0/1>,reduced-blanking=<0/1/2>,reduced-fps=<0/1>\n" " The value of reduced-blanking, if greater than 0, indicates\n" " that reduced blanking is to be used and the value indicate the\n" " version. For gtf, there is no version 2 for reduced blanking, and\n" " the value 1 or 2 will give same results.\n" + " reduced-fps = 1, slows down pixel clock by factor of 1000 / 1001, allowing\n" + " to support NTSC frame rates like 29.97 or 59.94.\n" + " Reduced fps flag takes effect only with reduced blanking version 2 and,\n" + " when refresh rate is an integer multiple of 6, say, fps = 24,30,60 etc.\n" " or give a fully specified timings:\n" " width=,height=,interlaced=<0/1>,\n" " polarities=,pixelclock=,\n" @@ -152,6 +156,7 @@ enum timing_opts { GTF, FPS, REDUCED_BLANK, + REDUCED_FPS, }; static int parse_timing_subopt(char **subopt_str, int *value) @@ -179,6 +184,7 @@ static int parse_timing_subopt(char **subopt_str, int *value) "gtf", "fps", "reduced-blanking", + "reduced-fps", NULL }; @@ -209,6 +215,7 @@ static void get_cvt_gtf_timings(char *subopt, int standard, int fps = 0; int r_blank = 0; int interlaced = 0; + bool reduced_fps = false; bool timings_valid = false; char *subopt_str = subopt; @@ -234,6 +241,9 @@ static void get_cvt_gtf_timings(char *subopt, int standard, case INTERLACED: interlaced = opt_val; break; + case REDUCED_FPS: + reduced_fps = (opt_val == 1) ? true : false; + break; default: break; } @@ -241,7 +251,7 @@ static void get_cvt_gtf_timings(char *subopt, int standard, if (standard == V4L2_DV_BT_STD_CVT) { timings_valid = calc_cvt_modeline(width, height, fps, r_blank, - interlaced == 1 ? true : false, false, bt); + interlaced == 1 ? true : false, reduced_fps, bt); } else { timings_valid = calc_gtf_modeline(width, height, fps, r_blank, interlaced == 1 ? true : false, bt);