From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 041B3C433E0 for ; Mon, 8 Jun 2020 08:02:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF49E20774 for ; Mon, 8 Jun 2020 08:02:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729065AbgFHIC1 (ORCPT ); Mon, 8 Jun 2020 04:02:27 -0400 Received: from retiisi.org.uk ([95.216.213.190]:53930 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbgFHICZ (ORCPT ); Mon, 8 Jun 2020 04:02:25 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id ED924634C87; Mon, 8 Jun 2020 11:00:42 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1jiCi3-0004mZ-3R; Mon, 08 Jun 2020 11:00:43 +0300 Date: Mon, 8 Jun 2020 11:00:43 +0300 From: Sakari Ailus To: Andrey Konovalov Cc: mchehab@kernel.org, manivannan.sadhasivam@linaro.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, c.barrett@framos.com, a.brela@framos.com, peter.griffin@linaro.org Subject: Re: [PATCH v3 08/10] media: i2c: imx290: Add support to enumerate all frame sizes Message-ID: <20200608080043.GN9947@valkosipuli.retiisi.org.uk> References: <20200524192505.20682-1-andrey.konovalov@linaro.org> <20200524192505.20682-9-andrey.konovalov@linaro.org> <20200526091716.GJ8214@valkosipuli.retiisi.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 07, 2020 at 07:28:56PM +0300, Andrey Konovalov wrote: > Hi Sakari, > > Thank you for the review! > > On 26.05.2020 12:17, Sakari Ailus wrote: > > Hi Andrey, > > > > On Sun, May 24, 2020 at 10:25:03PM +0300, Andrey Konovalov wrote: > > > From: Manivannan Sadhasivam > > > > > > Add support to enumerate all frame sizes supported by IMX290. This is > > > required for using with userspace tools such as libcamera. > > > > > > Signed-off-by: Manivannan Sadhasivam > > > Signed-off-by: Andrey Konovalov > > > --- > > > drivers/media/i2c/imx290.c | 20 ++++++++++++++++++++ > > > 1 file changed, 20 insertions(+) > > > > > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c > > > index 6e70ff22bc5f..88850f3b1427 100644 > > > --- a/drivers/media/i2c/imx290.c > > > +++ b/drivers/media/i2c/imx290.c > > > @@ -471,6 +471,25 @@ static int imx290_enum_mbus_code(struct v4l2_subdev *sd, > > > return 0; > > > } > > > +static int imx290_enum_frame_size(struct v4l2_subdev *subdev, > > > + struct v4l2_subdev_pad_config *cfg, > > > + struct v4l2_subdev_frame_size_enum *fse) > > > +{ > > > + if ((fse->code != imx290_formats[0].code) && > > > + (fse->code != imx290_formats[1].code)) > > > + return -EINVAL; > > > > Please skip the modes that do not have the code specified by the user. They > > should not be enumerated here. > > I've double checked this part of the code, and it doesn't seem to need changes. > The reason is that for the both codes the set of the modes and the frame sizes is > exactly the same. And the fse->code check above just guards against the codes not > supported by the driver at all. Indeed. Please then ignore the comment. -- Sakari Ailus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9279C433DF for ; Mon, 8 Jun 2020 08:02:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 67104206D5 for ; Mon, 8 Jun 2020 08:02:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KehwDNgS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67104206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6/kUJyKW1I/ckVV2t4mXxOVCAcaPimlbeCRWsXdeMMY=; b=KehwDNgSqf/QL9 1knLM5UvyDsK4zu0pJzqBh5gLTfdpqomzZWVXmwyanu9oqZOEXBKQ0qFLXSVdYtoRkhnXFsnACieO lMurqVTJy3LXzqJLnI6c+OD1+KkRybcR+a+XwHjtidjl9kEtAYcbRwHcWxXIcCoxrroLRVyVrWu+y nW1+O6wn+JWnigSrkhXP+f//KWY96QahJsFXgb5WBplP31wOrzYW5IP+I3DddRj1SVBK89vN0CWVw ryWflAqmkiY8ZOvtr32YqMRDu+TEzELvEZ7KIjyN/k0wKdheQiyOAjjwjwIqP0wnSQrA5QvvW+O9J Fc0qQOgBKFyQufMlQoqg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jiCjn-00026z-Pe; Mon, 08 Jun 2020 08:02:31 +0000 Received: from hillosipuli.retiisi.org.uk ([2a01:4f9:c010:4572::81:2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jiCjj-00026C-1Z for linux-arm-kernel@lists.infradead.org; Mon, 08 Jun 2020 08:02:29 +0000 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id ED924634C87; Mon, 8 Jun 2020 11:00:42 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1jiCi3-0004mZ-3R; Mon, 08 Jun 2020 11:00:43 +0300 Date: Mon, 8 Jun 2020 11:00:43 +0300 From: Sakari Ailus To: Andrey Konovalov Subject: Re: [PATCH v3 08/10] media: i2c: imx290: Add support to enumerate all frame sizes Message-ID: <20200608080043.GN9947@valkosipuli.retiisi.org.uk> References: <20200524192505.20682-1-andrey.konovalov@linaro.org> <20200524192505.20682-9-andrey.konovalov@linaro.org> <20200526091716.GJ8214@valkosipuli.retiisi.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200608_010227_270443_D8B7D88C X-CRM114-Status: GOOD ( 19.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, c.barrett@framos.com, linux-kernel@vger.kernel.org, a.brela@framos.com, peter.griffin@linaro.org, manivannan.sadhasivam@linaro.org, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Jun 07, 2020 at 07:28:56PM +0300, Andrey Konovalov wrote: > Hi Sakari, > > Thank you for the review! > > On 26.05.2020 12:17, Sakari Ailus wrote: > > Hi Andrey, > > > > On Sun, May 24, 2020 at 10:25:03PM +0300, Andrey Konovalov wrote: > > > From: Manivannan Sadhasivam > > > > > > Add support to enumerate all frame sizes supported by IMX290. This is > > > required for using with userspace tools such as libcamera. > > > > > > Signed-off-by: Manivannan Sadhasivam > > > Signed-off-by: Andrey Konovalov > > > --- > > > drivers/media/i2c/imx290.c | 20 ++++++++++++++++++++ > > > 1 file changed, 20 insertions(+) > > > > > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c > > > index 6e70ff22bc5f..88850f3b1427 100644 > > > --- a/drivers/media/i2c/imx290.c > > > +++ b/drivers/media/i2c/imx290.c > > > @@ -471,6 +471,25 @@ static int imx290_enum_mbus_code(struct v4l2_subdev *sd, > > > return 0; > > > } > > > +static int imx290_enum_frame_size(struct v4l2_subdev *subdev, > > > + struct v4l2_subdev_pad_config *cfg, > > > + struct v4l2_subdev_frame_size_enum *fse) > > > +{ > > > + if ((fse->code != imx290_formats[0].code) && > > > + (fse->code != imx290_formats[1].code)) > > > + return -EINVAL; > > > > Please skip the modes that do not have the code specified by the user. They > > should not be enumerated here. > > I've double checked this part of the code, and it doesn't seem to need changes. > The reason is that for the both codes the set of the modes and the frame sizes is > exactly the same. And the fse->code check above just guards against the codes not > supported by the driver at all. Indeed. Please then ignore the comment. -- Sakari Ailus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel