{"id":24442,"url":"https://patchwork.libcamera.org/api/patches/24442/?format=json","web_url":"https://patchwork.libcamera.org/patch/24442/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250923190657.21453-4-hansg@kernel.org>","date":"2025-09-23T19:06:55","name":"[3/5] ipa: software_isp: AGC: Raise exposure or gain not both at the same time","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"1f3aab39be3c9ed8e010e20f3ea5fe88022d79de","submitter":{"id":239,"url":"https://patchwork.libcamera.org/api/people/239/?format=json","name":"Hans de Goede","email":"hansg@kernel.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/24442/mbox/","series":[{"id":5455,"url":"https://patchwork.libcamera.org/api/series/5455/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5455","date":"2025-09-23T19:06:52","name":"ipa: software_isp: AGC: Fox AGC oscillation bug","version":1,"mbox":"https://patchwork.libcamera.org/series/5455/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/24442/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/24442/checks/","tags":{},"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 DD37DC3331\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Sep 2025 19:07:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B27C6B605;\n\tTue, 23 Sep 2025 21:07:15 +0200 (CEST)","from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AB836B605\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Sep 2025 21:07:05 +0200 (CEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id BC7F744AF1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Sep 2025 19:07:04 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id DFCB4C4CEF5;\n\tTue, 23 Sep 2025 19:07:03 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=kernel.org header.i=@kernel.org\n\theader.b=\"QyzC8YBk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1758654424;\n\tbh=n3plQx2gSYRqny6mDLwVPPbY+ll2yb/yiokZsOGyqjU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=QyzC8YBkV3xxgbBYvJzGByh1pUGyPRxzHhkCTaMBRo0HaUt7wNMSgmds6H7nGqB7F\n\tZUMf6O9AKuCVbgWAWH2TuISCtBx5kAzLboIo5ZH6lJm8nrGj5po35Upl5a6uRuXIiG\n\tjbdY3xJ8bgtgYdOjIHFSsxPhePWV/N5xyTaTVU5sJXcmKjJL6pEcaUiw9HqPPEcTMZ\n\t1go2KjioSvIX00RXErE/RSUTlXXjmkJJWFOJX2q9ssXvdbMVlar6SoZcFemVUt1aGE\n\tnVgubdxpZ7CZwya3DNs10GCS6SSRWXpxxbm9lIyQkrBsb2NBo1wYOuX9F19qB0Pe39\n\tq4Vm0bxhutL3w==","From":"Hans de Goede <hansg@kernel.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"Hans de Goede <hansg@kernel.org>","Subject":"[PATCH 3/5] ipa: software_isp: AGC: Raise exposure or gain not both\n\tat the same time","Date":"Tue, 23 Sep 2025 21:06:55 +0200","Message-ID":"<20250923190657.21453-4-hansg@kernel.org>","X-Mailer":"git-send-email 2.51.0","In-Reply-To":"<20250923190657.21453-1-hansg@kernel.org>","References":"<20250923190657.21453-1-hansg@kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"Raise either exposure or gain; not both at the same time.\n\nBefore this change when the last exposure raise is done, hitting\nexposure-max, gain would be increased at the same time.\n\nSigned-off-by: Hans de Goede <hansg@kernel.org>\n---\n src/ipa/simple/algorithms/agc.cpp | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)","diff":"diff --git a/src/ipa/simple/algorithms/agc.cpp b/src/ipa/simple/algorithms/agc.cpp\nindex 94961f9fe..230616e62 100644\n--- a/src/ipa/simple/algorithms/agc.cpp\n+++ b/src/ipa/simple/algorithms/agc.cpp\n@@ -56,12 +56,13 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou\n \tdouble &again = frameContext.sensor.gain;\n \n \tif (exposureMSV < kExposureOptimal - kExposureSatisfactory) {\n-\t\tnext = exposure * kExpNumeratorUp / kExpDenominator;\n-\t\tif (next - exposure < 1)\n-\t\t\texposure += 1;\n-\t\telse\n-\t\t\texposure = next;\n-\t\tif (exposure >= context.configuration.agc.exposureMax) {\n+\t\tif (exposure < context.configuration.agc.exposureMax) {\n+\t\t\tnext = exposure * kExpNumeratorUp / kExpDenominator;\n+\t\t\tif (next - exposure < 1)\n+\t\t\t\texposure += 1;\n+\t\t\telse\n+\t\t\t\texposure = next;\n+\t\t} else {\n \t\t\tnext = again * kExpNumeratorUp / kExpDenominator;\n \t\t\tif (next - again < context.configuration.agc.againMinStep)\n \t\t\t\tagain += context.configuration.agc.againMinStep;\n","prefixes":["3/5"]}