From patchwork Thu Nov 5 23:07:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Figuinha X-Patchwork-Id: 28781 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 BC62CC3307 for ; Fri, 6 Nov 2026 06:12:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 90AC56A7C1; Fri, 6 Nov 2026 07:12:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bl0cstcp"; dkim-atps=neutral Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3104A69106 for ; Fri, 6 Nov 2026 00:07:17 +0100 (CET) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-490d59c3edaso27283f8f.1 for ; Thu, 05 Nov 2026 15:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793920036; x=1794524836; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Zzih30srlokS+PHrXp2TfUSytPyXWJHpFmJd7fbU168=; b=bl0cstcpBJvOYraN6zyXY8eznc+AuKMFB0b3OuzPhJwY7qD7Z9x3b7kj9LKYpwj+7x 7bC+1Zy9eKQkKF1W6rZ3vQnyhAKLFW1r9nLp98bzhQuo99A9K3/qvJLCBdsiAtvgqe2U CvCU73e5f5D4R7UyRAF008G3CewTbjFc6mlNOO/wrSOZyJOFDrpgauDZaT74L0fLIGq+ WEKhb3Pwm+EvZeRn1z/2mgJSuuw5uBkO6HblBYkuPHu/u30vHrTP0gOIxHFF3cWxbRfn z10i+tYuIb/OdDPYdAoSeCAr4X1OByI1S+jQmANVjLFzvukqGrf6j4GEDRmNpjHPHbMY 2gqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793920036; x=1794524836; h=content-transfer-encoding:mime-version: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=Zzih30srlokS+PHrXp2TfUSytPyXWJHpFmJd7fbU168=; b=QpXGeYqhy6aK0YhH33BRkqOYxUdQJ5JPk5Rggp97auPXjcdikBxzVG53Vid8IRe4a/ HGDqUc3OxtGcF2ZTek/Yp1DU6HWEU9GXp6JF1Q7qzIAJ4KtG5avgXnOvXm/NPt7wFuEx Iehlnb1KWtk8BSWZ7TnBX9OuEVos+ddycMm6BnZ+PCBN/ijrTJlYTOLOtMY152onjm48 cVjn+pfDSw+IDEh2R5sos7e9xdWAwZ7Axj1fXpEy94zAOoy6hXR8K4DakZbMBquJSL2w uCTa3AoXTXCEe1Mdnzx8pjz9ZzxixR5lKL3Colvhdgd7JOk4sAdeg6vs6GzmUL2om+Yo FlAw== X-Gm-Message-State: APuU4Z+5KYEm+j39RW7fuEnAWoHvdw0mlNoCmtoFudr5rv+McGZ5o3A3 VL8w43AsuZ1j6C9SMBDHB9NQ02qmevBpNJ4+NGd5YM1wR7skHGul0+sEyMorQiJ3 X-Gm-Gg: AYBFou0g2Xlw5MU9p53JESYfaeW4kETqNcPbg8M2kHlnO6AbrNGaA1DoZufttWQtmUk HuVvyQ4msn/FSaK/o5zV/9TCqGtjRECK7lvL0QOgYsZ7cvViMW7kzNCeHIh9pmsDH/DBQVzOH9/ buf9rOoxLZqsf3la045v/kS0V0uffDHfkJHfGoT29aGywh2IkFPdsUpKr5yXwVXBpzd1kyGR/31 wwonzv71E/QyaLM2EKk4K/i8vllAC6qIhpAcR28nR7wzgIjuAbfvdJaUH5AaFxorkEf6KTvFhLI xEcilK1bfA7fazV3fA/4yQgbFIWS9Oenta0Pf5N1UxAaMr+o7O8DbOXjHJpuO0AtXDI7lOuTBtl JKeN3WxmxUyAP5D08f+wbutKnD2K0M0GMV9bwuyg813Bl/sshFLwwzBR+R9omTCOIPLmU0lFDaK C92BIxMtEDR/PHjXBoJXWZohMbNq3XKVgewcgXUaMRVorfueOYByzoj4cjd20zm3YAKUURa6Xgh ZiVbcPi56vI1i1wZJ0yChKUJ9xvCHaYTutZRZoN0N/R77nm+xnqoqGOk4E8M91ALyEpBqfrbp/n 7NsJe2pjJteIX93hZE54MBrZ2mk/qKX7ZwBHllfdZxmMyCamOjkewL50maDVJQVYSUO0oA== X-Received: by 2002:a5d:5f03:0:b0:48e:d7c:4bc3 with SMTP id ffacd0b85a97d-4911a2aa6f9mr7427555f8f.21.1793920036501; Thu, 05 Nov 2026 15:07:16 -0800 (PST) Received: from figssurface ([176.223.29.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-492d3d60e94sm183428f8f.2.2026.11.05.15.07.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 15:07:15 -0800 (PST) From: Afonso Figuinha To: libcamera-devel@lists.libcamera.org Subject: [PATCH 0/4] Support the OV9734 on the IPU3 (Surface Laptop 1) Date: Thu, 5 Nov 2026 23:07:04 +0000 Message-ID: <20261105230708.14601-1-afonso.figuinha@gmail.com> X-Mailer: git-send-email 2.53.0 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" This series makes the front camera of the Microsoft Surface Laptop 1, an OmniVision OV9734 behind the IPU3, usable with libcamera. It needs the kernel series that adds the sensor to ipu-bridge and handles its power [1]. Patches 1 and 2 add the OV9734 camera sensor helper and its static properties. Without the helper the IPU3 IPA fails to start. Patch 3 fixes an uninitialized testPatternMode_ in the sensor classes. For a sensor without test pattern modes, Camera::start() on the IPU3 pipeline failed with -EINVAL at random. It affects any sensor missing from the properties database, not only this one. Patch 4 makes the IPU3 viewfinder size advertised by generateConfiguration() match what validate() accepts. The OV9734 (1296x734) was advertised at 1280x720 but produced 1280x704. Tested on a Surface Laptop 1 (6.19.8-surface-3 with the kernel series): - this series on top of 25cb6cd274d3, built with werror: cam captures 1280x704 NV12 at 30 fps, three runs in a row with no start failure, and lists 1280x704 as the maximum viewfinder size; - the same changes applied to v0.7.0: GNOME Snapshot through PipeWire 1.6.2 and a v4l2-relayd loopback both stream with no start error and no green band. Not tested: other IPU3 sensors. By computation, patch 4 does not change the default size for sensors of at least 1281x737, which includes the OV5693 and the OV8865. Tool disclosure: this series was developed with an AI coding assistant (Claude Code, model Claude Opus 5.5) in an interactive session on the laptop. I asked it to get the front camera working. It read the libcamera sources and logs, wrote the patches, drafted the commit messages and this cover letter, and ran the builds and tests listed above on the laptop. I reviewed every change and can answer review comments on it. [1] https://lore.kernel.org/all/20261105230327.10852-1-afonso.figuinha@gmail.com/ Afonso Figuinha (4): libipa: camera_sensor_helper: Add OV9734 libcamera: camera_sensor_properties: Add OV9734 libcamera: sensor: Initialize the test pattern mode pipeline: ipu3: Apply the output margins to the default viewfinder size src/ipa/libipa/camera_sensor_helper.cpp | 14 ++++++++++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 14 +++++++++----- src/libcamera/sensor/camera_sensor_legacy.cpp | 1 + src/libcamera/sensor/camera_sensor_properties.cpp | 14 ++++++++++++++ src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- 5 files changed, 41 insertions(+), 6 deletions(-) base-commit: 25cb6cd274d3112d03d9a825e47eb2c15c70da24