From patchwork Tue Nov 3 10:41:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GuyliandeJong X-Patchwork-Id: 28768 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 9924AC335A for ; Tue, 3 Nov 2026 12:04:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E046B6A7B3; Tue, 3 Nov 2026 13:04:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=proton.me header.i=@proton.me header.b="BYVPdOxm"; dkim-atps=neutral Received: from mail-10630.protonmail.ch (mail-10630.protonmail.ch [79.135.106.30]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B7A26935F for ; Tue, 3 Nov 2026 11:41:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1793702513; x=1793961713; bh=WS5HwVdQPmV+AJTvhYA+LV7Q61iOGCIF215LdTWogl0=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=BYVPdOxmKgAON+mzyqU8NPr1JXnB0qEgCiZFveWZ+zzNYAaQ6rRX/jNycjUqmGhvS SYj80uzyfs9Wf45041ryXMfuWxYxj/QT0adQJPx9thUa7rXinXbsUydbSR8hKzZr+j FQLEX/FlpbPhRkm7HaU/hPMGQccuam6H3+PRurftpMxKEa9tj/fFtdNjERRQuH7Nxk yzetG6XgYfK9R+gBebME1ZnouFF06A+hj+EOV+UNkYYtmilWXXqUXqfkxI994FsHva 6wTOays6M97RviqZ/3ytcHE4e4ffJrCzxsc8kSqnPQ4nzzb4Au31bCJqebk7CwiXUb hIFxRTBNw4JsA== Date: Tue, 03 Nov 2026 10:41:48 +0000 To: libcamera-devel@lists.libcamera.org From: GuyliandeJong Subject: [PATCH 1/3] libipa: camera_sensor_helper: Add OV9734 Message-ID: <20261103104131.87331-2-guyliandejong@proton.me> In-Reply-To: <20261103104131.87331-1-guyliandejong@proton.me> References: <20261103104131.87331-1-guyliandejong@proton.me> Feedback-ID: 112452169:user:proton X-Pm-Message-ID: c1cc94ec8139e2af2470a6c3711d2b6703ad769a MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 03 Nov 2026 13:04:24 +0100 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 0x40 at 10 bits applies, which is 4096 at 16 bits. Without a helper the IPU3 IPA can't be used with this sensor. Signed-off-by: GuyliandeJong --- 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 359040ec..41266005 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -877,6 +877,19 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865) +class CameraSensorHelperOv9734 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv9734() + { + /* Sensor default black level target: 0x40 at 10 bits. */ + blackLevel_ = 4096; + /* 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: