Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2790306pxb; Fri, 5 Nov 2021 04:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx58hmMBHf2Ut2osHE9mMwnwvw8ZDgLr2V3vTIdvaKnf/9t3ODy6u10E+q3Bhkm8p96KU3G X-Received: by 2002:aa7:cb0a:: with SMTP id s10mr76262085edt.289.1636113131106; Fri, 05 Nov 2021 04:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636113131; cv=none; d=google.com; s=arc-20160816; b=j49Wa0XKGqw7JLN8Kp0m4svw5YFODq5xLkVUGQSrQ9tD+VgM64OzdQixJzOCQVZ8iq H0xI6kRlwVthz6lAJx4ZWBjNFWldDTZcBY5knmy40xdE0QWBa9eN4IZD7yeEJ8JvqvNN pBtT3DzJvotj9Rpl08z/s821RCTjYg2C2o05VE4xM0DrFAbKBKVQXvoODZq8BEaLcPg0 pRPdGR5S+GeZDRcttWoP3pa9GYyKli1FlI6LgE/INhuGw/EwEmanFwZbNvmOIAzBfxyz OxM5rinJS0j3l4DOeBrlqmMppuomTyKJ8AJmSnfn4kPVzcvgf/vXLeBSVZG9eUIsx+FH ZbYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Y0eXjwgCB3kukdsWXPMiNn0/W8X3FpL8VRPUwOJcsp0=; b=qiOxqJwMoUainRa5kdevczYDE3z2/URHkLTj4QonnGBTYJMMS6tP3RpskevWKfZ+RY JVRObjDHkTsIlWdRgIWW5m4pQgKTtGTJ1eTDZ4oI/m5oU8PHfcE07gIen38JbRvduLmo PoKl/Y0ovZ7tR+DJhWNL3KkXpkXqJM1vcdBzQLObHZZ63Ov5BVeYOyLT+9otg6iX2vJ4 zQTPx24aKShgJn5hscYHRi/cLzoIpopVw+GIcyvKD6D2/7HIhUHnL2z0lPGDSmPv0z6K rpsm0llf8ZM1WzsaZk/9bNg5hi/xq+RAQZ8O++cgl4PV9ONpgOENLR8DGgQYqMAeznfp fuKw== 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 ji21si15730565ejc.247.2021.11.05.04.51.43; Fri, 05 Nov 2021 04:52:11 -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 S232870AbhKEJyu (ORCPT + 99 others); Fri, 5 Nov 2021 05:54:50 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35545 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232829AbhKEJyr (ORCPT ); Fri, 5 Nov 2021 05:54:47 -0400 Received: (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 2520860011; Fri, 5 Nov 2021 09:52:02 +0000 (UTC) Date: Fri, 5 Nov 2021 10:52:54 +0100 From: Jacopo Mondi To: Eugen Hristev Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, robh+dt@kernel.org, nicolas.ferre@microchip.com Subject: Re: [PATCH 10/21] media: atmel: atmel-isc-base: report frame sizes as full supported range Message-ID: <20211105095254.iueeneatxn2fm73k@uno.localdomain> References: <20211022075247.518880-1-eugen.hristev@microchip.com> <20211022075247.518880-11-eugen.hristev@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211022075247.518880-11-eugen.hristev@microchip.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eugen On Fri, Oct 22, 2021 at 10:52:36AM +0300, Eugen Hristev wrote: > The ISC supports a full broad range of frame sizes. > Until now, the subdevice was queried for possible frame sizes and these > were reported to the user space. > However, the ISC should not care about which frame sizes the subdev supports, > as long as this frame size is supported. > Thus, report a continuous range from smallest frame size up to the max > resolution. > > Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Thanks j > --- > drivers/media/platform/atmel/atmel-isc-base.c | 22 +++++++++---------- > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c > index 8537ad73d160..2dd2511c7be1 100644 > --- a/drivers/media/platform/atmel/atmel-isc-base.c > +++ b/drivers/media/platform/atmel/atmel-isc-base.c > @@ -1077,14 +1077,12 @@ static int isc_enum_framesizes(struct file *file, void *fh, > struct v4l2_frmsizeenum *fsize) > { > struct isc_device *isc = video_drvdata(file); > - struct v4l2_subdev_frame_size_enum fse = { > - .code = isc->config.sd_format->mbus_code, > - .index = fsize->index, > - .which = V4L2_SUBDEV_FORMAT_ACTIVE, > - }; > int ret = -EINVAL; > int i; > > + if (fsize->index) > + return -EINVAL; > + > for (i = 0; i < isc->num_user_formats; i++) > if (isc->user_formats[i]->fourcc == fsize->pixel_format) > ret = 0; > @@ -1096,14 +1094,14 @@ static int isc_enum_framesizes(struct file *file, void *fh, > if (ret) > return ret; > > - ret = v4l2_subdev_call(isc->current_subdev->sd, pad, enum_frame_size, > - NULL, &fse); > - if (ret) > - return ret; > + fsize->type = V4L2_FRMSIZE_TYPE_CONTINUOUS; > > - fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; > - fsize->discrete.width = fse.max_width; > - fsize->discrete.height = fse.max_height; > + fsize->stepwise.min_width = 16; > + fsize->stepwise.max_width = isc->max_width; > + fsize->stepwise.min_height = 16; > + fsize->stepwise.max_height = isc->max_height; > + fsize->stepwise.step_width = 1; > + fsize->stepwise.step_height = 1; > > return 0; > } > -- > 2.25.1 >