From patchwork Wed May 27 02:39:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Elmo Todurov X-Patchwork-Id: 26802 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 82A74C328C for ; Wed, 27 May 2026 02:40:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A1B2662FEC; Wed, 27 May 2026 04:40:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=todurov.eu header.i=@todurov.eu header.b="phhrn1OV"; dkim-atps=neutral Received: from mail.todurov.eu (0001-0000-0000-0000-a600-838d-07d0-2001.dyn.estpak.ee [IPv6:2001:7d0:838d:a600::1]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 26FEB62010 for ; Wed, 27 May 2026 04:40:28 +0200 (CEST) From: Elmo Todurov DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=todurov.eu; s=mail; t=1779849627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KUo19pmhljMGiuDEoLxDTUBvKEKi/R+/O1rkJi9Y83I=; b=phhrn1OV7K0TgQoU1h41dEEvN1O2kjFrdzU3EjRsbpVtUEwW98b4qKQgdayN6cY2+0AIXB 8/nZkkHNEkwleLMJfow5Fj7vXc12bLT/91CaE3p+IqqBP4/MSlaZP75I01FLfUKhAWo40g tnz/P3q2CL5uyYaQq7TERUBzY519AjM= To: libcamera-devel@lists.libcamera.org Cc: Elmo Todurov Subject: [PATCH] libipa, sensor: Add OV8856 camera sensor helper and properties Date: Wed, 27 May 2026 05:39:54 +0300 Message-ID: <20260527023954.947576-1-elmo_git@todurov.eu> 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" The OV8856 is supported by the in-tree V4L2 driver drivers/media/i2c/ov8856.c (CONFIG_VIDEO_OV8856) and is shipped on Chromebooks (mt8183-kodama, sc7180-trogdor-coachz) and on Xiaomi Poco X3 Pro (Qualcomm sm8150) as the rear ultrawide. Register the sensor in the libipa CameraSensorHelper database and in the sensor properties database so SoftIPA can drive AE/AGC and so applications get correct pixel-array metadata. Provenance of the values: - Analogue gain model: the kernel driver writes V4L2_CID_ANALOGUE_GAIN (range 128..2047, default 128, step 1) directly to the sensor's OV8856_REG_ANALOG_GAIN, placing unity gain at code 128 and a maximum of 15.99x at code 2047. This is the same 7-bit linear 1/128-step model used by the existing OV8858 helper. Reference: drivers/media/i2c/ov8856.c, OV8856_ANAL_GAIN_*. - Pixel pitch 1.12 µm: OmniVision OV8856 datasheet (1/4" 8 MP RAW sensor, 3264 x 2448 active, 1.12 µm pixel). - Test pattern modes: the kernel driver registers a 5-entry menu (ov8856_test_pattern_menu[]). Index 0 is "Disabled" and index 1 is "Standard Color Bar", matching TestPatternModeOff and TestPatternModeColorBars. Indices 2..4 are "Top-Bottom", "Right-Left" and "Bottom-Top Darker Color Bar" with no corresponding libcamera TestPatternMode (the OV8858 entry omits them for the same reason). - Sensor delays: left as the default-constructed value. The kernel driver does not use group hold; the actual exposure/gain apply latency has not been measured on this sensor. Matches the OV8858 entry. Tested with the simple pipeline + SoftwareIsp at 1640 x 1232 / 30 fps on Xiaomi Poco X3 Pro (sm8150 CAMSS). Signed-off-by: Elmo Todurov --- src/ipa/libipa/camera_sensor_helper.cpp | 11 +++++++++++ src/libcamera/sensor/camera_sensor_properties.cpp | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 3028197e1..ccb0bf085 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -755,6 +755,17 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov64a40", CameraSensorHelperOv64a40) +class CameraSensorHelperOv8856 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv8856() + { + /* OV8856 uses the same 7-bit 1/128 step linear gain as OV8858. */ + gain_ = AnalogueGainLinear{ 1, 0, 0, 128 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("ov8856", CameraSensorHelperOv8856) + class CameraSensorHelperOv8858 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index b217363d8..b915ad5b6 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -446,6 +446,19 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 2 }, } }, + { "ov8856", { + .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + }, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2, + }, + } }, { "ov8858", { .unitCellSize = { 1120, 1120 }, .testPatternModes = {