[{"id":22145,"web_url":"https://patchwork.libcamera.org/comment/22145/","msgid":"<YgJJKgrfZ5RL7zZ/@pendragon.ideasonboard.com>","date":"2022-02-08T10:42:50","subject":"Re: [libcamera-devel] [PATCH v2] ipa: raspberrypi: awb: Better\n\thandling of how we disable AWB","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nOn Tue, Feb 08, 2022 at 10:04:36AM +0000, David Plowman wrote:\n> We now handle disabling (\"pausing\") AWB in the same way as\n> AEC/AGC. Instead of letting the pause flag be set so that the code\n> never runs at all, we instead fix the manual settings to the current\n> values (but continue to be called).\n> \n> The algorithm does not restart any calculations in this state, but\n> continues to add AWB metadata to every frame. Therefore certain other\n> algorithms that want to know it (CCM and ALSC, for example) can still\n> find it.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/ipa/raspberrypi/controller/rpi/awb.cpp | 20 ++++++++++++++++++++\n>  src/ipa/raspberrypi/controller/rpi/awb.hpp |  4 ++++\n>  2 files changed, 24 insertions(+)\n> \n> diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n> index 5cfd33a3..d4c93447 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n> @@ -172,6 +172,26 @@ void Awb::Initialise()\n>  \tasync_results_ = sync_results_;\n>  }\n>  \n> +bool Awb::IsPaused() const\n> +{\n> +\treturn false;\n> +}\n> +\n> +void Awb::Pause()\n> +{\n> +\t// \"Pause\" by fixing everything to the most recent values.\n> +\tmanual_r_ = sync_results_.gain_r = prev_sync_results_.gain_r;\n> +\tmanual_b_ = sync_results_.gain_b = prev_sync_results_.gain_b;\n> +\tsync_results_.gain_g = prev_sync_results_.gain_g;\n> +\tsync_results_.temperature_K = prev_sync_results_.temperature_K;\n> +}\n> +\n> +void Awb::Resume()\n> +{\n> +\tmanual_r_ = 0.0;\n> +\tmanual_b_ = 0.0;\n> +}\n> +\n>  unsigned int Awb::GetConvergenceFrames() const\n>  {\n>  \t// If not in auto mode, there is no convergence\n> diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n> index 8af1f27c..ac3dca6f 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n> @@ -83,6 +83,10 @@ public:\n>  \tchar const *Name() const override;\n>  \tvoid Initialise() override;\n>  \tvoid Read(boost::property_tree::ptree const &params) override;\n> +\t// AWB handles \"pausing\" for itself.\n> +\tbool IsPaused() const override;\n> +\tvoid Pause() override;\n> +\tvoid Resume() override;\n>  \tunsigned int GetConvergenceFrames() const override;\n>  \tvoid SetMode(std::string const &name) override;\n>  \tvoid SetManualGains(double manual_r, double manual_b) override;","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 39104BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Feb 2022 10:42:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DEB5B610B6;\n\tTue,  8 Feb 2022 11:42:54 +0100 (CET)","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 8D1D2610B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Feb 2022 11:42:53 +0100 (CET)","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 2CCAE480;\n\tTue,  8 Feb 2022 11:42:53 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pLxPl6QJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1644316973;\n\tbh=7FhveCAbItZwTD1MTm8jUYChPThRQ8bz03hWJbou/LU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pLxPl6QJHcExbsmVlv/nZvoe4EcKn2I3xCqiZ895ktpGM7K44KnhtwEbJl2k5j0HP\n\tOVdlHNE7gdGow7JgBm7VULPWRvsBDgPxFqqSIfYpn91DG9+lM+mRW6mDK+G4scu05s\n\ti6e62qJTRir1Hc/oZo3cKPeB91+CV2rDZSFIRDeg=","Date":"Tue, 8 Feb 2022 12:42:50 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<YgJJKgrfZ5RL7zZ/@pendragon.ideasonboard.com>","References":"<20220208100436.2348-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220208100436.2348-1-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: raspberrypi: awb: Better\n\thandling of how we disable AWB","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]