Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp487228ybi; Fri, 31 May 2019 04:44:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4FIlZ02nqBTzqeUL8rgJC8dCjT8wpif76WIp4TpHVFhbeLJFXfyGc3WObnrdmUexsBABk X-Received: by 2002:a17:902:2a69:: with SMTP id i96mr399734plb.108.1559303071647; Fri, 31 May 2019 04:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559303071; cv=none; d=google.com; s=arc-20160816; b=YHVHgUXSHf7zjKMS4yIYvgNo8oUTtY/65HvCfZL2AlEVdGhyQ06qlU5ygVE28vGeQ5 zN+x3FkSiQ0I5UH2ADfSq+Lpxx0iIxEcnuVD+7x1UWL9J4JDCntkLAcxN1Ju+e2Jbj8l hoHE+vlaRJCEXyE1g9zup7VH67b2grlpkBRzMfacPj2MBnZZI+4po/XrzGJVcFFrJK4N 9e9u9LDFTHobmbkGgBT8qof3MeC1lAHCy1IExDC508UaZaNauA8wEplShUkqvG6HITqg o2pQnBEaIMVmEYmCsupc8NwykHAupulA6eG70NkPXR97PHj1U0RQzsz68DOBOSC0HAUr oElg== 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=WlbrQbCq+ffTA12kuoHf2X4v6Fh3AAwFU2BkQVR2H+k=; b=bFzAkjnwfuBFuooXK641QNMmQdYpJNiG2B66P9IIu3f6GWGTRoZ/D+oQsNXlflPyYl 7JkJQ34x+7lAW0is2goEBv6lauQSVnmzmvmxWOJ44biHqMn0AEKU3fz1TPK/fsLoL7Ck 47WF8s7omaiAatfAWJJ9rbo17fKaG2uebhiaJkCrflvrlMeSuCmRd0/ArEBIMhq7CtT9 4HSG9mGKWtWqAq0CRzZVsCur4nWkTJd4CzoRr3raDh/IPT9ulKq5M9KfwPDx1CjBZNn+ QjeQq/2cThzLDck6b7CWwJIU4oTKJYKiyxzyMuhMIh7y0Ep54myoZxGHFrXHap5n0Zyp XCLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t125si5952939pgc.528.2019.05.31.04.44.13; Fri, 31 May 2019 04:44:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbfEaLnD (ORCPT + 99 others); Fri, 31 May 2019 07:43:03 -0400 Received: from retiisi.org.uk ([95.216.213.190]:48320 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726158AbfEaLnC (ORCPT ); Fri, 31 May 2019 07:43:02 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 538F7634C7B; Fri, 31 May 2019 14:42:58 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.89) (envelope-from ) id 1hWfw2-0000Ju-F9; Fri, 31 May 2019 14:42:58 +0300 Date: Fri, 31 May 2019 14:42:58 +0300 From: Sakari Ailus To: Janusz Krzysztofik Cc: Mauro Carvalho Chehab , Sakari Ailus , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 4/5] media: ov6650: Fix frame scaling not reset on crop Message-ID: <20190531114258.6bvsqzlexqnelu5u@valkosipuli.retiisi.org.uk> References: <20190526204758.1904-1-jmkrzyszt@gmail.com> <20190526204758.1904-5-jmkrzyszt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190526204758.1904-5-jmkrzyszt@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Janusz, On Sun, May 26, 2019 at 10:47:57PM +0200, Janusz Krzysztofik wrote: > According to V4L2 subdevice interface specification, frame scaling > factors should be reset to default values on modification of input frame > format. Assuming that requirement also applies in case of crop > rectangle modification unless V4L2_SEL_FLAG_KEEP_CONFIG is requested, > the driver now does not respect it. > > The KEEP_CONFIG case is already implemented, fix the other path. > > Signed-off-by: Janusz Krzysztofik > --- > drivers/media/i2c/ov6650.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c > index 47590cd51190..cc70d8952999 100644 > --- a/drivers/media/i2c/ov6650.c > +++ b/drivers/media/i2c/ov6650.c > @@ -472,6 +472,8 @@ static int ov6650_get_selection(struct v4l2_subdev *sd, > } > } > > +static int ov6650_s_fmt(struct v4l2_subdev *sd, u32 code, bool half_scale); > + Would it be possible to rearrange the functions in the file so you wouldn't need extra prototypes? Preferrably that'd be a new patch. > static int ov6650_set_selection(struct v4l2_subdev *sd, > struct v4l2_subdev_pad_config *cfg, > struct v4l2_subdev_selection *sel) > @@ -515,7 +517,13 @@ static int ov6650_set_selection(struct v4l2_subdev *sd, > } > if (!ret) > priv->rect.height = sel->r.height; > + else > + return ret; if (ret) return ret; ... > > + if (priv->half_scale) { > + /* turn off half scaling, preserve media bus format */ > + ret = ov6650_s_fmt(sd, priv->code, false); > + } > return ret; > } > -- Regards, Sakari Ailus