From patchwork Thu Mar 5 20:10:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Tia X-Patchwork-Id: 26264 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 76EB4BE086 for ; Thu, 5 Mar 2026 20:16:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2A6046260B; Thu, 5 Mar 2026 21:16:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=jetm.me header.i=@jetm.me header.b="JfJPwlR+"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="V8FKOeP8"; dkim-atps=neutral Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A8F96625F7 for ; Thu, 5 Mar 2026 21:16:30 +0100 (CET) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id BFB827A00DE; Thu, 5 Mar 2026 15:16:29 -0500 (EST) Received: from phl-imap-07 ([10.202.2.97]) by phl-compute-02.internal (MEProxy); Thu, 05 Mar 2026 15:16:29 -0500 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=fm3; t=1772741789; x=1772828189; bh=/MMD4p8/87sHjSVFrSohUyOWFCUdXyclLWXy62ga1B4=; b= JfJPwlR+8ISSbpmeN4UphHe+6MVYA3dpGa+WjGj1+Qz7hBtrkUCmRLvl7aiLoJCJ GFz2eyeJJpQgi07BBzmp53HCpjnICJWO4aIOE81AOhWsdv3GMpcpj+/WlUVGI44W bEtlZ+g9Mriw+A9yIq9lXZb6uCuOojXbvumqTJmQJADvqSsa1q+w+0bzjX+kHbI3 AjytGUeNARUvYYnYjHnSwz50BwT35DBzLzdO65qojfV0N+f5gHOXmxzUsnS0yuFw z44wyTZOKg6Kb6kn6zkAWdlMVCVFL/pVf3v9A3KkMkIsFI/8nuuouAecHD+MFkLp EaKFI2nSI/+NLT7E5hQd4w== 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=fm1; t=1772741789; x= 1772828189; bh=/MMD4p8/87sHjSVFrSohUyOWFCUdXyclLWXy62ga1B4=; b=V 8FKOeP8B1UBtkgCweOJA+TniEAZo7AleqayaHoE89dyUBLA917htx5SQui9GMr1w p4lk6If70C5SvJBhEzkGtHzcNFoOnVurRTDDt+4L+PxswSw0ik1KeRYRz/YX9ViX 3OQGz6S4qWTjSd+1joyEN4ZkgMdo9YtFGRaA0rN4y4rpzbRDx5iXUp+1hfI7wafX Or/7pzX4D/lgFFTfIioep1d/ViRu3SfZ72RauVYZALFup9B492ycJpKd97164qvV EM04kLJmAJwGuh8ku6Cpz2i2LF2fZyY4WEBSgnjFyyFceJqpnd4maG6jgbnTTyQ+ Hdo9LTEFO/7Nbr0MIgzQw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvieejfedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepoffhfffugggtgffkvfevofgjfhesthejredtredtjeenucfhrhhomheplfgrvhhi vghrucfvihgruceofhhlohhsshesjhgvthhmrdhmvgeqnecuggftrfgrthhtvghrnhepvd dtjeeiheeijedtveeujeevvdekjeeuveekleeijeekfeejhfefveeiffffvdeinecuvehl uhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepfhhlohhsshesjh gvthhmrdhmvgdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtoheprhhosggvrhhtrdhmrgguvghrsegtohhllhgrsghorhgrrdgtohhmpdhrtghpth htohepfhhlohhsshesjhgvthhmrdhmvgdprhgtphhtthhopehlihgstggrmhgvrhgrqdgu vghvvghlsehlihhsthhsrdhlihgstggrmhgvrhgrrdhorhhgpdhrtghpthhtohepmhiirg hmrgiirghlsehrvgguhhgrthdrtghomh X-ME-Proxy: Feedback-ID: i9dde48b3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6F0691EA006B; Thu, 5 Mar 2026 15:16:29 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface From: Javier Tia Date: Thu, 05 Mar 2026 14:10:39 -0600 Subject: [PATCH v3 3/3] ipa: libipa: camera_sensor_helper: Add OV2740 black level MIME-Version: 1.0 Message-Id: <20260305-agc-proportional-v3-3-25abc1bfacca@jetm.me> To: libcamera-devel@lists.libcamera.org Cc: Javier Tia , Robert Mader , Milan Zamazal X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1332; i=floss@jetm.me; h=from:subject:message-id; bh=BjI3qJt89qf+UUwNl9t5oW7IrXveeNERIFns4lhr1S8=; b=owEB7QES/pANAwAKAbXuwwuoZ3cfAcsmYgBpqeM8gIZp/S6S2NCbFG17ZMt6HJJHpbE13YQoz HN0U0gufIWJAbMEAAEKAB0WIQSbE7ILzw7eI0VKk8m17sMLqGd3HwUCaanjPAAKCRC17sMLqGd3 H/UEC/9cdRzVlJ7eoM7EsydsgW+eUjLjvkxXjO7mQ1XuVFdcNADHZJFMySdMgt0yNDNmr2Bs15H aTKTsgM/34Nfe1yoKAabqmrYUOXGX04Vm0SKafuu/Zwnj0Wnh0pnmCFxQOi/y4KhFtaO9R/LuuN NOj5BsXWlB6KvzO2YN6dP8IHA2uQxtTMXET+gnSJnamhMpa97nViHO95XAdQ0y7gD89UoRKQwzr nW7irigBp/vyFmzXUpHGAWzEhBnmnWGkS0w73QOrSDminBx8H0KS+rMyWpaDh308Xd82h3Z7ApY dHiMPOVrUz5q8Ejmg91Z5tRtb6LQOn/lwTUjsGVI3/yB2c4FQ/4K9AfCtpaYxOZn1ntSRBWW9Ay Dx5G+6BU4KRlR7lupk0inGBqARQ9cPTTQ5HBJVbHOhI9ahR53GrAHIXb9/6rgm5449LfsEryQ9U VkEaf2qckE9dMbD/iRKX/2Mh0hVerQiFyOZZ5PFbUhqLdr9w94uY4j9sBmpioIpeX/DeY= X-Developer-Key: i=floss@jetm.me; a=openpgp; fpr=9B13B20BCF0EDE23454A93C9B5EEC30BA867771F In-Reply-To: <20260305-agc-proportional-v3-0-25abc1bfacca@jetm.me> References: <20260305-agc-proportional-v3-0-25abc1bfacca@jetm.me> 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 --- 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 }; } };