From patchwork Mon Sep 21 14:56:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Roux?= X-Patchwork-Id: 28362 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 CCC6AC3237 for ; Mon, 21 Sep 2026 15:09:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8F5D168762; Mon, 21 Sep 2026 17:09:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=humanlearning.ch header.i=@humanlearning.ch header.b="iiwf87x9"; dkim-atps=neutral Received: from smtp-bc0b.mail.infomaniak.ch (smtp-bc0b.mail.infomaniak.ch [IPv6:2001:1600:19:b8b8::bc0b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1EBD76875F for ; Mon, 21 Sep 2026 16:56:36 +0200 (CEST) Received: from smtp-3-0001.mail.infomaniak.ch (smtp-3-0001.mail.infomaniak.ch [10.4.36.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4hpRBq6by5zJgm for ; Mon, 21 Sep 2026 16:56:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=humanlearning.ch; s=20250828; t=1790002595; bh=arUEefrXOw3+1SulOW8ai9YuGosYSRSgfGoEJXNZOnk=; h=From:To:Subject:Date:From; b=iiwf87x953LzOgwY3Nb8hut/0+EawSjdJcNhZA79N0ZkahEYfAQ1PZH+i20u6icQG P76a23xsLxWYRFUsQhfVv9Nl/n8aV9J7O5DiqdwqKFc22oDLu3dmM8elJcFV9tAMgN zLIEl6eYEId/OszY0NvthDwmV25vCzayGKJt/YdcZVY2N/rsTJcOc3511svG0iWXSA IxnLg4KOyTv06AfKRx4D/0qxL8hD+8b6YuyMRjue7QOnEkHEcGIJzcNUFLzxcd3dgJ j8CkCeUenAB57Of/+h7T/4+2H2ACoJKaFIxZIJlsMG0xWoX60O/pBU7qShm5A4Oj5e j1bEqvqqkN8Qg== Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4hpRBq2mrMzl4T for ; Mon, 21 Sep 2026 16:56:35 +0200 (CEST) From: =?utf-8?q?Fran=C3=A7ois_Roux?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH] ipa: libipa: camera_sensor_helper: add ov02c10 Date: Mon, 21 Sep 2026 16:56:34 +0200 Message-ID: <20260921145635.978219-1-info@humanlearning.ch> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-Infomaniak-Routing: alpha X-Mailman-Approved-At: Mon, 21 Sep 2026 17:09:12 +0200 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" Without an entry for ov02c10, the software ISP used by the simple pipeline handler can't run AGC for this sensor and logs: IPASoft: Failed to create camera sensor helper for ov02c10 The kernel driver (drivers/media/i2c/ov02c10.c) advertises analogue-gain register values in the range 0x10..0xf8 with a default of 0x10, and writes them to the 16-bit register at 0x3508 as (val << 4). That register is graded in 1/256 steps, so both the control range and the register encoding agree on 1/16 steps: the default of 0x10 is unity gain and the maximum of 0xf8 is 15.5x. The sensor outputs 10-bit Bayer data (MEDIA_BUS_FMT_SGRBG10_1X10). A dark-frame measurement gives a mean pedestal of 64.2 LSB with a standard deviation below 1.1 LSB, unchanged when the integration time is varied by a factor of 356 (4 to 1425 lines), which confirms a fixed 0x40 pedestal rather than dark current. That scales to 4096 at the 16-bit width expected by blackLevel(), as for the other OmniVision sensors in this file. Add a helper that follows the same pattern. Tested on the front camera of a Microsoft Surface Pro 12 (Qualcomm X1P42100) driven by the qcom CAMSS pipeline. Before the change the IPA reported "Exposure 4-2320, gain 16-248 (1)"; after it reports "Exposure 4-2320, gain 1-15.5 (0.145)". Signed-off-by: François Roux --- src/ipa/libipa/camera_sensor_helper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 9457d62b3..4b5c70f52 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -677,6 +677,18 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov01a10", CameraSensorHelperOv01a10) +class CameraSensorHelperOv02c10 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv02c10() + { + /* From dark frame measurement: 0x40 at 10bits. */ + blackLevel_ = 4096; + gain_ = AnalogueGainLinear{ 1, 0, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("ov02c10", CameraSensorHelperOv02c10) + class CameraSensorHelperOv08x40 : public CameraSensorHelper { public: