Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4188546ybg; Mon, 8 Jun 2020 01:05:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwREFO1/XKqzyn/U3B7jifhUIbM2LfAN8lh515+MPUEUM0EPCN0CNVY5HuYQTGx++UbMwzy X-Received: by 2002:a17:906:11c4:: with SMTP id o4mr20475818eja.163.1591603518127; Mon, 08 Jun 2020 01:05:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591603518; cv=none; d=google.com; s=arc-20160816; b=YoCkNohSJeNlUdGnJ/qMq+V14a1peuUED9Vy8hv+c5ci8bG4aGA8wsNs2Clrm/mLhH lBitTL92R6U1pkbgtTJcOC5Q6kEfv0DPQgvkZOe+v+Za1u0fLFihVIzSYlyW/v6vAKVv 48m0m35cc+AJHNyGdvskOYwIJdxG2XjlKInr5keDmFwIQdgKdTO5uLzYMt/g3Hj0c2F8 HLrY+ztqWG02pYC4ElC1ZhgHuvAhAHKX+WoQM5C/WJGXQA2AaOQ9FZoR/FHoBSqutUz2 U1UAmHl0NZCzY2XmLOZGOyRHsVRZQjbOVjrdpMtSw72R4CpzkJm4fzAHUDsXJTgzYwSp 8b8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KYku9AE65pS6quBHGe77ILKjqsmXVyGlRGm4PBkxFZc=; b=qOCpY1XPkGKfL1RK9t/nClN7ztFH3qt+U6gLk306hzFQHOvBdTs9R5yZzsvsiRs+qu yqT4n3Rj+aLpiz40O4Wa+/JKc8PgqB2mygyYEzGDZqkiQR1C1NMgvUYziRC8L4wI+K8S mKDNE+PA4CEtNT/qoDJmE2fFEvNw1Ns46ehPAUKcwDV3g2/9SAPVMUaAedeG5QvQUQMY Q9fRCWEYM93AibWFvXoTTSl/Xi2dBsDHppxt1dMJyET9jRmRmx1t7wFmI0InYJTwtaC4 PwaKKyJI8Mf2gyEpD2F/BmzyTGgTzUmR0/Z56yKtyqepZlfmZOr+dusHSZTN5BM+Dekj np/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si8040951ejb.595.2020.06.08.01.04.52; Mon, 08 Jun 2020 01:05:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729059AbgFHIC0 (ORCPT + 99 others); Mon, 8 Jun 2020 04:02:26 -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