From patchwork Thu Nov 12 08:52:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GuyliandeJong X-Patchwork-Id: 28870 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 0E321C3304 for ; Thu, 12 Nov 2026 08:52:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C00C6918C; Thu, 12 Nov 2026 09:52:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=proton.me header.i=@proton.me header.b="juQFhx7R"; dkim-atps=neutral Received: from mail-10628.protonmail.ch (mail-10628.protonmail.ch [79.135.106.28]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 490AD690E6 for ; Thu, 12 Nov 2026 09:52:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1794473533; x=1794732733; bh=PNpONXnew8YED7h5Cp6mW71stPQG6imxNLQipOwnes8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=juQFhx7RI7y0DAgGhtAO4dqhGmJ6xwlLZWag8dB89WFaqYnsUDya0jlo05doltDhX 6M/2q10qKlE15KRfod5eu3P83ZsXT00r2sbGgvSdo2ofreE54N7Bsy4eNjV4vonUo+ vyOFtx+iJEZfTqtuQRy7Aho/CXcSN6Qy0WeLBOtufLNROqNs8DFjvIjJc9czScGq9q JaAL0xgzrX5qUB5YBCFpQ0FRG98OA1KwgBWdDEz+NeSkgCUZui56xu5Qp2Hwwcc1Oj vierUxq+qZMguFoyBkkBP6zgMb3+0+HtWl9WIYpR504p1J2f1g13TlBhKCx9Q1iPv8 EfHMMWm6jRkDQ== Date: Thu, 12 Nov 2026 08:52:09 +0000 To: libcamera-devel@lists.libcamera.org From: GuyliandeJong Cc: Barnabas Pocze , Afonso Figuinha Subject: [PATCH v2 1/3] libipa: camera_sensor_helper: Add OV9734 Message-ID: <20261112085159.14289-2-guyliandejong@proton.me> In-Reply-To: <20261112085159.14289-1-guyliandejong@proton.me> References: <20261103104131.87331-1-guyliandejong@proton.me> <20261112085159.14289-1-guyliandejong@proton.me> Feedback-ID: 112452169:user:proton X-Pm-Message-ID: cb4eed86d6f27c4e3b3bfb8500209c596c8d5fc3 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" Add a camera sensor helper for the OmniVision OV9734, used as the front camera of the Microsoft Surface Laptop 2. The kernel ov9734 driver writes V4L2_CID_ANALOGUE_GAIN directly to the 0x350a gain register, with a range of 16 to 248. The register is a Q4 fixed point value, so 16 is unity gain, giving a linear model of gain = code / 16. The driver doesn't program the black level calibration target, so the sensor default of 0x10 at 10 bits applies, which is 1024 at 16 bits. This matches raw frames captured with the lens covered, which average 16.7 to 17.0 in all four Bayer channels at minimum exposure and unity gain. Without a helper the IPU3 IPA can't be used with this sensor. Signed-off-by: GuyliandeJong Tested-by: Afonso Figuinha --- src/ipa/libipa/camera_sensor_helper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 608937d4..4de1a1f3 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -942,6 +942,19 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865) +class CameraSensorHelperOv9734 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv9734() + { + /* Sensor default black level target: 0x10 at 10 bits. */ + blackLevel_ = 1024; + /* Analogue gain is a Q4 value, 16 is unity gain. */ + gain_ = AnalogueGainLinear{ 1, 0, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("ov9734", CameraSensorHelperOv9734) + class CameraSensorHelperOv13858 : public CameraSensorHelper { public: