[{"id":29977,"web_url":"https://patchwork.libcamera.org/comment/29977/","msgid":"<171861602481.2248009.14706578220427107943@ping.linuxembedded.co.uk>","date":"2024-06-17T09:20:24","subject":"Re: [PATCH 07/12] ipa: rkisp1: agc: Don't update histogram\n\tparameters unnecessarily","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-06-16 17:39:05)\n> The ISP histogram parameters depends on the AE metering mode, but not on\n> the other AE algorithm controls. The exposure mode, constraints mode and\n> frame duration limits influence the behaviour of the algorithm, but not\n> the histogram computation parameters. Update the histogram parameters\n> only when AE metering mode changes.\n> \n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 9 ++-------\n>  1 file changed, 2 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 9dac60bdb24e..9f3b59b45f95 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -261,26 +261,21 @@ void Agc::queueRequest(IPAContext &context,\n>         frameContext.agc.meteringMode = agc.meteringMode;\n>  \n>         const auto &exposureMode = controls.get(controls::AeExposureMode);\n> -       if (exposureMode) {\n> -               frameContext.agc.update = agc.exposureMode != *exposureMode;\n> +       if (exposureMode)\n>                 agc.exposureMode =\n>                         static_cast<controls::AeExposureModeEnum>(*exposureMode);\n> -       }\n>         frameContext.agc.exposureMode = agc.exposureMode;\n>  \n>         const auto &constraintMode = controls.get(controls::AeConstraintMode);\n> -       if (constraintMode) {\n> -               frameContext.agc.update = agc.constraintMode != *constraintMode;\n> +       if (constraintMode)\n>                 agc.constraintMode =\n>                         static_cast<controls::AeConstraintModeEnum>(*constraintMode);\n> -       }\n>         frameContext.agc.constraintMode = agc.constraintMode;\n>  \n>         const auto &frameDurationLimits = controls.get(controls::FrameDurationLimits);\n>         if (frameDurationLimits) {\n>                 utils::Duration maxShutterSpeed =\n>                         std::chrono::milliseconds((*frameDurationLimits).back());\n> -               frameContext.agc.update = agc.maxShutterSpeed != maxShutterSpeed;\n>                 agc.maxShutterSpeed = maxShutterSpeed;\n>         }\n>         frameContext.agc.maxShutterSpeed = agc.maxShutterSpeed;\n> -- \n> Regards,\n> \n> Laurent Pinchart\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 235EDBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jun 2024 09:20:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 354CF65489;\n\tMon, 17 Jun 2024 11:20:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C7EBA65489\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jun 2024 11:20:27 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F2E1C39F;\n\tMon, 17 Jun 2024 11:20:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"aY2BeDzr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718616011;\n\tbh=it8S1SvGV5SMQVjgD7CM1267FrMHq4WDfUbj307l09w=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=aY2BeDzrSXh6GHd+kqFlyDpSnaM+h7yq+NcXZg+CzSA/dGxetYXt9FrY4xCchvv5p\n\tD3sAJXkvrAudsZ4SH0yP6bEKqG9Y0UEA28rqPpyVX6u4MkA3E9Pf1rX0sQmfrPyJSb\n\tgxlTl/ho45hJvAnzcUb6/RSqVXi8B7mqLytS4sDg=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240616163910.5506-8-laurent.pinchart@ideasonboard.com>","References":"<20240616163910.5506-1-laurent.pinchart@ideasonboard.com>\n\t<20240616163910.5506-8-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 07/12] ipa: rkisp1: agc: Don't update histogram\n\tparameters unnecessarily","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 17 Jun 2024 10:20:24 +0100","Message-ID":"<171861602481.2248009.14706578220427107943@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29992,"web_url":"https://patchwork.libcamera.org/comment/29992/","msgid":"<ZnAiYIfQpfjI0evz@pyrite.rasen.tech>","date":"2024-06-17T11:47:44","subject":"Re: [PATCH 07/12] ipa: rkisp1: agc: Don't update histogram\n\tparameters unnecessarily","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Sun, Jun 16, 2024 at 07:39:05PM +0300, Laurent Pinchart wrote:\n> The ISP histogram parameters depends on the AE metering mode, but not on\n> the other AE algorithm controls. The exposure mode, constraints mode and\n> frame duration limits influence the behaviour of the algorithm, but not\n> the histogram computation parameters. Update the histogram parameters\n> only when AE metering mode changes.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 9 ++-------\n>  1 file changed, 2 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 9dac60bdb24e..9f3b59b45f95 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -261,26 +261,21 @@ void Agc::queueRequest(IPAContext &context,\n>  \tframeContext.agc.meteringMode = agc.meteringMode;\n>  \n>  \tconst auto &exposureMode = controls.get(controls::AeExposureMode);\n> -\tif (exposureMode) {\n> -\t\tframeContext.agc.update = agc.exposureMode != *exposureMode;\n\nI wonder if this should be renamed to updateMetering or something like\nthat? It's not a big deal at this point though I suppose.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> +\tif (exposureMode)\n>  \t\tagc.exposureMode =\n>  \t\t\tstatic_cast<controls::AeExposureModeEnum>(*exposureMode);\n> -\t}\n>  \tframeContext.agc.exposureMode = agc.exposureMode;\n>  \n>  \tconst auto &constraintMode = controls.get(controls::AeConstraintMode);\n> -\tif (constraintMode) {\n> -\t\tframeContext.agc.update = agc.constraintMode != *constraintMode;\n> +\tif (constraintMode)\n>  \t\tagc.constraintMode =\n>  \t\t\tstatic_cast<controls::AeConstraintModeEnum>(*constraintMode);\n> -\t}\n>  \tframeContext.agc.constraintMode = agc.constraintMode;\n>  \n>  \tconst auto &frameDurationLimits = controls.get(controls::FrameDurationLimits);\n>  \tif (frameDurationLimits) {\n>  \t\tutils::Duration maxShutterSpeed =\n>  \t\t\tstd::chrono::milliseconds((*frameDurationLimits).back());\n> -\t\tframeContext.agc.update = agc.maxShutterSpeed != maxShutterSpeed;\n>  \t\tagc.maxShutterSpeed = maxShutterSpeed;\n>  \t}\n>  \tframeContext.agc.maxShutterSpeed = agc.maxShutterSpeed;","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 A2843C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jun 2024 11:47:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A456861A1C;\n\tMon, 17 Jun 2024 13:47:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C1AEA61A1C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jun 2024 13:47:50 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DDBEC39F;\n\tMon, 17 Jun 2024 13:47:32 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uWmeaQGc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718624853;\n\tbh=ZDE0fTA4qnkpfyObUZHm4TyP0RwBtfTIBvibyAW/c8A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uWmeaQGcjg/UI8wUi7A14OAKZPbi+pkSN23TKaWvNOq/OGfFrQkbcyX4bmahci5CP\n\ttFbBBsafx9HUw1xoieWHf1yQVQDKwE8cvDtqCvuIrOk7Lsr7ABSchyX4b5ETIyfnnC\n\t4npARlSrvoesELvTUHv/i8oy5rqGalp+hnrKQGq8=","Date":"Mon, 17 Jun 2024 20:47:44 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 07/12] ipa: rkisp1: agc: Don't update histogram\n\tparameters unnecessarily","Message-ID":"<ZnAiYIfQpfjI0evz@pyrite.rasen.tech>","References":"<20240616163910.5506-1-laurent.pinchart@ideasonboard.com>\n\t<20240616163910.5506-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240616163910.5506-8-laurent.pinchart@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29995,"web_url":"https://patchwork.libcamera.org/comment/29995/","msgid":"<20240617120553.GK30324@pendragon.ideasonboard.com>","date":"2024-06-17T12:05:53","subject":"Re: [PATCH 07/12] ipa: rkisp1: agc: Don't update histogram\n\tparameters unnecessarily","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Jun 17, 2024 at 08:47:44PM +0900, Paul Elder wrote:\n> On Sun, Jun 16, 2024 at 07:39:05PM +0300, Laurent Pinchart wrote:\n> > The ISP histogram parameters depends on the AE metering mode, but not on\n> > the other AE algorithm controls. The exposure mode, constraints mode and\n> > frame duration limits influence the behaviour of the algorithm, but not\n> > the histogram computation parameters. Update the histogram parameters\n> > only when AE metering mode changes.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/ipa/rkisp1/algorithms/agc.cpp | 9 ++-------\n> >  1 file changed, 2 insertions(+), 7 deletions(-)\n> > \n> > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> > index 9dac60bdb24e..9f3b59b45f95 100644\n> > --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> > @@ -261,26 +261,21 @@ void Agc::queueRequest(IPAContext &context,\n> >  \tframeContext.agc.meteringMode = agc.meteringMode;\n> >  \n> >  \tconst auto &exposureMode = controls.get(controls::AeExposureMode);\n> > -\tif (exposureMode) {\n> > -\t\tframeContext.agc.update = agc.exposureMode != *exposureMode;\n> \n> I wonder if this should be renamed to updateMetering or something like\n> that? It's not a big deal at this point though I suppose.\n\nGood idea. I'll send a patch on top.\n\n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> > +\tif (exposureMode)\n> >  \t\tagc.exposureMode =\n> >  \t\t\tstatic_cast<controls::AeExposureModeEnum>(*exposureMode);\n> > -\t}\n> >  \tframeContext.agc.exposureMode = agc.exposureMode;\n> >  \n> >  \tconst auto &constraintMode = controls.get(controls::AeConstraintMode);\n> > -\tif (constraintMode) {\n> > -\t\tframeContext.agc.update = agc.constraintMode != *constraintMode;\n> > +\tif (constraintMode)\n> >  \t\tagc.constraintMode =\n> >  \t\t\tstatic_cast<controls::AeConstraintModeEnum>(*constraintMode);\n> > -\t}\n> >  \tframeContext.agc.constraintMode = agc.constraintMode;\n> >  \n> >  \tconst auto &frameDurationLimits = controls.get(controls::FrameDurationLimits);\n> >  \tif (frameDurationLimits) {\n> >  \t\tutils::Duration maxShutterSpeed =\n> >  \t\t\tstd::chrono::milliseconds((*frameDurationLimits).back());\n> > -\t\tframeContext.agc.update = agc.maxShutterSpeed != maxShutterSpeed;\n> >  \t\tagc.maxShutterSpeed = maxShutterSpeed;\n> >  \t}\n> >  \tframeContext.agc.maxShutterSpeed = agc.maxShutterSpeed;","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 E1712C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jun 2024 12:06:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B52A565491;\n\tMon, 17 Jun 2024 14:06:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9A53F65491\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jun 2024 14:06:15 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 750582D5;\n\tMon, 17 Jun 2024 14:05:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"oqPAeTEh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718625958;\n\tbh=yNNW1XlzgrqHewHsP5+6lZ+MhDE6gYsU4ANtcIa/JAQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=oqPAeTEhkFD8iWurfJG1wch0DVBxQl57FMQny3oUgRNsneF66JyxBOy1+cXhfgsQ7\n\tcB+dzUFr2xcH3EIFtMDo3u4fo46rM3oELnAD4yHTDjRyTStrAg/m6JQr90bV6tiD9V\n\t1XxsDhIGnkhiBm9/tMasebEMc9SAJm+/MukWwa9M=","Date":"Mon, 17 Jun 2024 15:05:53 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 07/12] ipa: rkisp1: agc: Don't update histogram\n\tparameters unnecessarily","Message-ID":"<20240617120553.GK30324@pendragon.ideasonboard.com>","References":"<20240616163910.5506-1-laurent.pinchart@ideasonboard.com>\n\t<20240616163910.5506-8-laurent.pinchart@ideasonboard.com>\n\t<ZnAiYIfQpfjI0evz@pyrite.rasen.tech>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<ZnAiYIfQpfjI0evz@pyrite.rasen.tech>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]