From patchwork Mon Mar 20 15:43:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9634437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ADBAE601E9 for ; Mon, 20 Mar 2017 15:46:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DF3327F95 for ; Mon, 20 Mar 2017 15:46:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 926B727F9F; Mon, 20 Mar 2017 15:46:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA54A2808F for ; Mon, 20 Mar 2017 15:46:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754532AbdCTPpe (ORCPT ); Mon, 20 Mar 2017 11:45:34 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:35910 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753724AbdCTPpa (ORCPT ); Mon, 20 Mar 2017 11:45:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=CijSjJK9qrqvm9G2+oVrFS9AmuvMdNQCLXr9uHnDzKE=; b=SmUYGlWq56I0+X6RoGod4lN9qwj9dv3S9igxBwDjR7eYsjJNUKu8XmdU+sLAsd0tUCy51eW+KmiYwimjq4lXC1xhfcaNqu+zxYKFV78c8giCeJUD75dC2ghg3nNI+n7hRXg6RuQ0jYyrUL/AP+2RGTnzycse7z09aqTErafvcXc=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:36969) by pandora.armlinux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1cpzTD-0004im-PY; Mon, 20 Mar 2017 15:43:44 +0000 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.76) (envelope-from ) id 1cpzT9-0003np-T4; Mon, 20 Mar 2017 15:43:39 +0000 Date: Mon, 20 Mar 2017 15:43:39 +0000 From: Russell King - ARM Linux To: Philipp Zabel Cc: Steve Longerbeam , Steve Longerbeam , robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, mchehab@kernel.org, hverkuil@xs4all.nl, nick@shmanahar.org, markus.heiser@darmarIT.de, laurent.pinchart+renesas@ideasonboard.com, bparrot@ti.com, geert@linux-m68k.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, minghsiu.tsai@mediatek.com, tiffany.lin@mediatek.com, jean-christophe.trotin@st.com, horms+renesas@verge.net.au, niklas.soderlund+renesas@ragnatech.se, robert.jarzmik@free.fr, songjun.wu@microchip.com, andrew-ct.chen@mediatek.com, gregkh@linuxfoundation.org, shuah@kernel.org, sakari.ailus@linux.intel.com, pavel@ucw.cz, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org Subject: Re: [PATCH v5 00/39] i.MX Media Driver Message-ID: <20170320154339.GN21222@n2100.armlinux.org.uk> References: <1489121599-23206-1-git-send-email-steve_longerbeam@mentor.com> <20170318192258.GL21222@n2100.armlinux.org.uk> <20170319121402.GS21222@n2100.armlinux.org.uk> <1490016016.2917.68.camel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490016016.2917.68.camel@pengutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Mar 20, 2017 at 02:20:16PM +0100, Philipp Zabel wrote: > To set and read colorimetry information: > https://patchwork.linuxtv.org/patch/39350/ Thanks, I've applied all four of your patches, but there's a side effect from that. Old media-ctl (modified by me): - entity 53: imx219 0-0010 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev9 pad0: Source [fmt:SRGGB8/816x616 field:none frame_interval:1/25] -> "imx6-mipi-csi2":0 [ENABLED] pad1: Sink [fmt:SRGGB10/3280x2464 field:none crop.bounds:(0,0)/3280x2464 crop:(0,0)/3264x2464 compose.bounds:(0,0)/3264x2464 compose:(0,0)/816x616] <- "imx219 pixel 0-0010":0 [ENABLED,IMMUTABLE] New media-ctl: - entity 53: imx219 0-0010 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev9 pad0: Source [fmt:SRGGB8_1X8/816x616@1/25 field:none colorspace:srgb xfer:srgb] -> "imx6-mipi-csi2":0 [ENABLED] pad1: Sink <- "imx219 pixel 0-0010":0 [ENABLED,IMMUTABLE] It looks like we successfully retrieve the frame interval for pad 0 and print it, but when we try to retrieve the frame interval for pad 1, we get EINVAL (because that's what I'm returning, but I'm wondering if that's the correct thing to do...) and that prevents _all_ format information being output. Maybe something like the following would be a better idea? utils/media-ctl/media-ctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c index f61963a..a50a559 100644 --- a/utils/media-ctl/media-ctl.c +++ b/utils/media-ctl/media-ctl.c @@ -81,22 +81,22 @@ static void v4l2_subdev_print_format(struct media_entity *entity, struct v4l2_mbus_framefmt format; struct v4l2_fract interval = { 0, 0 }; struct v4l2_rect rect; - int ret; + int ret, err_fi; ret = v4l2_subdev_get_format(entity, &format, pad, which); if (ret != 0) return; - ret = v4l2_subdev_get_frame_interval(entity, &interval, pad); - if (ret != 0 && ret != -ENOTTY) - return; + err_fi = v4l2_subdev_get_frame_interval(entity, &interval, pad); printf("\t\t[fmt:%s/%ux%u", v4l2_subdev_pixelcode_to_string(format.code), format.width, format.height); - if (interval.numerator || interval.denominator) + if (err_fi == 0 && (interval.numerator || interval.denominator)) printf("@%u/%u", interval.numerator, interval.denominator); + else if (err_fi != -ENOTTY) + printf("@", strerror(-err_fi)); if (format.field) printf(" field:%s", v4l2_subdev_field_to_string(format.field));