From patchwork Fri Sep 11 15:39:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28231 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 EEB66C3272 for ; Fri, 11 Sep 2026 15:39:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 390D66866B; Fri, 11 Sep 2026 17:39:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ptlaNmCo"; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7825668643 for ; Fri, 11 Sep 2026 17:39:03 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-485850cf499so865669f8f.3 for ; Fri, 11 Sep 2026 08:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789141143; x=1789745943; 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=J9Ns5GbEHVXypighH5qJseZHa5600lzLFPQgFvsQr9Q=; b=ptlaNmCoCdukk0fAc+WBLNWOyKAiRdV1pKiqcrAC+XTMUUBceZznIc2yEnyZ13ne3N KG8GR5sDZB2N04Hz0aR56AyumsbjcdsnTOPHRlCJ3f9+qKFcqzAMKb0rvhVQfUYLZqHj eqdExC6Z2O/HTmoidw8G2kfgHWyvCVjVCnkSt9Wclf9ig0z1Jwae7U0GhYMW/tYeyr6X LxgdqHWM7gyZMOJKreWiXuXq0lHNVaAN3mYnZNxL8MaqARWbHA4tcVN9ydZjMoNoGSX0 BFc4mAzqJGK5PVyVRdliwn9DgxTKrM8A5yYWm52PeljRhHD3WzU5Dd1cRtIF/WYjOrUx h1/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789141143; x=1789745943; 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=J9Ns5GbEHVXypighH5qJseZHa5600lzLFPQgFvsQr9Q=; b=gubRuM6meRhDMvHESkceMaE8vTj+mTEepTqHofNn3IzUy3m7trNWYE/bOr3MF1NbX/ +v4V2djTsldh2phFIg3bouIhD384DVvPA0ggFuzzRj/zDBuRjb7dLuIfwC8UmKqGC7sp bllXPm+buBFPmH/qNEXpHtC2nW10CpYMFUwiKxPigzWT2m+Y9WiLaK/0UEYCc8d/yT96 ssavxNcAmMVEXfaVzZTxhZIY6bji5RCZ79p+rbYG9f++6xbVqw07eHej2d3y249NrJf1 +sG/oxGMZfcVmnl98GlQUTyMN6tS0dSIcye5nSK37Q9kPkxxkHFe3q1+CLskvzDr95kE qaDw== X-Gm-Message-State: AFuF++kd5pU9+PBupuazCmjgU5UVAPJi9e7IRgvXNh8TdtVoTt8MR2XS +sajOogS3zTjZqhDGqXuDOQrr7KId4OQgYGwNrnXcQ/D+Quwm0+Q9k8KrT6eHJY= X-Gm-Gg: AYBFou2Aq6wAJGSM7RpVuzP7gmksbopRJrrFdKAyiamxp8JbEwsh56zwkMbiovi8sff ZfAFs8aSxRK0esm45HCT9CsiDyTeEg+NpTL4ae8JCTn3WuqTcTNrh5p1g8G7/eoCO/Gy1q+Nw9j 9/gE9N7SQpwe4gaqETq4gS6hIfcUEb4JMmhO/P9DRHkk1E15kol0Z9hvNsvWhK++DpS9njn4Iaq Zls2pCSTsADuIACgjEDip2q8QCAOvZcr33H9mNkn700Pf2V2ecCY/mkWA77b6/wGvKz+CraKcxK fke1hsQap//Wx5y36tApkJmxxCar2zltrDyu6yvYQdepiwaM6xYPFk6k2YDTzkDykfIfLgw8K43 Bf45bGpXV/tqYLcPWskZ83nOLMffrBWvcaIfVKm5KOYvgATttd1DwMF7G0L51jJEq4chbVz8UUM XCFSbsKfZkNASgTG95eLrvOKiKxXzPM4IQHFCoYtiCIw5WcWUCN/wLoohJzXUcjOiGpKK+JEHeu mc9YDO8jVZIydZG9P06Zh2uVVufUP6Ojac8tIIK31avQlonFvZUUr5quxs= X-Received: by 2002:a05:6000:26c6:b0:486:f4af:16dd with SMTP id ffacd0b85a97d-486f4af176amr983784f8f.3.1789141142484; Fri, 11 Sep 2026 08:39:02 -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-486eb33ee5csm6851570f8f.20.2026.09.11.08.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2026 08:39:02 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart , Daniel Scally Subject: [PATCH v4 0/2] ipa: ipu3: Take the OV5670 black level from the sensor helper Date: Fri, 11 Sep 2026 17:39:16 +0200 Message-ID: <20260911153918.96470-1-dmanresa@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260910172120.73148-1-dmanresa@gmail.com> References: <20260910172120.73148-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 black level of the OV5670 belongs in the camera sensor helper rather than in the tuning data, so add it there and make the IPU3 BLC algorithm read it from the helper, converting the 16-bit value to the units the ImgU OB grid expects. Changes in v4: - 1/2: Laurent is right that deriving the data pedestal from the ISP output was not a way to measure it, since that is the very thing the patch then configures. Replaced by the black level characterisation that comes in the OEM tuning data for this camera module, which the vendor measured over six exposure times and five gains for the four Bayer channels: 64.1 to 64.4 at unity gain, within 62.0 to 64.5 up to a gain of 15.9. The commit message now cites that instead. - 2/2: shortened the commit message to the first paragraph (Laurent, Dan), and rewrote the comment on the conversion along the lines Dan suggested, with the two worked examples and s/The helper/ CameraSensorHelper/. Dropped the surrounding prose that Laurent found irrelevant. Changes in v3: - uint16_t for the default black level and the member; the explanation of the conversion moved out of the copydoc block. Changes in v2: - Reworked as helper plus algorithm change instead of a tuning parameter. 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 | 53 ++++++++++++++++++++----- src/ipa/ipu3/algorithms/blc.h | 5 +++ src/ipa/libipa/camera_sensor_helper.cpp | 2 + 3 files changed, 51 insertions(+), 9 deletions(-)