From patchwork Mon Jan 5 08:11:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasiliy Doylov X-Patchwork-Id: 25620 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2604CBDCC0 for ; Mon, 5 Jan 2026 08:34:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5E8A061F9F; Mon, 5 Jan 2026 09:34:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=mainlining.org header.i=@mainlining.org header.b="SrMZMMiN"; dkim=permerror (0-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="PVqSXQx7"; dkim-atps=neutral Received: from mail.mainlining.org (mail.mainlining.org [5.75.144.95]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DFDBD61F84 for ; Mon, 5 Jan 2026 09:11:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; s=202507r; d=mainlining.org; c=relaxed/relaxed; h=To:Message-Id:Subject:Date:From; t=1767600673; bh=L+lKEHEW1bWryUTiuH2/d2U nUgaxKQe5BTZq+BH7dtY=; b=SrMZMMiNu1sOkBkXG7he1XtDeVvkiuiSMjo4v92vVeGucGoLnd scXKOEnyJPvv3nWMu6CzgiPH9GeJGXkOoVZotd11uWKLpG8Q/EQPLCqsyDsLmyVAjJ6L+8xHVJh nAnCVchHriblYJKCnj6l6mBjRgYwsYkrAnpemjkHOlKhAmhaQqXZtynuBbJ4ApN4W4bBWiDd/Wn cEqgonuGWXsI5idyMuIBHf09LLIA80AfKzTxJwWljvsFsDPQSIlAai4dUb+R15cug+FUUJqdLi+ oqK46La09cHrscq4fITG7Ixx6/zMwKD/z/QaNUMBBbhnJ9Y5bcVGKd4ym+t14oloBvQ==; DKIM-Signature: v=1; a=ed25519-sha256; s=202507e; d=mainlining.org; c=relaxed/relaxed; h=To:Message-Id:Subject:Date:From; t=1767600673; bh=L+lKEHEW1bWryUTiuH2/d2U nUgaxKQe5BTZq+BH7dtY=; b=PVqSXQx7B85aVN80gz1PcX6P8t4KVKzP24IQLTNnmK7US9Jq/7 2uB9ofMH0WVd6Hgi3ZIKKEpqQCY5IapxqhBw==; From: Vasiliy Doylov Date: Mon, 05 Jan 2026 11:11:12 +0300 Subject: [PATCH] ipa: simple: agc: prevent gain decrease deadloop MIME-Version: 1.0 Message-Id: <20260105-softisp-agc-v1-1-77626505853a@mainlining.org> X-B4-Tracking: v=1; b=H4sIAB9yW2kC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDQwNT3eL8tJLM4gLdxPRkXUOzFAPD5CTjlEQTSyWgjoKi1LTMCrBp0bG 1tQAAAAAAXQAAAA== X-Change-ID: 20260105-softisp-agc-16d01cb3da49 To: libcamera-devel@lists.libcamera.org Cc: Vasiliy Doylov X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1313; i=nekocwd@mainlining.org; h=from:subject:message-id; bh=qMmxblVcyMbnB9lQ1Iw4JK9meioBorpHjcBtaVPk9SI=; b=owGbwMvMwCXGd//xporA/cmMp9WSGDKjixTZjxSxPzt04qN1UtABJmeW7A0J3Yw1U35Ux4Qcy X7+6XdFRykLgxgXg6yYIst/w0VyB24oe9blpj6DmcPKBDKEgYtTACYy6SLD/xyxd6/Fi88f9kn0 j7KPaf/Vq7Nno5tw6EbLd9Ovqiq+/MXIcGHp5zD5i+znpi0Rds7hU/7Xuj8r3ameu6yFTSu+XVu NAwA= X-Developer-Key: i=nekocwd@mainlining.org; a=openpgp; fpr=FF31A21EC0D823497E6D65E60EDFE3B27851BF63 X-Mailman-Approved-At: Mon, 05 Jan 2026 09:34:17 +0100 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If camera sensor helper is not set, again10 will be 0. It will prevent exposure change, because again will be clamped to againMin and condition again > again10 will always be true. Exposure decrease change will never occur. Fixed by adding again > againMin check. Signed-off-by: Vasiliy Doylov --- src/ipa/simple/algorithms/agc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- base-commit: 2861817f09c96a0660b88783eff159631e42030f change-id: 20260105-softisp-agc-16d01cb3da49 Best regards, diff --git a/src/ipa/simple/algorithms/agc.cpp b/src/ipa/simple/algorithms/agc.cpp index 189de770..2972844b 100644 --- a/src/ipa/simple/algorithms/agc.cpp +++ b/src/ipa/simple/algorithms/agc.cpp @@ -71,7 +71,8 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou } if (exposureMSV > kExposureOptimal + kExposureSatisfactory) { - if (again > context.configuration.agc.again10) { + if (again > context.configuration.agc.again10 && + again > context.configuration.agc.againMin) { double next = again * kExpNumeratorDown / kExpDenominator; if (again - next < context.configuration.agc.againMinStep) again -= context.configuration.agc.againMinStep;