[{"id":34326,"web_url":"https://patchwork.libcamera.org/comment/34326/","msgid":"<20250522132258.GQ12514@pendragon.ideasonboard.com>","date":"2025-05-22T13:22:58","subject":"Re: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nOn Thu, May 22, 2025 at 02:03:18PM +0100, David Plowman wrote:\n> A simple typo crept in where the red gain had been re-typed rather\n> than using the correct green gain. In particular, this was causing\n> very dark images for sensors that use large red gains, such as the\n> IMX477 outdoors.\n> \n> Fixes: 29892f1c56c6 (\"ipa: libipa: colour: Use the RGB class to model RGB values\")\n\nOops :-S Sorry about that.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index a5562760..b2999364 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -717,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,\n>  \n>  \t/* Factor in the AWB correction if needed. */\n>  \tif (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb)\n> -\t\tsum *= RGB<double>{ { awb.gainR, awb.gainR, awb.gainB } };\n> +\t\tsum *= RGB<double>{ { awb.gainR, awb.gainG, awb.gainB } };\n>  \n>  \tdouble ySum = ipa::rec601LuminanceFromRGB(sum);\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 65265BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 May 2025 13:23:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1466868D95;\n\tThu, 22 May 2025 15:23:08 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BAB2A68D8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 May 2025 15:23:05 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(179.218-130-109.adsl-dyn.isp.belgacom.be [109.130.218.179])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AD9EC9E5;\n\tThu, 22 May 2025 15:22:43 +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=\"gocLOu1+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747920163;\n\tbh=jz9MRsq+Sues/NAUfsqVffwEg8Ol0NeHhekAf0Quyy0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gocLOu1+2ezQd8/YKdRnWF/EZDuXwWhIsrxIIRRu0dMFVd9vNale4R6cqVzbeOXl0\n\tLBoGNNA+mqRka1DRtnrMoV3pxZ44CydH6qzFi7DkvvhuUekwbERHTmUZQf4Eh8kFuG\n\thcrw+ibA3R1OTTSBLdcMOcgA3A3Zht0nbXmtSu8k=","Date":"Thu, 22 May 2025 15:22:58 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC","Message-ID":"<20250522132258.GQ12514@pendragon.ideasonboard.com>","References":"<20250522130318.35533-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250522130318.35533-1-david.plowman@raspberrypi.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":34327,"web_url":"https://patchwork.libcamera.org/comment/34327/","msgid":"<CAEmqJPp6acdyN+PabUk1o4vMSGALOTmva+m4V-zfR=rLET7efg@mail.gmail.com>","date":"2025-05-22T13:25:58","subject":"Re: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\n\nOn Thu, 22 May 2025 at 14:03, David Plowman <david.plowman@raspberrypi.com>\nwrote:\n\n> A simple typo crept in where the red gain had been re-typed rather\n> than using the correct green gain. In particular, this was causing\n> very dark images for sensors that use large red gains, such as the\n> IMX477 outdoors.\n>\n> Fixes: 29892f1c56c6 (\"ipa: libipa: colour: Use the RGB class to model RGB\n> values\")\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n> ---\n>  src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index a5562760..b2999364 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -717,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats,\n> AwbStatus const &awb,\n>\n>         /* Factor in the AWB correction if needed. */\n>         if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb)\n> -               sum *= RGB<double>{ { awb.gainR, awb.gainR, awb.gainB } };\n> +               sum *= RGB<double>{ { awb.gainR, awb.gainG, awb.gainB } };\n>\n>         double ySum = ipa::rec601LuminanceFromRGB(sum);\n>\n> --\n> 2.34.1\n>\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 EC09ABD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 May 2025 13:26:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 31AF968D9A;\n\tThu, 22 May 2025 15:26:38 +0200 (CEST)","from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com\n\t[IPv6:2607:f8b0:4864:20::a36])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D9E8D68D8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 May 2025 15:26:36 +0200 (CEST)","by mail-vk1-xa36.google.com with SMTP id\n\t71dfb90a1353d-52dc41851e2so313159e0c.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 May 2025 06:26:36 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"PcE9RtB1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1747920396; x=1748525196;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=sYrYbhCD4IUrx0vgrAzB68ry2T1eSo42077BCBKFUM4=;\n\tb=PcE9RtB13H0YlORrG0VLz1E+afb6Fq1Ac6S8LFWJDpZOBe8wXOkcex6JxDL8BHCizN\n\tERHGwp9mAFivHlnYZAnaaux18174iCpv7d0fqWMGx/GKeD8RIFzuhlDnkL5q/NRT56qj\n\tqydGKEIK4q6jQGNkHWhuIcVTxwLSMB38SdwyLb8gCoVR7j/D29wxVto6taTMxjNeeYl5\n\tzTs8AeQFhtT++SRo3FriHVZzRRLJgKC4uNuW+nsEeDD8l/ryD3VSQ0iQLYFGDBLiBoB3\n\tq1i3uWHoPsXuWxryf98Q/jny9f+RKcXZrSLkNP5o8fjdRGUVrgByUqxfkvnrs9G9G0Lj\n\tACng==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1747920396; x=1748525196;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=sYrYbhCD4IUrx0vgrAzB68ry2T1eSo42077BCBKFUM4=;\n\tb=YFSB6U9ETsHLBfNEJ8ZSrBgvwLjzg6ointsFfmIo2DrsIapZ+/7ywsJl+rKZzxzZJk\n\t6QgHD2C7JhcyE8j+gjzIQafobe1lZXMWJYw/FtyNrrcnjln8vjNk98rVgVwDwyXdvlM2\n\tCZLh9jvqjTPVl3Pt/9/E37T083cPIJjqXoKlAagNnzDE1uFyx12W+Mr99m+nXSfDI4uA\n\t9lrK0Ym2zbekJcCjAHAZbwYoN3pypdpp4sIoT+bRewVUlZOjmOyY0rMHjOJwaVbjlv7h\n\ti/gFCHjQbOU5oDBJ5EJNLfNz/x3IMO8rBq3ws1s/95+veow26A556zPnJn3x/4M9b3/n\n\tCzNg==","X-Gm-Message-State":"AOJu0YxM9EIOwCqyVLyB3eNsc+NPJt02CqkD9Z2l1WFTWpd+Qw4zHLM/\n\tFeXaUdR0MXbDCJ4qFOEQuoEmYSiBAU4PhqnrAGa+GmgYAtdNm3tpRievx89bLEceAOV7hwDJLH2\n\tzqDQa3Qx0+Q13p0cnOSVRfuUfGl3dydVWQmXADpezvFA5KUkISLdhIhk=","X-Gm-Gg":"ASbGncsTT2KvA9O/8ssjz9QBTFFvhry19C+vUMuGX+9amfp131LPMUeFFKEFuRNuBF/\n\tt+6BZcTV3hKkniQsZ+YQ+ztJR7/kDPPttdjGaG+FEuKr7xbsotg/Rb6JWTjurAIbpwSs1yr6u0h\n\t4iXSgUK4gEgxsBC10L+TUDdszJe6vgpx4vpJrL8EC/kk9iBPtWM4Jbk4+gVLmui/MF","X-Google-Smtp-Source":"AGHT+IF/ZMEW/Ux8dCCOP5AsHdU8x9V5ObcXtqraAoctQ1jQBNdb2Udi/Jy47IsgBNtMZ/vVf0pYK9Xm4GfIWN7QdfM=","X-Received":"by 2002:ac5:c9ba:0:b0:528:aa60:1c2b with SMTP id\n\t71dfb90a1353d-52dba8d09d1mr5912735e0c.2.1747920395716;\n\tThu, 22 May 2025 06:26:35 -0700 (PDT)","MIME-Version":"1.0","References":"<20250522130318.35533-1-david.plowman@raspberrypi.com>","In-Reply-To":"<20250522130318.35533-1-david.plowman@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Thu, 22 May 2025 14:25:58 +0100","X-Gm-Features":"AX0GCFvDQlqahLS_dmcf8Mq52i6bbZ8BN9V5S4uOXDRw5l_WF0OlvH_vlnyQZdw","Message-ID":"<CAEmqJPp6acdyN+PabUk1o4vMSGALOTmva+m4V-zfR=rLET7efg@mail.gmail.com>","Subject":"Re: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC","To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"multipart/alternative; boundary=\"0000000000004863350635b96e0a\"","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":34343,"web_url":"https://patchwork.libcamera.org/comment/34343/","msgid":"<174795988601.778642.1494938039957435718@calcite>","date":"2025-05-23T00:24:46","subject":"Re: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting David Plowman (2025-05-22 22:03:18)\n> A simple typo crept in where the red gain had been re-typed rather\n> than using the correct green gain. In particular, this was causing\n> very dark images for sensors that use large red gains, such as the\n> IMX477 outdoors.\n> \n> Fixes: 29892f1c56c6 (\"ipa: libipa: colour: Use the RGB class to model RGB values\")\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index a5562760..b2999364 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -717,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,\n>  \n>         /* Factor in the AWB correction if needed. */\n>         if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb)\n> -               sum *= RGB<double>{ { awb.gainR, awb.gainR, awb.gainB } };\n> +               sum *= RGB<double>{ { awb.gainR, awb.gainG, awb.gainB } };\n>  \n>         double ySum = ipa::rec601LuminanceFromRGB(sum);\n>  \n> -- \n> 2.34.1\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 C115CBD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 May 2025 00:24:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A37968D92;\n\tFri, 23 May 2025 02:24:55 +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 BAC8D61679\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 May 2025 02:24:53 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2001:268:9879:bbe3:bc1e:1c74:c373:b287])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FC936BE;\n\tFri, 23 May 2025 02:24:29 +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=\"KhBX/mwx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747959871;\n\tbh=eq9cI5UgYh//dOnFlZeBS6U0rTpKJAHz4q0Ti5CTYFk=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=KhBX/mwxm/kXvO4l/BxoY35zJ0elX3ewt8M2SQrH4M42OwocNK23kb5fWr8qrGsV2\n\tgFAs2f9QFpvyW1VY7szMDMwxRz3nNAv3ssKuUKIlXyYb/qkoGSGvJbMr8iApiNOLPS\n\tRAHk6v7WmkAdrBPiXbSYQj7pjsjensq4L7K5tGxU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250522130318.35533-1-david.plowman@raspberrypi.com>","References":"<20250522130318.35533-1-david.plowman@raspberrypi.com>","Subject":"Re: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"David Plowman <david.plowman@raspberrypi.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 23 May 2025 09:24:46 +0900","Message-ID":"<174795988601.778642.1494938039957435718@calcite>","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>"}}]