[{"id":28076,"web_url":"https://patchwork.libcamera.org/comment/28076/","msgid":"<CAEmqJPpMjNr1pQdN295hSOOOJdpruhdZLynENVLwtVt5mDCokg@mail.gmail.com>","date":"2023-11-10T11:04:15","subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: agc: Fix bug where AeLocked\n\twas never getting set","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nThank you for this fix.\n\nOn Fri, 10 Nov 2023 at 10:45, David Plowman via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> The recent change where time-filtering is done before sorting out the\n> digital gain means that the target exposure without digital gain is no\n> longer set, breaking the 'AeLocked' calculation.\n>\n> We can use the regular (full) target exposure instead.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Fixes: 84b6327789fc (\"ipa: rpi: agc: Filter exposures before dealing with digital gain\")\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.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 8d374b53..8116c6c1 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -977,7 +977,7 @@ void AgcChannel::divideUpExposure()\n>  void AgcChannel::writeAndFinish(Metadata *imageMetadata, bool desaturate)\n>  {\n>         status_.totalExposureValue = filtered_.totalExposure;\n> -       status_.targetExposureValue = desaturate ? 0s : target_.totalExposureNoDG;\n> +       status_.targetExposureValue = desaturate ? 0s : target_.totalExposure;\n>         status_.shutterTime = filtered_.shutter;\n>         status_.analogueGain = filtered_.analogueGain;\n>         /*\n> --\n> 2.39.2\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 7A440C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Nov 2023 11:04:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 21B9E629AF;\n\tFri, 10 Nov 2023 12:04:43 +0100 (CET)","from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com\n\t[IPv6:2607:f8b0:4864:20::b2c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 887C9629AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Nov 2023 12:04:41 +0100 (CET)","by mail-yb1-xb2c.google.com with SMTP id\n\t3f1490d57ef6-d9beb865a40so1999030276.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Nov 2023 03:04:41 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1699614283;\n\tbh=kn0LTAM2ywEGASZH0mGMQeIp+QiUOP5gW1M6ky2/r+k=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=de96JGCYeBe/rn1iqHC8ZqJWJseMR25I0R4eTpGFrRrQ8F32GH200xO8JdO5w6l/D\n\tJyr0IdMxnwoTq/9QQML/Ydq+a5ZWoPjc3O/3AAhFs2JhtHO0euhv6Sr/pZWwZ/t9U2\n\tdCcfXsu4XiRImWvNv+LnHfw87iCUuOQOpj9SWimTVDgOYKRYHcxrI7ODdpxvUnAbF2\n\t+0xmV8ToFa7no+WYMU5CH2ogWFgUoIzN2LmZC95vLlyAhqIQfKyFfcOuFuPacrTKEB\n\t5DJRZaOlrchAhv4Gtcy6syabBaHgey66U2VwMt9MHj0hu5p3aNkagNyPLhU11Nwp2k\n\t7u3GWbHoadUog==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1699614280; x=1700219080;\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=pDtj1zDohoLGToIIr/XdBPV5PGIyckZmh1kRqe5hLLk=;\n\tb=O/yNeVI/I/BEEI4AlpXD7KO0K0oe14TXUx19tnretelrvQuwAceCm2UnIzteu32cOQ\n\tXmDTgGPZAaG0xm/tGqNUDDWRN3Quqy2Ovl1hF0PQSYc/uQkgn1yG+W2AWGr87SE0bOvH\n\tmVGDoFlcDEhCYTukZdkPn+aCoVFkT9TwA32LOMudiAt+niW6n6x5/pQh4PSUiOwJ9QWU\n\tsNrZOkXImouo18vF9gBG48/YRd6v36Ru/n/bItfvZrMAyJknptxY5gveU5HIuRI0nF+h\n\ttNm8A147fN4U+xs+yzP8jYf+42LJ3KDdLOaxaNOr0JEaCteImx6y2w4PV4F7dm9fxmME\n\t5uDA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"O/yNeVI/\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1699614280; x=1700219080;\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=pDtj1zDohoLGToIIr/XdBPV5PGIyckZmh1kRqe5hLLk=;\n\tb=Q+nm3Rwyl0hLDifcQ+UNPjQ56opqbmIbsfirOczztGGfyr/YYV+laUoniL8EgyE4Z/\n\txF/WFvhzgbofG3w1IUkSX9NIP7D333KNeBEIt+i2SKrphfa+uyQoGx2vYZmdsjMI2Cc5\n\tjlK0ixs74BScprTSGEacuuWY5OOuEa4YZ4ctRCyvgb/H3Ol0gXHNLVeFZ1GoO5I0ktpW\n\tZ2lBbNmt1rXZvia4qwdvrL/dJJeQiDYPBTpX7D+7OFfMdFXxQFwAFVxQt29sLWiyN36z\n\tApOGo2JSIeXwEA3rOCZytDRJ8ltwYkbO3ympB/5/iaORrO/QKiioV3GJxNvqL8VL65a2\n\tt0XQ==","X-Gm-Message-State":"AOJu0YzitP1oRZMN/WF0NNSVe9aErHg9QBj21pGayxUh9VWxL0aa0gyn\n\t/8NG3iSOF4Zv7G/4IpdXCP1krD6ShAo1FK/AWCVpWRS8Q5vPeIwD51g=","X-Google-Smtp-Source":"AGHT+IHY5y2xZw6RsecicQd9IFmVjQ8fM7plcb8hHSfdz2tGR8c/Uvr7J/5oqjou70jUcc2It5Jn+6S8yxr5/mQCB7g=","X-Received":"by 2002:a25:34c7:0:b0:da0:cea9:2b3c with SMTP id\n\tb190-20020a2534c7000000b00da0cea92b3cmr7141518yba.59.1699614280404;\n\tFri, 10 Nov 2023 03:04:40 -0800 (PST)","MIME-Version":"1.0","References":"<20231110104520.384229-1-david.plowman@raspberrypi.com>","In-Reply-To":"<20231110104520.384229-1-david.plowman@raspberrypi.com>","Date":"Fri, 10 Nov 2023 11:04:15 +0000","Message-ID":"<CAEmqJPpMjNr1pQdN295hSOOOJdpruhdZLynENVLwtVt5mDCokg@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: agc: Fix bug where AeLocked\n\twas never getting set","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28085,"web_url":"https://patchwork.libcamera.org/comment/28085/","msgid":"<169986830593.1817078.16218517764847113620@ping.linuxembedded.co.uk>","date":"2023-11-13T09:38:25","subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: agc: Fix bug where AeLocked\n\twas never getting set","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting David Plowman via libcamera-devel (2023-11-10 10:45:20)\n> The recent change where time-filtering is done before sorting out the\n> digital gain means that the target exposure without digital gain is no\n> longer set, breaking the 'AeLocked' calculation.\n> \n> We can use the regular (full) target exposure instead.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Fixes: 84b6327789fc (\"ipa: rpi: agc: Filter exposures before dealing with digital gain\")\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 8d374b53..8116c6c1 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -977,7 +977,7 @@ void AgcChannel::divideUpExposure()\n>  void AgcChannel::writeAndFinish(Metadata *imageMetadata, bool desaturate)\n>  {\n>         status_.totalExposureValue = filtered_.totalExposure;\n> -       status_.targetExposureValue = desaturate ? 0s : target_.totalExposureNoDG;\n> +       status_.targetExposureValue = desaturate ? 0s : target_.totalExposure;\n\nIt's hard for me to follow this back at the moment, but\ntarget_.totalExposureNoDG is used during process() before we get to\nwriteAndFinish().\n\nAre there other places that need updating too? or are those ok as this\nis more of an ordering thing?\n\nAnyway, this fixes a reported bug so:\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>         status_.shutterTime = filtered_.shutter;\n>         status_.analogueGain = filtered_.analogueGain;\n>         /*\n> -- \n> 2.39.2\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 3EF5EBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Nov 2023 09:38:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7AD24629BC;\n\tMon, 13 Nov 2023 10:38:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 196DF61DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Nov 2023 10:38:29 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F20A029A;\n\tMon, 13 Nov 2023 10:38:03 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1699868312;\n\tbh=JJbgJYaGpUkLWTBJOyJeke8CDIlWyIuSTine/QU8Xcw=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=S6/bE1DHNK/GaqCV+M5nvAUx0MLe/Dc8IHGDWotAvlfpmDyd7tY8Dx5luUkvokIb0\n\tyBmBKUWEV8V0kB/L/IFv9TY5AEthFVRbqGvYT8fz/ObwuhIoXv6NiM8ZF4vidlyJJd\n\titPPHlY4R5lm/57jqxj3VcmLNauC9nc5IEd5cCenrhs7aS6qlAkcU+BbPGyfV+s2TR\n\trU4jUx4sfqnb7/rQp1v8GldPTYgzyyYFa99wndcKrjKsNjtLYsrx4Tj1Yzqy2sbzIt\n\t5AtCIgEgAWobg0P0DMjMOPznhOQBTipjs5dZMi5qVZ6r7oFqAhE04/4+ZwMJe9oMXH\n\tKKvMFdwTzmKEA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1699868284;\n\tbh=JJbgJYaGpUkLWTBJOyJeke8CDIlWyIuSTine/QU8Xcw=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=HN7LrCaxTndnI7TDTbYrLDTQNEWK5kROeW7F/rQ09tW7VmBj6Gjssw8A/BnuJ1HOZ\n\t6PrB5M++YYaEX9R8Kxxgex9No5pV9mDShYLL00zk104zzeJVx4SSkvEWTbmgp+dpRo\n\tjRYyXaeS7vB5EyJFbVIIEaUuXjUb+N+ejkFK7tMk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"HN7LrCax\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20231110104520.384229-1-david.plowman@raspberrypi.com>","References":"<20231110104520.384229-1-david.plowman@raspberrypi.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 13 Nov 2023 09:38:25 +0000","Message-ID":"<169986830593.1817078.16218517764847113620@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: agc: Fix bug where AeLocked\n\twas never getting set","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]