From patchwork Thu Nov 5 20:37:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crissc Linux X-Patchwork-Id: 28777 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 0208FC3304 for ; Thu, 5 Nov 2026 22:21:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DF9856A7BA; Thu, 5 Nov 2026 23:21:20 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cC5dlBJW"; dkim-atps=neutral Received: from mail-dy1-x1331.google.com (mail-dy1-x1331.google.com [IPv6:2607:f8b0:4864:20::1331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 684B96912C for ; Thu, 5 Nov 2026 21:37:42 +0100 (CET) Received: by mail-dy1-x1331.google.com with SMTP id 5a478bee46e88-3514b90bb89so4482159eec.1 for ; Thu, 05 Nov 2026 12:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793911060; cv=none; d=google.com; s=arc-20260327; b=h4QPd3GHneXvHiJuqX1vQalKsoYG+f5evgqvv1Qwm9Q/lzX+LrBUerLfcDlZeXwju2 kuGEvkoNSezQu0AhppWrsk7gi5CDfdb9VjzjYirahXg9T96L4LmNfTuZ9FT8dMerDiH8 +TxmvojhnTzn2z3r5Gacoc7pdGMGn6PdnRVAUtM1g5IjohHTDbnBkrFZxLXR8s1jaqj5 zAp5XmhqtCA+4CiOyU3WUdIv2kVE2SRm96xtVJ1T6mUGSca9D5pZtnVUd2NguSprYRXU bL2pHI1X7RvA7ZrO96xVw2Y++yKf70hG0prqxQ1y5nd5FT6Zy2/Bf7njlxwPR/PR69FL GXYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=AJnaTZV4jkggGrdKKGetJ23AVhRDzWjZR9tJQh82xmk=; fh=wtmKwyi0l3IkgfllUcb23GUQ5DBcFLPuxebUMmhSdY0=; b=bxnzpJpLzevXLex9C1kCZ2FyMpCqZRZw45dCh7EF92H3T4RR01qiLdXTtYVP/3HQL/ j4PHZVO1horC2Wd0TXWPFHbFkZExSX+52SRXFcPKHj/7rmkWPhRxHAuSVD0ZQc4EGbQx JoKU/OODjRSn3SghDbpGabK1KbwGyJ2V6hR3gvDGjIjiddl+BG9qZkM4oy05oD0alP/G Q9W+WElGD/BIEqTt1o1s53nsgmo3DYvrGrdkrxppAnWMCZnaC3fBO6y1w8vFsDQ6LJ79 jiD1Ium5K3GlGeS/eFzotXYZv1MWDqOONVlxcS1ZqK14ayfzhQfYf+AwWHOS+jX2tZcI 932Q==; darn=lists.libcamera.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911060; x=1794515860; darn=lists.libcamera.org; h=content-type:to:subject:message-id:date:from:mime-version:from:to :cc:subject:date:message-id:reply-to:content-type; bh=AJnaTZV4jkggGrdKKGetJ23AVhRDzWjZR9tJQh82xmk=; b=cC5dlBJWdnqoDyTYoxaN2Mle05JxCnu2HX47mNUq1UOMsUXAs/I8wsAVvWBp9y5Otc qAIripl3Tn52WcqG/27yJVPSgPluTKBJ91gYmx/bADjmqeqnIQm7dhe+FRXNBIsAq4wL WVdHA+fMIBdAc/SaXEqx/aaPHN/uiiK1Ex6nhvpv8EJuq/D3Yn0qyicOUkhAL72vJMQy V/mbqPadG4ZgRW/FiHTxNvrkydurJgIwzJMtR+dUX++snP8V8YO/4tNQytMNNFbPAIEG 8xUCiQk01+XdBw2aiQuYZuXhfC3nyw+PmpafkYUeSDqRp1G2SoP3aqvWyffZjXLVf2Cx 0bQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911060; x=1794515860; h=content-type:to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=AJnaTZV4jkggGrdKKGetJ23AVhRDzWjZR9tJQh82xmk=; b=d0NYxBZXk0/zEfwRWEJZGyWQieVqUE5eELxqKh94wX66PPpgvVj/YfJ6c1w61xEOo2 q15VVp1DZh7+dIiXhUovYxT+oTY20VTpQfmdEzOMR600cgJ3PNSQ+lVI/MllwfCSgQKz DglwvOAsthCaretI6ooyoJo6zegRhHnr3rHPrpzG+ana3SH75EEzT4ELHy/W65FpFYqG FR8KOeQbdVSFzHxOKElneJythj7W8eQXV48/jHUVO8NKgDI8Uz+qYN9JF4ItSY3gi/3p 8tpj0u55I24D5X1+eXqZL70oq4Q4JGEMMjYeys5aJIgd94RnMEwKARi9jJUO1E9vq2Ln FkAA== X-Gm-Message-State: APuU4Z8PYs25o7Cl3t6DVy58gRnI35M4x2Wh1YoHoeDUL7JqLKXq1cKY S3uS1PP/z5SW9qWN3RPZnNnWYa0rUsXNcrZKtD/DDSyPoPZ7ulWkjsI/fVn03DQFkOTW9Ed4dcm Bm6F0LqMWfldG+FnRNcGWnSDuyyzhEamfC3qvT/U= X-Gm-Gg: AYBFou35ZK5GDgfBUa6TSTyh+JTd2D5bwvwEqOXmSy1XfblDwFACVtfgVAH+EIGGLEC K7IrhXlyAsUNKQ7mHFVGwVZ72SnnushZ1+NBh87OzclSTy866n4yMCqL/AmnkZRpzUH2yRLm9h8 VYHKyY2SEqWSAN/H5Cn40/UgCNHHmvTxadUlfZVRnCJPsGi+H6c/POHOsGSFZm8c6pueUuUnVQo FcZGhGGgJRBEbADLv9a8KI808FP2UAKQabOg6aKwsF9AERKJm8JtuCrlrwpul/EVwydmo7YLjLL T0EkBvAg2j7cbLCdDZnlvnJ5Pk4333+vqeZaFNTgfAt3JRvFFARAMozoqiRzb8l48CcqFHW7OXV LBOGDrvB0GPqFu3ZQrwrZoKbMTwXuTc+Z9HXIANIFL01EjYDFtgGGtHeq8RBZNrl1qbpt X-Received: by 2002:a05:7301:710d:b0:36c:dbac:705d with SMTP id 5a478bee46e88-36f76d11590mr279513eec.15.1793911059893; Thu, 05 Nov 2026 12:37:39 -0800 (PST) MIME-Version: 1.0 From: Crissc Linux Date: Thu, 5 Nov 2026 21:37:28 +0100 X-Gm-Features: AclHuK8V8si1vbRdEoT06Qp-DrDpN_es0SPiC5a4utqUMWUMDlkMySKfu0Bcsi8 Message-ID: Subject: [PATCH] ipa: libipa: camera_sensor_helper: Add OV2680 support To: libcamera-devel@lists.libcamera.org X-Mailman-Approved-At: Thu, 05 Nov 2026 23:21:19 +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" Hello, Transparency note: I am a user, not a camera or kernel developer. The investigation and the attached patch were done with an AI coding assistant (Claude Code, by Anthropic), running on my machine. I ran the tests on my hardware and can run more, but I may need guidance on detailed technical questions. The front camera of the CHUWI UBook XPro (Intel IPU3, Kaby Lake) is an OmniVision OV2680 (ACPI HID OVTI2680). With a recent kernel (Linux 7.0), the ov2680 driver binds through ipu-bridge and exposes all the controls libcamera requires. However, libcamera does not list the camera because there is no camera sensor helper for the OV2680: ERROR IPAIPU3 ipu3.cpp:307 ipu3: Failed to create camera sensor helper for ov2680 ERROR IPU3 ipu3.cpp:1196 Failed to initialise the IPU3 IPA The attached patch adds a sensor helper and static properties for the OV2680: - analogue gain: linear { 1, 0, 0, 16 } (registers 0x350a/0x350b, 0x10 = 1x, range 0..1023 as exposed by the kernel driver) - pixel size: 1.75 um - test pattern: Color Bars = 1, matching the kernel driver menu Testing: I applied the same change as a backport to libcamera 0.2.0 (the version shipped by Ubuntu 24.04 / Linux Mint 22.1). The camera is then detected ("Internal front camera") and streams 1280x720 NV12 at 30 fps with cam, GStreamer libcamerasrc and PipeWire. I have not compiled the attached patch against current master, so please let me know if anything needs adjusting. The uncalibrated.yaml tuning file is used, and image quality is reasonable for that file. Hardware: - Machine: CHUWI UBook XPro, BIOS ZW-BI-13-SF133KR300-KB60C-066-E (11/05/2021) - IPU3 ImgU [8086:1919], CIO2 [8086:9d32] - Sensor: ov2680 on i2c-2 address 0x10, 19.2 MHz clock from INT3472 (discrete) - Kernel: 7.0.0-42-generic (Ubuntu HWE) I can test further patches on this hardware if needed. Thanks, Christophe Schleicher (attachment: 0001-ipa-libipa-camera_sensor_helper-Add-OV2680-support.patch) From 045f16a0f3c4893fe64670f5b75368af94fc8d58 Mon Sep 17 00:00:00 2001 From: Christophe Schleicher Date: Thu, 5 Nov 2026 21:06:34 +0100 Subject: [PATCH] ipa: libipa: camera_sensor_helper: Add OV2680 support Add a camera sensor helper and static sensor properties for the OmniVision OV2680, as found as the front camera of the CHUWI UBook XPro (Intel IPU3, ACPI HID OVTI2680). The OV2680 analogue gain is programmed in registers 0x350a/0x350b with a 1/16 step (0x10 = 1x), which maps to a linear gain model of { 1, 0, 0, 16 }. The pixel size is 1.75um. The test pattern menu indices follow the upstream kernel ov2680 driver. Without the helper, the IPU3 IPA fails to initialise with "Failed to create camera sensor helper for ov2680" and the camera is not exposed. Tested on a CHUWI UBook XPro with Linux 7.0 and a backport of this change to libcamera 0.2.0: the IPU3 pipeline exposes the camera and streams 1280x720 NV12 at 30 fps (cam, GStreamer libcamerasrc, PipeWire). This patch was written with the help of an AI coding assistant (Claude Code, Anthropic), which did the analysis and wrote the code. I tested the result on my hardware, reviewed it and submit it under my responsibility. Signed-off-by: Christophe Schleicher --- src/ipa/libipa/camera_sensor_helper.cpp | 11 +++++++++++ src/libcamera/sensor/camera_sensor_properties.cpp | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 359040e..ded0bf1 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -748,6 +748,17 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("mira220", CameraSensorHelperMira220) +class CameraSensorHelperOv2680 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv2680() + { + /* Analogue gain register 0x350a/0x350b, 1/16 step (0x10 = 1x). */ + gain_ = AnalogueGainLinear{ 1, 0, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("ov2680", CameraSensorHelperOv2680) + class CameraSensorHelperOv2685 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 20cfd0b..5cf824c 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -403,6 +403,20 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 1 }, } }, + { "ov2680", { + .unitCellSize = { 1750, 1750 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + /* + * No corresponding test pattern mode for: + * 2: "Random Data" + * 3: "Square" + * 4: "Black Image" + */ + }, + .sensorDelays = { }, + } }, { "ov2685", { .unitCellSize = { 1750, 1750 }, .testPatternModes = { -- 2.43.0