From patchwork Fri Sep 4 06:28:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28190 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 0FD34C3257 for ; Fri, 4 Sep 2026 06:28:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6774D685FC; Fri, 4 Sep 2026 08:28:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cf1PAdMV"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 774DC683E4 for ; Fri, 4 Sep 2026 08:28:39 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-482dbe4d247so332129f8f.2 for ; Thu, 03 Sep 2026 23:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788503319; x=1789108119; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Rg4JMzp0rRen5Ckv65Vpc9TlQI1+yzIsrgxNF9kuQv0=; b=Cf1PAdMVpcz7BdOqSclQ6V/VGdB6RkJ4ldoqHNUX2R2rtb7I8KmQvsfks7D5QYdJTY fTI8uPtQiD1/LyzDkabg4JWrW4r3yi/gcpR9IsY1quZvDU8V4J4RnBighwW2mfU6/hlr Nbu+RXa6BTupXPRwzhAc6FgfI8BfuWnZPwYmXUb8qyuyxGCEY+WDg2XzDo0r7VrmDjLk DQsvBPLDkhsjhTOnBhFqUNimklM+3gELaeyXzey/uLUeGAWSEMf8PXClSvr7ier5pKmN B+Z12eloB8uGik/5YEmhxeHJnD86rplVZYO+x7coBQm6YfPiEV+QI+PH06Xpxc1cc3N1 0cFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788503319; x=1789108119; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Rg4JMzp0rRen5Ckv65Vpc9TlQI1+yzIsrgxNF9kuQv0=; b=jSzbOYS8KrIoPSYS11VfgyjOWyEq8XPux1HzDObU4HbLzI8+8yMG89gt6MyxJBE3MO jCrIXwSWBpBAPariASbfHs/5dwMRwnD1MLwR8K5dQB/PsjAD5p3SpSOQSH0qaiRRSHub XdexzeTDUC41qT6IqykSQh5Yj/l2pbaKiqC1weXiPIRAG36VInSkFHqppmrg/vhHeRMo RI7+GNQT+OoYeU0SZE//l0cRzqWs5sRCNjgXwdnJbA2blPYJnu13V3aCapylQlwPnVj6 tCbjQcdM9YuBlruG6E3BXyE4Tg1Vkg9lenaAGi7S30AKPAFJ4mFD9XrxFg6yhfHlN/vu a2Xg== X-Gm-Message-State: AFuF++n4C19chCBpmPl6lX1HCynL8c7XbsFWx9VF+CT3KCTUIuPcBKGu Th6K58ZQPlxfiaJ0D/ax0MnZI/KtuZBC+j8qtCtLsMdkyG71PRu0NF7JCF5O1bpJxQ== X-Gm-Gg: AYBFou2ivHAN7sBlaxmiacIB/+4nyys1JaoONjQDwyRoMPhWmn6xmQfhKa/0OPEshgN 73mF/tmcSEBdZMcPO21r2pcwOe2/ZnCwpBeKfaUKfwGa+BdArNBFjWYUIUWunAmA6t+L48Rdgur rbq5lMRC942yFiF/VK4OJd3CTuJljmOK7kHqD6NwkiX5jqrvxkumrvmEskzqgUvQ4W5duaY5hMJ 74kD05TC28BbPWngIq9mRBeGI5vuCP+kwWF8V6iHbOOJufMlWga8BfVzry0NKxxgF2cSgfVYk9J Noeiq7uwq1ePtPU8mSfkpDYO0YoHjwUOI14gGIkIR1R+Oe9m4zgI0igeWPQwYhrj1fClUsPc/CT BIUjnAzSTM6rax8bYbbOoUf+f+OAB2OA05fHWDxSNTIfMCVNLweaImd0TLSO2JY/WbV4Ias33jM hIWzJPims4s24uDlM0kkn20wgWUYVi+P2FwGKluerQv5JYKdH2/MmkUx8vwI+0MKlCmnYgtY6J2 zou74U7Pwyuskhhyse2ZICM+nGvNvu9KtoFuQupOqDoN1TI X-Received: by 2002:a05:600c:6306:b0:49c:f5c0:aa76 with SMTP id 5b1f17b1804b1-49cf81e366amr68425315e9.5.1788503318828; Thu, 03 Sep 2026 23:28:38 -0700 (PDT) Received: from latitude7275 (84.124.213.91.dyn.user.ono.com. [84.124.213.91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cee5f9114sm125681225e9.5.2026.09.03.23.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2026 23:28:38 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: "D. Manresa" Subject: [PATCH 1/3] ipa: ipu3: agc: Fix swapped green and blue gains in luminance estimate Date: Fri, 4 Sep 2026 08:28:38 +0200 Message-ID: <20260904062840.46739-2-dmanresa@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904062840.46739-1-dmanresa@gmail.com> References: <20260904062840.46739-1-dmanresa@gmail.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 AWB gains passed to the AGC traits are built as { red, blue, green }, but the RGB vector expects { red, green, blue }. The luminance estimate therefore weights the blue statistics with the green gain and the green statistics with the blue gain, which biases the exposure whenever the two gains differ (on an OV5670 they are 1.0 and ~1.8). Pass the gains in RGB order. Signed-off-by: D. Manresa Reviewed-by: Daniel Scally --- src/ipa/ipu3/algorithms/agc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 57cfb32..dd4f1ab 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -224,8 +224,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, rgbTriples_, {{ context.activeState.awb.gains.red, - context.activeState.awb.gains.blue, context.activeState.awb.gains.green, + context.activeState.awb.gains.blue, }}, bdsGrid_, },