From patchwork Thu May 22 13:03:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 23428 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 9465AC31E9 for ; Thu, 22 May 2025 13:03:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4BFAE68D96; Thu, 22 May 2025 15:03:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Oi9ZPbtQ"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3418A68D8B for ; Thu, 22 May 2025 15:03:22 +0200 (CEST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-442ed8a275fso100844215e9.2 for ; Thu, 22 May 2025 06:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747919001; x=1748523801; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mvWf9TYTseIK2W8er/I173KMk2B2g4Bs0XpPOL9Qw1E=; b=Oi9ZPbtQ41XjlM2FkT43t1PEm77V1ncnzhncziGvNbTSVnPSJqoG0gyWmckSbBo1Xw 1ZYdAjpZTfWoz9brnLBziKDSth0ms46WBXJrOjp3uDYS38ZLbU14ysTo6/SdSu3IA0Em s5n9NEmH8UC+rCN5vxZvgXfS/lhhVd84HKUo8O/GKYwTTfMoauC7EJi9km3idXQC18Tq 59YuWNo/QbMA41MfLqaJEZPPbfhQb0H9joZqGpwwWN2/GXnnGgfvHrWoZs30Bx9DzCmI ZaYRtbWTx1kzEKkX5Ir5Nc7sJVpThGeqIVwTSBio1nu/8ctodlv/tGb29fhehpmK8gND bd8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747919001; x=1748523801; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mvWf9TYTseIK2W8er/I173KMk2B2g4Bs0XpPOL9Qw1E=; b=OA5QcG+ubnLcc+YguXd2MjtptEADrTlZjMTZ4SpUvgroC+w3uxcS7fQT6+qjmDRyse g2yk+gic96N7Gm3xw0S7Wi3ES/L5WCExTB1ByM1eo5aFkYP5n2iTSVzOU7MnBg9nwJJx TljE6lht0ld12bmutVN2iVlo9V0CrT/GtAXCxwnS1f0s8dYsrO0pgfkSFP9F82W75LDR RKxug5648wmWRcUQrJfb0/6w3Ag+w3XyMKjM+mslSwN7U+E9o5WSDGWBK1fLTZo+nomf gPwsF3N1eKKH0t96I4FaFzAYbYgJ2XSrLz8NCT8V/4m5E4xntdgySZXNQzUPWvi24P/9 EzEQ== X-Gm-Message-State: AOJu0Ywep/YIL4okXXT3JCMy73S6t1Sr2a9gX3dVPK6Y16Xy6QVySNss 50DKHujB2fHQpC5smDpD5hcve6vcYguvFr1E9ak/W4QaSUIPwCSSOtmoDyVDlAcmyAarzB0R8Qk 3o/5yRFg= X-Gm-Gg: ASbGncsyLZHlXPjLTzooboNmwNwcqMzQr1PWoEMXBP0dC3owFnd386k8sbZ7GvjbeVQ QkCktvArxSuZ8yQ5kPf0LI3fiRDs4zXqvpT+5fIEP7EcnaeF7bDG9f/mt8a5+YatKq7LVh65rYK ssv2TEuhIlEVjjLgdJcmHdSoh4M9DG+xawNV945Sq9meT4c+s/LP4ubDaXamV1U7MaudBT0d+X1 hvX9xP8BI55PUFnXRqJlAADK4woZ4mGRlJLEJaI5ZY8es85sW4ne36iy0uKyYW7TiU/h8JrRyqy Kn+LxwQoQ491UImElWEj3lztb//B38iah1eYVaFk0XG6MAJWnSYt694azf1NNOhfhUjemVzBJxa dv0tjx03RZA== X-Google-Smtp-Source: AGHT+IEgMfK8icqCZ6K+5kBBA9INcvICL4kaskZ29GI698ojBp/HL12wTQSVzJHNUJif8B3DLs1mSg== X-Received: by 2002:a05:600c:c092:b0:440:66a4:8d1a with SMTP id 5b1f17b1804b1-442fd950b76mr207384695e9.7.1747919001089; Thu, 22 May 2025 06:03:21 -0700 (PDT) Received: from davidp-xps-13.pitowers.org ([2a00:1098:3142:1f:93e2:135d:3fc5:ed2d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-447f24b6471sm105414305e9.24.2025.05.22.06.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 06:03:20 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC Date: Thu, 22 May 2025 14:03:18 +0100 Message-Id: <20250522130318.35533-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.34.1 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" A simple typo crept in where the red gain had been re-typed rather than using the correct green gain. In particular, this was causing very dark images for sensors that use large red gains, such as the IMX477 outdoors. Fixes: 29892f1c56c6 ("ipa: libipa: colour: Use the RGB class to model RGB values") Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Naushir Patuck Tested-by: Naushir Patuck --- src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp index a5562760..b2999364 100644 --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp @@ -717,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb, /* Factor in the AWB correction if needed. */ if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) - sum *= RGB{ { awb.gainR, awb.gainR, awb.gainB } }; + sum *= RGB{ { awb.gainR, awb.gainG, awb.gainB } }; double ySum = ipa::rec601LuminanceFromRGB(sum);