From patchwork Wed Mar 4 23:02:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Tia X-Patchwork-Id: 26260 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 8E446BE086 for ; Wed, 4 Mar 2026 23:25:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 51BBC623B5; Thu, 5 Mar 2026 00:25:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=jetm.me header.i=@jetm.me header.b="jVFpWFkC"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="otrMPJBq"; dkim-atps=neutral Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0BFD7623B5 for ; Thu, 5 Mar 2026 00:25:47 +0100 (CET) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 2C2EC7A01E1 for ; Wed, 4 Mar 2026 18:25:46 -0500 (EST) Received: from phl-imap-07 ([10.202.2.97]) by phl-compute-02.internal (MEProxy); Wed, 04 Mar 2026 18:25:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetm.me; h=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=fm3; t=1772666746; x=1772753146; bh=uSVBpptbf4yn889L5GYM1TBbtIjcyBWf6/CMfM4pQzM=; b= jVFpWFkC0E9QfGMo4BE3mNCxrT8SOaZQtZpSHqTRcxvhSexshl9LyUfV+xd8Tmtd Feet090UmslJtOUg/O9fkN81sDkJuyM+k1YzHKDXBbUX7eeOpnnKHyv2x9IBKt78 RuRfs7lheCwWe8ZzYpMFBX4rJ2Q/f1KXrsjFtxRbcFR9Ab+o0RX6MNVehmRFlkgi E14n7i3U1VnilVRis0uEONOjdhsBqJm751VCJ6tS8Wfy0nkDJrkPGGWxy2hT3kM1 JNPf1lAZ9HHDLjbcnTXoa6XFqSoqVbBiR+aai9YukuFD9iUmmFBA/mbTUN/2qZDY L5viHj0jPd0CVD2lM3bZug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm1; t=1772666746; x=1772753146; bh=u SVBpptbf4yn889L5GYM1TBbtIjcyBWf6/CMfM4pQzM=; b=otrMPJBqltOO/M8lp P4LvET5kGOpZiecGAANW/bGiphSRdBDBNtxYi8hL6q+FmoTzmVZh0o8Xy7s493Qs 7JxBgs/l9uUnwAqMXyEoLMazlUbtbLByy3D0lPzoDZLBhcEE/rP43ZblugnCDcr2 mNJrCPi3GfcRdJLHco4bUaVf4+Phb0iHxRfk/THx+LZxK+C3tuJPwotf/8qucg9T FznkJ4IqfqBPzEIYoVNWY3zHeha24DFi3/63KvqsFOx6dwNDVmz7Q5+QIzunEHWf YfFn3SSzxjbBvtU/NM6LqUb9DOf4pqChmCzQGQ/4I3rkKDZee2Gxk7pu4VyXv+8P cW1+g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvieegkeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgopfhokfffucdluddtmdenucfjughrpefotggggffhvf ffufgjfhesthektddtredtjeenucfhrhhomheplfgrvhhivghrucfvihgruceofhhlohhs shesjhgvthhmrdhmvgeqnecuggftrfgrthhtvghrnhepteetvdeklefgledtjefhhfdtle dvhfffgfeuieelgeeigfekgffhleeghfefhfejnecuvehluhhsthgvrhfuihiivgepgeen ucfrrghrrghmpehmrghilhhfrhhomhepfhhlohhsshesjhgvthhmrdhmvgdpnhgspghrtg hpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhisggtrghmvghr rgdquggvvhgvlheslhhishhtshdrlhhisggtrghmvghrrgdrohhrgh X-ME-Proxy: Feedback-ID: i9dde48b3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id DDBF41EA006B; Wed, 4 Mar 2026 18:25:45 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 From: Javier Tia To: libcamera-devel@lists.libcamera.org Date: Wed, 04 Mar 2026 17:02:18 -0600 Subject: [PATCH v2 4/4] ipa: libipa: camera_sensor_helper: Add OV2740 black level In-Reply-To: 20260225221859.600869-1-floss@jetm.me References: 20260225221859.600869-1-floss@jetm.me Message-Id: <20260304232545.DDBF41EA006B@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 --- 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 }; } };