From patchwork Sat Aug 29 09:35:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28143 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 EB8D9C3341 for ; Sat, 29 Aug 2026 09:35:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C2CD1684AC; Sat, 29 Aug 2026 11:35:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h2plvhPh"; 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 91DD56807E for ; Sat, 29 Aug 2026 11:35:26 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-47fecbb7000so635612f8f.2 for ; Sat, 29 Aug 2026 02:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787996126; x=1788600926; 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=k0TmwgX0/x9DocLfuV4CXV5gCdBvsCWhlSJcriuvyfA=; b=h2plvhPhoxFD1wyrHkytaY1FSgNWczFriBY0MupYaFUfDEVMCWo6BrbU+++TbiJ05h ZLikmGPvLRyh0wb34J/pLoqL7nmOPEqR/Wac97xSzuYb4WHyxjmCm7dY6wuR2BQX4XPu 2AiK/rvWCTdJmw3FfP+siUfevOaYqumAqxDaSYWrIHmo9IrnKxJWhw9xacyD1ZY5+pGK 3WyjoqDw+HE5V4Xycu+WhT97YHGijYKhIxErunrnjhcVUGZaaqwZpcl07V/7zOOjQ4ib C8Jy98gwSwL3QQiah+NbaeDb5L9jxXChUWOqgXFn5xukSsBDsNgH1PIi1K3zgb1p4+r7 1dVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787996126; x=1788600926; 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=k0TmwgX0/x9DocLfuV4CXV5gCdBvsCWhlSJcriuvyfA=; b=tENMjbfrLypPkoMLPUZMKhwnaPRee5SgAdAedfyrsFWKDg2FXag13DmR4Vm3MIQSTJ 8MXxKvXSiZyk6MsrF/Mz6qxQuXwJnXXyrJ5Frh3TdOZpZ8IAqGVL2gygD0M2BeiHNqvK YJl6Y1L2ry1SpBPn/UFO/2Ecnsdnuu4eXgzApS+M6lxxVYBnCgOOqAYemUE8Ozc0Vrp9 rt14o1FVi6+xsy7tLwq4FTV08IV/2wUKJCW7U+Pe/CsqFE5Ld39j+SgowW6SfhW2gDmk +uqXvT0Yz1HyZQqlzO3CMHD0nJdnI7mS9MX3lElgSTjuFQUB/lNiwhzZW4rlfw6OLuXf 4wDg== X-Gm-Message-State: AFuF++lwHWL1TNYbI7zdpSjeJO46fCCqpu7Vu/l8zC4eeic0F9L9tSEI 2EL7sxQ82EfhqAGhoe6PWPhN+8tAAXMDHBSRb8Lt2KCcMPTqR+8dJ5kCX58ai7pG9LkD X-Gm-Gg: AR+sD12aVlD8LzOa8ZQDfWLFH0JIK1m27YgbXKeOgXLbVQ92zHy42Srm1jeOJWyBYCt H7jWeEsaJTPyQa6bqOkH6dukbuL/RUr1+9uOe0m4r8Hia2Gh5hv5Lfg2SftH4ENfHvr1lGEhZwg HJ7KNuhyh7Ov4Fv0E3FhL95s5X089+VjJlQd61m0YfA6iJhaTBHAh8YLSf+Zp4h5a2hbko1S8mK CwW1bZZDwn7xLiNID+g+vW7UXBF6ELQyIPlx1skOVHgEKi0lnlkEy2jH252PgmIzcLMgLUNKGrF +K0Ucjw4uTbvaQI17MHy6fXSB0tEIqF30BiocuZG4pQkajhKw5thM9IctDfNsNCJT1Oz0z3CrFC sEVGSRPW8e7a5n1/7ChkMIXoJQyCWDKv8CAEdmgjjQnhj/r58ip38sxhDqFE4k8M/G/xC0ll1TG Camh5DQWTE6INc08XLBIHs6ggpep5RfYAccyZMmw9wrVNrOIVC9m7g+ofjPd6O8iiSpLN2akU4z WaylMwccTWl X-Received: by 2002:a05:600c:c3cf:10b0:49b:8f18:714a with SMTP id 5b1f17b1804b1-49b91c47b76mr148631695e9.12.1787996125735; Sat, 29 Aug 2026 02:35:25 -0700 (PDT) Received: from surface.. ([217.61.227.23]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49b9617179asm51181995e9.2.2026.08.29.02.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2026 02:35:25 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Kieran Bingham , Milan Zamazal , Hans de Goede , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , "D . Manresa" Subject: [RFC PATCH v2 0/1] ipa: libipa: awb: Support modules calibrated with gains below 1.0 Date: Sat, 29 Aug 2026 11:35:22 +0200 Message-ID: <20260829093523.41754-1-dmanresa@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260828140629.128831-1-dmanresa@gmail.com> References: <20260828140629.128831-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" Hello, v2 of the AWB minimum-gain series, following Kieran's review of v1. This comes out of bringing the front camera of the Microsoft Surface Pro 7+ (an OV5693 behind an IPU6, driven by the simple pipeline and the software ISP) to match the colours the Windows 11 stack produces on the same hardware. The OEM calibration Microsoft ships in the public Surface driver package stores per-illuminant sensor white points, and the one for this module needs a red gain of 0.87 at 2592 K - below the 1.0 floor AwbAlgorithm applies. The patch makes the floor tunable through a new optional "gainMin" tuning file property, keeping the 1.0 default so no existing platform changes behaviour. Changes in v2: - Reworded the rationale for the 1.0 floor in the commit message and in both comments: it is a policy choice (attenuating a channel discards part of its dynamic range), not a hardware limitation, as Kieran pointed out. - Added to the commit message the raw evidence Kieran asked for: raw captures of this module under an incandescent lamp show the red channel at ~1.15x green on a white surface, matching the decoded OEM white point. Full numbers, per-channel histograms and the capture methodology are in the v1 thread and archived at: https://github.com/dmanresa-saes/surface-ipu6-cameras/tree/master/docs/measurements The question from the v1 cover letter stands: the alternative - trusting the platform gain range alone and dropping the floor - is simpler, and I would value the maintainers' view on which is preferred. The patch was developed with AI assistance (Claude) and verified on Surface Pro 7+ hardware against Windows 11 renditions of the same scenes. Thanks, D. Manresa D. Manresa (1): ipa: libipa: awb: Allow tuning files to lower the minimum gain src/ipa/libipa/awb.cpp | 5 +++++ src/ipa/libipa/awb.h | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) --- 2.43.0