[{"id":22278,"web_url":"https://patchwork.libcamera.org/comment/22278/","msgid":"<ea2b0d70-65ec-5cfb-2b33-c94091e1590f@ideasonboard.com>","date":"2022-03-15T13:39:03","subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Use existing\n\tlocal short-hand variable in configure()","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Laurent,\n\nOn 15/03/2022 14:34, Laurent Pinchart via libcamera-devel wrote:\n> The configure() function has a local configuration variable referencing\n> context.configuration for the purpose of shortening lines. Use it\n> instead of context.configuration in the remaining locations, and\n> constify it while at it as the configuration isn't meant to be modified.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks, it is indeed shorter and cleaner now :-).\n\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\n> ---\n>   src/ipa/ipu3/algorithms/agc.cpp | 10 +++++-----\n>   1 file changed, 5 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 70cff3fed43c..7d4b3503f390 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -86,17 +86,17 @@ Agc::Agc()\n>   int Agc::configure(IPAContext &context,\n>   \t\t   [[maybe_unused]] const IPAConfigInfo &configInfo)\n>   {\n> -\tIPASessionConfiguration &configuration = context.configuration;\n> +\tconst IPASessionConfiguration &configuration = context.configuration;\n>   \tIPAFrameContext &frameContext = context.frameContext;\n>   \n>   \tstride_ = configuration.grid.stride;\n>   \n> -\tminShutterSpeed_ = context.configuration.agc.minShutterSpeed;\n> -\tmaxShutterSpeed_ = std::min(context.configuration.agc.maxShutterSpeed,\n> +\tminShutterSpeed_ = configuration.agc.minShutterSpeed;\n> +\tmaxShutterSpeed_ = std::min(configuration.agc.maxShutterSpeed,\n>   \t\t\t\t    kMaxShutterSpeed);\n>   \n> -\tminAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n> -\tmaxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);\n> +\tminAnalogueGain_ = std::max(configuration.agc.minAnalogueGain, kMinAnalogueGain);\n> +\tmaxAnalogueGain_ = std::min(configuration.agc.maxAnalogueGain, kMaxAnalogueGain);\n>   \n>   \t/* Configure the default exposure and gain. */\n>   \tframeContext.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain);","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 84532BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 15 Mar 2022 13:39:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 45F8B610F8;\n\tTue, 15 Mar 2022 14:39:07 +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 405A7604DA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Mar 2022 14:39:06 +0100 (CET)","from [IPV6:2a01:e0a:169:7140:e38:1788:50cc:d433] (unknown\n\t[IPv6:2a01:e0a:169:7140:e38:1788:50cc:d433])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 07DB21BBB;\n\tTue, 15 Mar 2022 14:39:06 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647351547;\n\tbh=8ZCLSd20nK+jP0ZGy+C4fsIFKYaW1pbqSNiBpTT2aBI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Mtm1kRF4AAzRlc90nm8Tnxbjdqg0Zn69Duf/GE+C+OAZ1/YaF9JLU0Gp+wUiyAZlr\n\tbCfaWTxxKHHG19f9V1n0ydYwa/BCECjYOM9YBvcfVSk+sDTlvO4BmSYMKP7VHH+nX3\n\tE/iJzoXa3m76buR8I7iLsTSA7Ib6q+bQyOAKf/AfCmr7WCPYCyO/c2RYfE77G24Rbk\n\tkF2PonJZiq6vgnTGeJFDTuv5Na6KZBseYlJiOjwMBlzNt0VlbCl4uZLHfLRWKG1aj7\n\tqh2lNzBF2oTRakW02ryl2ihpmajKWKOk7cMvHmsNRST2qaJX6hQ1O4GmG36STFGP+V\n\tQKGAXCJK4sXKg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1647351546;\n\tbh=8ZCLSd20nK+jP0ZGy+C4fsIFKYaW1pbqSNiBpTT2aBI=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=bU26jHXIa2FMwRK7pZU581GArMbjF+WsK/BTa7SkWW6El3zGOFwjRn3IludFnfgw8\n\tF2wCLcoCyZ74ABQp+OK4KAF9UfF34o+AyCAGht9Najru8aDdPOxSkFurYcmohB0VKN\n\tEMyA7ZYOF0y7ED6A6Jc2DZrqIrUO/wOIz9TIapSg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"bU26jHXI\"; dkim-atps=neutral","Message-ID":"<ea2b0d70-65ec-5cfb-2b33-c94091e1590f@ideasonboard.com>","Date":"Tue, 15 Mar 2022 14:39:03 +0100","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.5.0","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220315133407.32348-1-laurent.pinchart@ideasonboard.com>\n\t<20220315133407.32348-2-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220315133407.32348-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Use existing\n\tlocal short-hand variable in configure()","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>","From":"Jean-Michel Hautbois via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22280,"web_url":"https://patchwork.libcamera.org/comment/22280/","msgid":"<4d0ca0b7-14a5-e557-6548-775121f3fd03@ideasonboard.com>","date":"2022-03-15T13:53:21","subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Use existing\n\tlocal short-hand variable in configure()","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Laurent,\n\nOn 3/15/22 19:04, Laurent Pinchart via libcamera-devel wrote:\n> The configure() function has a local configuration variable referencing\n> context.configuration for the purpose of shortening lines. Use it\n> instead of context.configuration in the remaining locations, and\n> constify it while at it as the configuration isn't meant to be modified.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/ipa/ipu3/algorithms/agc.cpp | 10 +++++-----\n>   1 file changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 70cff3fed43c..7d4b3503f390 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -86,17 +86,17 @@ Agc::Agc()\n>   int Agc::configure(IPAContext &context,\n>   \t\t   [[maybe_unused]] const IPAConfigInfo &configInfo)\n>   {\n> -\tIPASessionConfiguration &configuration = context.configuration;\n> +\tconst IPASessionConfiguration &configuration = context.configuration;\n>   \tIPAFrameContext &frameContext = context.frameContext;\n>   \n>   \tstride_ = configuration.grid.stride;\n>   \n> -\tminShutterSpeed_ = context.configuration.agc.minShutterSpeed;\n> -\tmaxShutterSpeed_ = std::min(context.configuration.agc.maxShutterSpeed,\n> +\tminShutterSpeed_ = configuration.agc.minShutterSpeed;\n> +\tmaxShutterSpeed_ = std::min(configuration.agc.maxShutterSpeed,\n>   \t\t\t\t    kMaxShutterSpeed);\n>   \n> -\tminAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n> -\tmaxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);\n> +\tminAnalogueGain_ = std::max(configuration.agc.minAnalogueGain, kMinAnalogueGain);\n> +\tmaxAnalogueGain_ = std::min(configuration.agc.maxAnalogueGain, kMaxAnalogueGain);\n>   \n>   \t/* Configure the default exposure and gain. */\n>   \tframeContext.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain);","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 68CADBDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 15 Mar 2022 13:53:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 243F9604DC;\n\tTue, 15 Mar 2022 14:53:30 +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 A516C604DA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Mar 2022 14:53:28 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.183])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 596081BBB;\n\tTue, 15 Mar 2022 14:53:27 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647352410;\n\tbh=d5Gk+uQqsPDKzwsOsZPGzWRatqlHRVf17TzrMDN6kaI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=1mB0fCtlAMe5Aolk6ipu7x8KDbcXcvXdHAUzrrq2MIIVnhrOCi92AL8r5mcQk2t4J\n\txA49emSWKEGCpSPyG6TNXbomBFI9JNu3ijqOkopJWkd+vK6DTpO4l7V3DuzMxpQTsR\n\tbPfi1LI/zlf9Ki2K8pur7uktT0awVUW8BNk4Vq/V10amqcjUhVSKUoMQKT3ZfIOhl9\n\tXoOmT1QsDIyRZGqThlsRT8qJCflXAFPs0h79LzBsgZFczGq+pzC2veVbm7O3LGWH4I\n\tjASiUOAWSIjcfN2S02vcURMjCA4ioeygCuKxeRvxtvsgN3AGMv1QHIN7HTnlSXk3iq\n\t635EUY6PD+gFA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1647352408;\n\tbh=d5Gk+uQqsPDKzwsOsZPGzWRatqlHRVf17TzrMDN6kaI=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=DZw7hU6EKjaRmsCATW/T3IQwZuw4zTDuZQappx5ENaf2O/94E63SKKRf0Cq+/BhAk\n\t3CfO+3vm5YiXMQ/pnheqD1/CPbC+2QNgUE8LRlLLZnAP3nvYBLIfgjJVdkqkq/5eUc\n\t03x5Fos94tYuXMdQDLay3bh7RyJEGQEIqDZZAVlc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DZw7hU6E\"; dkim-atps=neutral","Message-ID":"<4d0ca0b7-14a5-e557-6548-775121f3fd03@ideasonboard.com>","Date":"Tue, 15 Mar 2022 19:23:21 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220315133407.32348-1-laurent.pinchart@ideasonboard.com>\n\t<20220315133407.32348-2-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220315133407.32348-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Use existing\n\tlocal short-hand variable in configure()","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]