From patchwork Wed May 6 21:46:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Tia X-Patchwork-Id: 26650 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 72E1EC32F8 for ; Wed, 6 May 2026 22:19:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E61026302A; Thu, 7 May 2026 00:19:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=jetm.me header.i=@jetm.me header.b="Ad72/8UJ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="q+cW6hwV"; dkim-atps=neutral Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 172F563022 for ; Thu, 7 May 2026 00:19:47 +0200 (CEST) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id CED21EC00BF; Wed, 6 May 2026 18:19:45 -0400 (EDT) Received: from phl-imap-07 ([10.202.2.97]) by phl-compute-02.internal (MEProxy); Wed, 06 May 2026 18:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetm.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1778105985; x=1778192385; bh=tprWUqY3r3XJz5Ghie815JLR38HBm1QesliNd+yOXh4=; b= Ad72/8UJdLeQkIt3PoMtHB+1EIpGyr/Z5MPoVffABpvavsBgNajkLbsIcp7v7Hrz YK9KrpyidrImDG5T8kDCKjcyaXeBXiMkCFT3gNm1ijoPRYkfiO21OXkvHAKDdiEr njY//gj03J70bwUyLd193rQeLxwaakNw6RqbhJXTJ2nbYAsvkvishbg+UmwqOvfe 8m4PEhFTu49iJUolQsSZc2wqaowAWXY5KQ6GPcGsBT6GdfNhz806wNwtJ9skZc1Y R5iqfPXJn4YbQMWM5+F1OuiNDfpypia+dtVGWbeZlxSUX4x1Nr+Po72Fp2pkh8iy YedU+wd1Ma+Owimu3wUkmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1778105985; x= 1778192385; bh=tprWUqY3r3XJz5Ghie815JLR38HBm1QesliNd+yOXh4=; b=q +cW6hwVDe4dbf8wCnrD/ZO/YY+24qcp4rnykqkTYXjVY2lLxN1Xnn9WI9IkU0TL0 khvT50rtNmskG4PEMSRz+e87vAAzmA/LCV5W7CZcw/9Ta+sgtV+8Anv+ebBRRlL7 WsnTpooH9UtT3uJbL+YGVuSjwu5F+znPA8NJaU6W5TW17EKceZb8rCDPhlOKJwxV kmcjt1gsP/p1bjyw3g/R81rvSDwN/y4gVH7vzva7wMz+UgrshcVU2ZpQh6Hxk9qg khgXbbcJcsXUDWR290+1GEwi7FX3fc9Net4QOLTrGfR+i8c7V3d/5BBx8DuNSnF1 z4AUGf5B0XFZgnYKxl/vQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddutdehjeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgopfhokfffucdluddtmdenucfjughrpefotggggffhvf ffufevjghfsehtkedttdertdejnecuhfhrohhmpeflrghvihgvrhcuvfhirgcuoehflhho shhssehjvghtmhdrmhgvqeenucggtffrrghtthgvrhhnpedtudejffejkeekteelueefvd ejvdeuhfefteehkeevtddvleduteekleetvdelhfenucevlhhushhtvghrufhiiigvpedv necurfgrrhgrmhepmhgrihhlfhhrohhmpehflhhoshhssehjvghtmhdrmhgvpdhnsggprh gtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrohgsvghrthdr mhgruggvrhestgholhhlrggsohhrrgdrtghomhdprhgtphhtthhopehkihgvrhgrnhdrsg hinhhghhgrmhesihguvggrshhonhgsohgrrhgurdgtohhmpdhrtghpthhtoheplhhisggt rghmvghrrgdquggvvhgvlheslhhishhtshdrlhhisggtrghmvghrrgdrohhrghdprhgtph htthhopehmiigrmhgriigrlhesrhgvughhrghtrdgtohhm X-ME-Proxy: Feedback-ID: i9dde48b3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id ACDC41EA006B; Wed, 6 May 2026 18:19:45 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 From: Javier Tia To: libcamera-devel@lists.libcamera.org Date: Wed, 06 May 2026 15:46:42 -0600 Subject: [PATCH v5 3/3] ipa: libipa: camera_sensor_helper: Add OV2740 black level Cc: mzamazal@redhat.com, kieran.bingham@ideasonboard.com, robert.mader@collabora.com In-Reply-To: <177810597783.688418.1631246733707368646@jetm.me> References: <177810597783.688418.1631246733707368646@jetm.me> Message-Id: <20260506221945.ACDC41EA006B@mailuser.phl.internal> 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" Set blackLevel_ = 4096 (0x40 at 10-bit) in CameraSensorHelperOv2740. The OV2740 kernel driver programs BLC target register 0x4003 with 0x40 for the 180 MHz link frequency mode. This matches the same pattern used by OV5675 and other OmniVision sensors with a 10-bit black level of 64. Without this, the Simple pipeline falls back to auto-guessing the black level, which happens to arrive at the same value but isn't documented. More importantly, the CameraSensorHelper is the canonical location for sensor calibration data and is used across all pipeline handlers, not just Simple. Suggested-by: Robert Mader Signed-off-by: Javier Tia Reviewed-by: Milan Zamazal Reviewed-by: Kieran Bingham --- src/ipa/libipa/camera_sensor_helper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index e3e3e535..3028197e 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -672,6 +672,8 @@ class CameraSensorHelperOv2740 : public CameraSensorHelper public: CameraSensorHelperOv2740() { + /* From Linux kernel driver: 0x40 at 10bits. */ + blackLevel_ = 4096; gain_ = AnalogueGainLinear{ 1, 0, 0, 128 }; } };