[{"id":15857,"web_url":"https://patchwork.libcamera.org/comment/15857/","msgid":"<cde157c4-0a71-5407-32a4-fb4f6f218bff@ideasonboard.com>","date":"2021-03-24T07:19:47","subject":"Re: [libcamera-devel] [PATCH 7/7] libcamera: ipu3: imgu: Change\n\tIF_CROP_MAX to 40","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Hi Jacopo,\n\nThanks for the patch,\n\nOn 18/03/2021 11:39, Jacopo Mondi wrote:\n> From: Dave Olsthoorn <dave@bewaar.me>\n> \n> The value of IF_CROP_MAX seems to be a typo. A resolution of 40x540 seems\n> unlikely and excludes camera's with a 640x480 resolution, like the OV7251\n> in several Microsoft Surface products, from working.\n> \n> This patch corrects the value to 40 since a minimal resolution of 40x40\n> seems more logical.\n> \n> Signed-off-by: Dave Olsthoorn <dave@bewaar.me>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\nTested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index b6a1fe34494e..dd7d2e947141 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -44,7 +44,7 @@ static constexpr unsigned int BDS_ALIGN_W = 2;\n>  static constexpr unsigned int BDS_ALIGN_H = 4;\n>  \n>  static constexpr unsigned int IF_CROP_MAX_W = 40;\n> -static constexpr unsigned int IF_CROP_MAX_H = 540;\n> +static constexpr unsigned int IF_CROP_MAX_H = 40;\n>  \n>  static constexpr float BDS_SF_MAX = 2.5;\n>  static constexpr float BDS_SF_MIN = 1.0;\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8AB98C32E5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Mar 2021 07:19:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E6D8068D63;\n\tWed, 24 Mar 2021 08:19:48 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D67DC68D47\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Mar 2021 08:19:47 +0100 (CET)","from [IPv6:2a01:e0a:169:7140:21bd:98cc:c21e:1364] (unknown\n\t[IPv6:2a01:e0a:169:7140:21bd:98cc:c21e:1364])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 61F7D580;\n\tWed, 24 Mar 2021 08:19:47 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ue74mPGx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1616570387;\n\tbh=9ymsw773skTrqNkrFyaP449mrCZMSHYUl7TGwJhszqM=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=ue74mPGxLZIHO0gBaKHuxwV+Dp17CwTh7bfm3i4QnNqkwL1I6ZCGP4+5L375O7E/4\n\tL2hYyonHcMz4n9xM88kk6IQeeUxoZ3z4QqRtfz7pp5DZLOaq6+IeuaM99AWFrHgprB\n\tCg6c3d1MmddvcFjlzho7KfGiZtD+l5EUbdADsS68=","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20210318103941.18837-1-jacopo@jmondi.org>\n\t<20210318103941.18837-8-jacopo@jmondi.org>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<cde157c4-0a71-5407-32a4-fb4f6f218bff@ideasonboard.com>","Date":"Wed, 24 Mar 2021 08:19:47 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.7.1","MIME-Version":"1.0","In-Reply-To":"<20210318103941.18837-8-jacopo@jmondi.org>","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 7/7] libcamera: ipu3: imgu: Change\n\tIF_CROP_MAX to 40","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"Dave Olsthoorn <dave@bewaar.me>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16192,"web_url":"https://patchwork.libcamera.org/comment/16192/","msgid":"<YHTdgohzyumx88wO@pendragon.ideasonboard.com>","date":"2021-04-12T23:53:38","subject":"Re: [libcamera-devel] [PATCH 7/7] libcamera: ipu3: imgu: Change\n\tIF_CROP_MAX to 40","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Thu, Mar 18, 2021 at 11:39:41AM +0100, Jacopo Mondi wrote:\n> From: Dave Olsthoorn <dave@bewaar.me>\n> \n> The value of IF_CROP_MAX seems to be a typo. A resolution of 40x540 seems\n> unlikely and excludes camera's with a 640x480 resolution, like the OV7251\n> in several Microsoft Surface products, from working.\n\nIF_CROP_MAX_H seems to be the maximum cropping that can be applied\nvertically, and is used to limit the search space. I'm not sure if\nthat's a device limitation or a software limitation, but in any case,\nit's not a minimum vertical size as this commit message seems to imply,\nand I don't see why it would excluse a 640x480 input.\n\nCould the problem be instead caused by\n\n\tunsigned int minIFHeight = iif.height - IF_CROP_MAX_H;\n\nin calculateBDSHeight() that will be a very large positive value if\niif.height < IF_CROP_MAX_H ?\n\n> This patch corrects the value to 40 since a minimal resolution of 40x40\n> seems more logical.\n> \n> Signed-off-by: Dave Olsthoorn <dave@bewaar.me>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index b6a1fe34494e..dd7d2e947141 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -44,7 +44,7 @@ static constexpr unsigned int BDS_ALIGN_W = 2;\n>  static constexpr unsigned int BDS_ALIGN_H = 4;\n>  \n>  static constexpr unsigned int IF_CROP_MAX_W = 40;\n> -static constexpr unsigned int IF_CROP_MAX_H = 540;\n> +static constexpr unsigned int IF_CROP_MAX_H = 40;\n>  \n>  static constexpr float BDS_SF_MAX = 2.5;\n>  static constexpr float BDS_SF_MIN = 1.0;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6713DBD1F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Apr 2021 23:54:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D821A687F4;\n\tTue, 13 Apr 2021 01:54:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 56434605AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 01:54:28 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BAE116F2;\n\tTue, 13 Apr 2021 01:54:27 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ej061GKv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1618271667;\n\tbh=zTJSGY9Cdnmtu4H0Z7gr59ywzQBwYwzWRIyXCsNNoxA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ej061GKvHC6pN/Z/vl0tLDHODgg+8wM0QAN8jasTMN9toRODha9RbzhWJTIVaYuc2\n\tyk+eEX3Leq1nAt1I2hbt1NUjpyHEq3sm5WNiN6mjt9Otlm3jXaYk2d1FIWv2kgM5TK\n\t//6u58cW0SchwXJuTgacD1tu6WJiLYvdJH1ZvrXM=","Date":"Tue, 13 Apr 2021 02:53:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YHTdgohzyumx88wO@pendragon.ideasonboard.com>","References":"<20210318103941.18837-1-jacopo@jmondi.org>\n\t<20210318103941.18837-8-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210318103941.18837-8-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 7/7] libcamera: ipu3: imgu: Change\n\tIF_CROP_MAX to 40","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, Dave Olsthoorn <dave@bewaar.me>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16452,"web_url":"https://patchwork.libcamera.org/comment/16452/","msgid":"<20210421125458.4zkstfyicsfdv55d@uno.localdomain>","date":"2021-04-21T12:54:58","subject":"Re: [libcamera-devel] [PATCH 7/7] libcamera: ipu3: imgu: Change\n\tIF_CROP_MAX to 40","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Tue, Apr 13, 2021 at 02:53:38AM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Thu, Mar 18, 2021 at 11:39:41AM +0100, Jacopo Mondi wrote:\n> > From: Dave Olsthoorn <dave@bewaar.me>\n> >\n> > The value of IF_CROP_MAX seems to be a typo. A resolution of 40x540 seems\n> > unlikely and excludes camera's with a 640x480 resolution, like the OV7251\n> > in several Microsoft Surface products, from working.\n>\n> IF_CROP_MAX_H seems to be the maximum cropping that can be applied\n> vertically, and is used to limit the search space. I'm not sure if\n> that's a device limitation or a software limitation, but in any case,\n> it's not a minimum vertical size as this commit message seems to imply,\n> and I don't see why it would excluse a 640x480 input.\n\nIndeed, the value does not reprent the min resolution...\n\n>\n> Could the problem be instead caused by\n>\n> \tunsigned int minIFHeight = iif.height - IF_CROP_MAX_H;\n>\n> in calculateBDSHeight() that will be a very large positive value if\n> iif.height < IF_CROP_MAX_H ?\n>\n\nI can add a check for that, unfortunately I cannot reproduce the\nproblem and I cannot tell if that would fix it.\n\nDave could you test a follow-up patch eventually ?\n\nThanks\n  j\n\n> > This patch corrects the value to 40 since a minimal resolution of 40x40\n> > seems more logical.\n> >\n> > Signed-off-by: Dave Olsthoorn <dave@bewaar.me>\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > index b6a1fe34494e..dd7d2e947141 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > @@ -44,7 +44,7 @@ static constexpr unsigned int BDS_ALIGN_W = 2;\n> >  static constexpr unsigned int BDS_ALIGN_H = 4;\n> >\n> >  static constexpr unsigned int IF_CROP_MAX_W = 40;\n> > -static constexpr unsigned int IF_CROP_MAX_H = 540;\n> > +static constexpr unsigned int IF_CROP_MAX_H = 40;\n> >\n> >  static constexpr float BDS_SF_MAX = 2.5;\n> >  static constexpr float BDS_SF_MIN = 1.0;\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9AB58BDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Apr 2021 12:54:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0941668849;\n\tWed, 21 Apr 2021 14:54:19 +0200 (CEST)","from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22F5B68835\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 14:54:18 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 06C0F20009;\n\tWed, 21 Apr 2021 12:54:16 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Wed, 21 Apr 2021 14:54:58 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20210421125458.4zkstfyicsfdv55d@uno.localdomain>","References":"<20210318103941.18837-1-jacopo@jmondi.org>\n\t<20210318103941.18837-8-jacopo@jmondi.org>\n\t<YHTdgohzyumx88wO@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<YHTdgohzyumx88wO@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 7/7] libcamera: ipu3: imgu: Change\n\tIF_CROP_MAX to 40","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, Dave Olsthoorn <dave@bewaar.me>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]