From patchwork Fri Sep 19 09:40:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24416 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 2081CC3329 for ; Fri, 19 Sep 2025 09:41:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9C18E6B5B2; Fri, 19 Sep 2025 11:41:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="d4zf0GPT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B38A6B5A5 for ; Fri, 19 Sep 2025 11:41:14 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:4d54:eab8:98ca:163b]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id CBB7999F; Fri, 19 Sep 2025 11:39:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1758274793; bh=GT3SNiwf5b0a23Lu4SX6u1wUMPaGCvMLW+NqlVuAkrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d4zf0GPT874mgHhAo2jgA1PXoUxEEUDGkIRI81XGc3fP6LhRaZXN6YetvvFz+YfdA Hsl0Y0sty2iWrjz7aDUEnpBppNaWUc4R55VIKBtD5/RvokqqUkrfxBHuZR58VdhRsZ k6Is/wnQQkdsKIYJQ3WAxzzCW0ffCmpBD4nbchW0= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Daniel Scally , Kieran Bingham , Paul Elder Subject: [PATCH v5 07/19] libipa: agc_mean_luminance: Fix constraint logging Date: Fri, 19 Sep 2025 11:40:22 +0200 Message-ID: <20250919094041.183031-8-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250919094041.183031-1-stefan.klug@ideasonboard.com> References: <20250919094041.183031-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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" The debug log statements in constraintClampGain() are after the assignment of gain. So they correctly log when the constraint applies, but the gain values logged are the same. Fix that. Fixes: 42e18c96bcb7 ("libipa: agc_mean_luminance: Add debug logging") Signed-off-by: Stefan Klug Reviewed-by: Daniel Scally Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- Changes in v4: - Collected tags Changes in v3: - Added this patch --- src/ipa/libipa/agc_mean_luminance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp index ff96a381ffce..fce1a5064870 100644 --- a/src/ipa/libipa/agc_mean_luminance.cpp +++ b/src/ipa/libipa/agc_mean_luminance.cpp @@ -488,18 +488,18 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex, if (constraint.bound == AgcConstraint::Bound::Lower && newGain > gain) { - gain = newGain; LOG(AgcMeanLuminance, Debug) << "Apply lower bound: " << gain << " to " << newGain; + gain = newGain; } if (constraint.bound == AgcConstraint::Bound::Upper && newGain < gain) { - gain = newGain; LOG(AgcMeanLuminance, Debug) << "Apply upper bound: " << gain << " to " << newGain; + gain = newGain; } }