From patchwork Thu Nov 5 23:07:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Figuinha X-Patchwork-Id: 28782 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 CA69FC3307 for ; Fri, 6 Nov 2026 06:12:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3242A6A7D0; Fri, 6 Nov 2026 07:12:08 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nUxozjdm"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D3EB56913E for ; Fri, 6 Nov 2026 00:07:18 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-491971ac844so61276f8f.2 for ; Thu, 05 Nov 2026 15:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793920038; x=1794524838; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=R0AfUBB2PNDE68jyn6Wvy0nq3QuFrN4qYYthcHVgIus=; b=nUxozjdmwXiEp0uA9d95p7U5IzZ77LfwwS69wAkGn8ywd0IyIocNeR4BznqV3eT586 FfLZhOudNf3xT3g/dRqGigMmBxAeUdeCBh9O6Tw5l2A0HMm9dZI/JRxh0HUewS2TryKL kwSjKCCS1+jWA+1ozUSsqReyOVlykWaH2JgW5Ka1xXkh1Iy6kukpq+kelVHp8ou1ZrxO cyl9mT3nIQA1hjxnEWwAD0DaDydi0BKkK6G676L3o3Odjf1HUDP9SDr3Bl8BdD9Vldxm qxL3bsVW5vxirWppkPJ0EwYfsv6rdJJN2+LM7vRGyNzgN+Pi/eZnE04wkMifj0AEFakK lW8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793920038; x=1794524838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=R0AfUBB2PNDE68jyn6Wvy0nq3QuFrN4qYYthcHVgIus=; b=KSOG6ql98VK49xE7akMWmYhBYjqlp8DuATvn+DFmOmIrJpmL5gb45IXI0WK45l9/z2 0WtCWid2hcdQLeiOzT+P44iPZiPh8389BBjVuaCfY7VTLvtanBT2D7rjDp+BN1dMU8vD 11Z9namKHqnxyILlWjFvuOtvlLyqNnOBpLnfacQ3lNbnSykmhVDSzab8uW5pin25i87b OWvDDU7TofYWB2MIBwPvQc/KZP69ubNLsdy9u5B89OUCkCOFoFfCIKuCDW8TfswEFAiG s7IewzA6LxqpM54c4B91zPeuzHLGl1DEZPYH9l5/I6BkTCy4M8CWBXk6JoN/FY2FfCew HDjw== X-Gm-Message-State: APuU4Z9N9hdz1BH2drL56JTHCkPlDcRcx0Ja7jWDDvd7L0p57ssjQRSp xQTVZtYekG6nDr2wuxANyMe9iIHNhFoePohkynrijmzvdLyEwAB6HLG765ImBLT1 X-Gm-Gg: AYBFou3Fkuj5vEfMzFgXjm/KD2+A/LMR9VT/MZEhc58IQTFCfKZe3cFVfQM1GM9BSOE E9CTr2aM6Ijat2rFPAUDGdrEYb7p3/btvy1DZVKbKu6XggCMNVumz3awmPokO2PaLQlYvX9iQpC IMYzndd60cUE+xmxK5PyJ2gsXfTT7f8bDLqrih0zx1lxCqp9VshBjmx7EWYfPRpo51YJkNndnod UHHf5zPNxa4roRjDR6hwki7PTE/kgz7U01us2SEay/hU4arNQZevYjddk0ar5LsOov0DM463TKU GBk1AfHvjUe+NPDhEEndNL966ZdvThKIQsroSqNw9txswAUxNg+DaVMiTaQykOnyJ1gNsuJ9xzz VLOu/sAHwtdK3nS4RT2DC3sVNX/v6gIbquph2ZY7SJL7XK7iAvo/S9mioklQTdxrRyOQyvA9vIt wbWTHoOFx/HpA9j5enxcwh0keUtxjBgYFmXgSyn71kZLIFKycgzf46Slw+KE4mfvz/gsDLxBI11 jC6CJnp47Br6sK+XfBEDVnIZdKmG0lBy5/REPXisZI+koG7uYBKA45RzuCKnejr7QPfIFUBJH4u ILNECl0ES/orYgJEIGg0dhyzzV8yqVHAnfox7zVn2VeR+lR+cluD5PxrHsz1SYalStHYEQ== X-Received: by 2002:a05:6000:41c3:b0:48b:108:48cf with SMTP id ffacd0b85a97d-49275b1bcfamr1848880f8f.25.1793920038320; Thu, 05 Nov 2026 15:07:18 -0800 (PST) Received: from figssurface ([176.223.29.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-492d3d60e94sm183428f8f.2.2026.11.05.15.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 15:07:17 -0800 (PST) From: Afonso Figuinha To: libcamera-devel@lists.libcamera.org Subject: [PATCH 1/4] libipa: camera_sensor_helper: Add OV9734 Date: Thu, 5 Nov 2026 23:07:05 +0000 Message-ID: <20261105230708.14601-2-afonso.figuinha@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261105230708.14601-1-afonso.figuinha@gmail.com> References: <20261105230708.14601-1-afonso.figuinha@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 06 Nov 2026 07:12:06 +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. The Linux driver exposes the analogue gain as V4L2_CID_ANALOGUE_GAIN in the range 16 to 248, with 16 as both the minimum and the default value. The register description is not public. Model the gain as linear with a code of 16 as 1x, which assumes 1/16 steps. On a Microsoft Surface Laptop 1, cam and GNOME Snapshot show a normally exposed indoor scene with the IPU3 IPA using this model. No black level is set, because its value is not documented. The change and this description were drafted with an AI coding assistant (Claude Code, model Claude Opus 5.5). The author reviewed them and tested them on a Microsoft Surface Laptop 1. Signed-off-by: Afonso Figuinha --- src/ipa/libipa/camera_sensor_helper.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 359040ec..912b0247 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -877,6 +877,20 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865) +class CameraSensorHelperOv9734 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv9734() + { + /* + * The Linux kernel driver exposes gain codes 16 to 248. Assume + * 16 is 1x, as it is the minimum and the default value. + */ + gain_ = AnalogueGainLinear{ 1, 0, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("ov9734", CameraSensorHelperOv9734) + class CameraSensorHelperOv13858 : public CameraSensorHelper { public: