From patchwork Tue Sep 8 16:37:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28208 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 C5443BD160 for ; Tue, 8 Sep 2026 16:37:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8DA636862F; Tue, 8 Sep 2026 18:37:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EEhD0eEn"; 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 E1D2168244 for ; Tue, 8 Sep 2026 18:37:02 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-48431648f33so3829441f8f.0 for ; Tue, 08 Sep 2026 09:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788885422; x=1789490222; 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=Qj8XAhME9m+ATm6vWW+McKwkSBMH7ymOXTfy49fWyQg=; b=EEhD0eEnTKmu0paSEfoqu3q6ZKcJg6GlYcE9DtbdPbaD0m4Um0gEaUrpOnixp4q3sD +YSGvSwAGtvX/h1VKH7ZbojTIZqEU3lc83zsqtDx0ByctHVRc5w9+zQRuSb3vog8iWrH vR4breZ219EBry8dqWxC6/VdIWZ+iNHi0LoI3KFvoSOVHUHWRIw0pc1uv0tU59a28GVM 8nsizI6sidkenweAsluq16nXS3fjRrgF6W0YVzU4RAMIiysqlOe27r1I8jk/hcWvcZQx K21oSzhxaWxLuFYHywpy53Vl+ZVTXx8+iXmSask5LNnf8t2N5SbAK2H2cZS/tnuErCHn 9/mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788885422; x=1789490222; 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=Qj8XAhME9m+ATm6vWW+McKwkSBMH7ymOXTfy49fWyQg=; b=Y7q9KUrjaNFA3Yex5xj8vS3pFeYOTve3yokEKWRdyLxKz+BPxrKXEjP+tHi0pl9+1q JA/R0nn3Anpim/H4pJz1r0pg9REyT8+dXobiH8V93KolUzUyh5enTOLwA9DE1ZyvlY8O ORGn/33QK38GideoRo1gH0e6+YZY0WXO+qrFkvGPMFCGgCASxCorPd6oU3dJ8AIKmduF 1RX8sCtbNeQr37PhToJxMNMEsc/E+l4qda0KxGKXUqCpED29OZ3Ds/SEroo3tYMYpjs5 2DoQy7QaacnZ+evT/Pw3+tNN7Pe7GI19e/QnCD0qVacFYFz76xH7e55FwuNmdCYV9Fs0 dkIw== X-Gm-Message-State: AFuF++ni0w2W8NuAQvTXF35idspG2B779c/whhZrkM4fdgyNAmEsRQd1 ZxBw5MjMOrbo083l4H28qFTeXzU/2yqYqB9ja6DxMnR0VabbktaKkZNBeBQcueH9hg== X-Gm-Gg: AYBFou1bNDK7K9lPTAFQ/7VQG9F+Fi1YeCLVyyYhcZ82o6mxUY01HXHMo/dVsCgJQOU 6tCvLgu0JWxpfNTA08AcuYfe0ibJTUbfrggTIxct7R6MDhBIZvhNfeVegRv74PjbS4JnfZmmigP 2kaiDxasz2KRNLp7DpcCKk4RgJkWPQf+9KTsCFkUN8zpWPdb2v8c4MYY6km0MkjeBUvgHo3MdHt 1xc2UVzuKrzzbVB3D2EG7Qbrjt1aNjf6GHqp4LULZe//sGeb7d1LUyrWq0X2duO9Qu7tcSaSMvZ y0HLimmNXEqvKx7GR1ZqFVsHork/lePrC3uiO8DWClDZzYOWEvmkZwe71Kuc7vul65QuYO/xQZZ ulKL5sgJHlGD5cLAmt1uhHNGf9IwRn63YqYPfJ8rWmorHhBVPFDI+LBDnZ6tyKD6DwxbCOmR+Xl vYXvrlBKbX4UlKrEJN27YYkKJYDJ+DFlL/H7JEBak2SwJnTYUluWQ3+M8Mg/2rYFw2ffX1/HH/H ROBKHrC4p2x5dtc2zHxlaRVE+Upub9HZAN5CRHzl017ICtd X-Received: by 2002:a05:600c:74a:b0:49d:10b8:7e05 with SMTP id 5b1f17b1804b1-49d10b87ec4mr102340805e9.19.1788885421537; Tue, 08 Sep 2026 09:37:01 -0700 (PDT) Received: from latitude7275 (84.124.213.91.dyn.user.ono.com. [84.124.213.91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48588394fa1sm35268362f8f.8.2026.09.08.09.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2026 09:37:01 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH v2 0/2] ipa: ipu3: Take the OV5670 black level from the sensor helper Date: Tue, 8 Sep 2026 18:37:06 +0200 Message-ID: <20260908163708.341308-1-dmanresa@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904062840.46739-3-dmanresa@gmail.com> References: <20260904062840.46739-3-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" This replaces "ipa: ipu3: blc: Make the black level configurable" from the first version of the series. As Dan pointed out, the black level is a sensor property and belongs in the camera sensor helper rather than in the tuning data, so: - add the OV5670 black level (64 at 10 bits) to camera_sensor_helper.cpp; - make the IPU3 BLC algorithm read it from the helper, converting the 16-bit value to the ImgU OB grid units (half a 10-bit LSB), and keep the old hard-coded 64 with a warning for sensors without a helper value. Measured on a Latitude 7275: with 64 the darkest percentile of Y is 32 with a U/V of 132/131 (a residual, colour-shifted pedestal); with 128 it is 15 with U/V 128/128. Changes in v2: - Rework as helper + algorithm change instead of a tuning parameter (Dan Scally). D. Manresa (2): ipa: libipa: camera_sensor_helper: Add OV5670 black level ipa: ipu3: blc: Use the black level from the camera sensor helper src/ipa/ipu3/algorithms/blc.cpp | 56 +++++++++++++++++++++---- src/ipa/ipu3/algorithms/blc.h | 5 +++ src/ipa/libipa/camera_sensor_helper.cpp | 2 + 3 files changed, 54 insertions(+), 9 deletions(-)