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: From patchwork Thu Nov 5 23:07:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Figuinha X-Patchwork-Id: 28783 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 1E6E2C3307 for ; Fri, 6 Nov 2026 06:12:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A6AA16A7D3; Fri, 6 Nov 2026 07:12:09 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="riux1Sy/"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ADF286A7BE for ; Fri, 6 Nov 2026 00:07:19 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-48e1d0e5dafso746063f8f.1 for ; Thu, 05 Nov 2026 15:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793920039; x=1794524839; 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=x6XPaPRm06zcp+1USz6fB81RC6Kaz66xrbhq6Op0k+c=; b=riux1Sy/+DBC8EaS53BNq1cBPQJeuMmHMkdDfEZ9UoyKMZOXzoO2P2c6bbXZ1tkkyK E+M3Re3wvJMZWsB1CqNUeqFdY59903dD/E8fyZiIjTm+wsOJJdrebKKYeZhuoEVswabq hFRFYxYBSsduwqxZ2pqV0xFcs9YmDlaN/rDedijhAIeY70KeoQKADV+VWFhkw6n+Rv3k G24i6Dp9ucB/2fJHxJWNzDyysweEAI9TGorkgllIMBwdP7+fZqVkwCCiIQOOsfcRm+ur vxsh1B5yVxSJ9pEtv9iYYYO0LsiSCBmU5fYl2Df8qzQ6gGlx55CfvwBQ0eiXmjcNp5qT vSjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793920039; x=1794524839; 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=x6XPaPRm06zcp+1USz6fB81RC6Kaz66xrbhq6Op0k+c=; b=BEAks1cUq0nPAicYBGpk7klyAkIdekydJqCWxIIIY8IwGpsq4VnxuUtK8T0sq300R9 U/SJJKQLP/KcqRvoImmHJ8/clbi4CfXTJTtl/AcqEtAEnrFHSCBYsyolPF1ytU03D3zR KtAtB5Yctziz01OA+Yh5QIahNw3KlqgN1/iXkquYRuXBynIHkENdaZzdryYjI+6eYCUl 3cqm0/nde0rXiaNtz93WIygQI7hfV7ksgBOPdeiWi409UboGSlEDnkyW49Lc7FSfPUXn QcQduLcEuwZsKsTxTnvGffk93abz4CTerzovvJTYMWgcNFs1Ciz0tppFDnnMhYifoQ1Y KS2Q== X-Gm-Message-State: APuU4Z8THS+kBW9isOKBYw/Oh17zOKu8e/wLu6WuK6UFj0lFSdPDtjMb AL3kR6s4cyCmcZADZ1X2JyySL85sxoidRZo4jkmY6ikI36dPAdc6VHaLHbFtzIrr X-Gm-Gg: AYBFou2bmhYp4aLtlcAwz4C2hPwkcvn/5MJE4tXdWyE91fbasnGDhxhtBvzP2S+HkuS wwhryzDcqxmeyacA2isU1iNsUz+lGhviX8mSCteATJrDZWrezJNpvyp1HaL34qRdDL49HWHuBsb +NwLmTXsMPsfROCE4ARhEmzP6Y/2dw4IA8AwT2Y6ezeaHuM239daK8WLkQnpvfir4tWKQT7DKUL Q5lAN2Z1pMwWOonWwbl6Fu46M+XjxQWiMLmz+CQZnlgPCRbbR2Fs5S+KZKxh7zt5LXhq68ui8c8 4Q3bpVMgNCow9/KvBKbhImXVlWKiF/8J9SVTSPUauSHpoeYXtwYQ1cuqWuyesQdxJJLFOlqlL2a T36c75G0ndmqBgi9TuJA4tFgYsR7aMBBoDKfdPDtXSVaWwrgQrZGQkKUDJ2Y/19dkqIo3P9PFzd jn1BqAT6SCtKAQrF3mIPDz7SKs+Kf0Dd/Hpj3oZPDLKok21AYjtLG07u/KvvDKviis5hT04wuv0 w/6GOawAdx+lewC41zrAuTivMSkycVK1KZm4bXI3/c8I8IbHzas8KjzXw4Ri8MFs3B4KZ+NVl2P yd1tpGv9jp/4WCboqVsiod0qOfmVvNGWXk30SwYW3NQqE27RcuUsQVtsgCtmlGKwFDggPg== X-Received: by 2002:a5d:5e91:0:b0:48e:6669:fefb with SMTP id ffacd0b85a97d-4927997bcb0mr1887782f8f.22.1793920039155; Thu, 05 Nov 2026 15:07:19 -0800 (PST) Received: from figssurface ([176.223.29.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-492d3d60e94sm183428f8f.2.2026.11.05.15.07.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 15:07:18 -0800 (PST) From: Afonso Figuinha To: libcamera-devel@lists.libcamera.org Subject: [PATCH 2/4] libcamera: camera_sensor_properties: Add OV9734 Date: Thu, 5 Nov 2026 23:07:06 +0000 Message-ID: <20261105230708.14601-3-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 the OmniVision OV9734 to the camera sensor properties database. The pixel size is 1.4 um x 1.4 um according to the OmniVision product brief. The Linux driver exposes five test patterns. Only "Disabled" and "Standard Color Bar" have a matching libcamera test pattern mode. 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/libcamera/sensor/camera_sensor_properties.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 20cfd0bc..33f1ab7c 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -553,6 +553,20 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen }, .sensorDelays = { }, } }, + { "ov9734", { + .unitCellSize = { 1400, 1400 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + /* + * No corresponding test pattern mode for: + * 2: "Top-Bottom Darker Color Bar" + * 3: "Right-Left Darker Color Bar" + * 4: "Bottom-Top Darker Color Bar" + */ + }, + .sensorDelays = { }, + } }, { "ov9281", { .unitCellSize = { 3000, 3000 }, .testPatternModes = { }, From patchwork Thu Nov 5 23:07:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Figuinha X-Patchwork-Id: 28784 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 D6165C335C for ; Fri, 6 Nov 2026 06:12:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7AF8F6914B; Fri, 6 Nov 2026 07:12:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="zqs2igf0"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 93AAC6A7C1 for ; Fri, 6 Nov 2026 00:07:20 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4a5177d78c7so448955e9.2 for ; Thu, 05 Nov 2026 15:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793920040; x=1794524840; 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=dx+ZV6Okd+V6CKZfa9pMXnFOdf8oMGb0/UQlyrCbwHY=; b=zqs2igf0eCRJp7EGfS/y0uz9upLQUOcdG9Lk3hujwHGaBoTzAPdUran1q5noAiCVSc QgF8b3pdkNhS16u3c4t3V3hFuXi/UbYUK3cm0deTItqtF8kg9UoyXr+/WZSyg5JFIrQf gt2n615xnxe0l9cefyhVHJTAbD9ZmIYzFOoAVSwR7DF+r/kjMmwtO9/0GNG7Zj1JnSKl E1z7vyRS/WE42tyKo/ZqK/T0bonF3bDSP0kDs+ImAoubkSlxSD4cTaZ+95BS9Siv0XIt 6U3KoCFR6MAjn22Fc75dShoCfWPdf09vvimcusWvgZ1gFodXWIHkB2tNflsheS5gZUDx 3WYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793920040; x=1794524840; 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=dx+ZV6Okd+V6CKZfa9pMXnFOdf8oMGb0/UQlyrCbwHY=; b=Y1R1ILS2pLpTNv06msBHzWGt98rCbsKBGJMARSPc0U74Mb7C1d1QXBDtD+78wkOzc9 iBFNlwhH4J+C3xMrNE6c8UJZ/M9q5SAcBzq6+aPDMGk+OlJ3+Ya1txMyHntE9qSx1RJf B7IpK+PYb9AtfWJB2R70R1rX8iHj4qw6vSSNzozrPTCSwpZcyMyjyZbd66LvO9Xt40H8 Z7xveHOf6DmVggqf5aVMabeqYd6akBorCJk5Xzph+meJayyJKgReGUYGot4gh08yWkpM SOi6fM8E1jaW85kZ0V3pFb/6wpydbBbC2Hesijax9wrgDqMhBEkkEaofAu/Pfx+Aa6xb dlvQ== X-Gm-Message-State: APuU4Z9hlbi5UBwEVRdbGb6GzZNg4hIyuT/9xWGe47UKfXpE2FxnLnDK mNLoejStns/jlk8qMhDJur8wqHsMUqKck9xqSOYs+wBM0cLcjHCPGg+DaDzu85Hr X-Gm-Gg: AYBFou1i8jmGxGybSaGNrsnPBK2f8cQtzEwyw1dHCKk6KtfRfluwxRIL/ja4OCdL6Fv nwaYt92Q5gevPqAFwpVcLGkuIWLPxerMY/C3XX0Ndc9tIv5tioB8nntmARCD6BWMSTjLrimgwA1 gydWlrsFkqh86OCj17LTiBLwLHEpdLRHKfL+dmAlDqWcmXgHTlfJiFeVli18f7RNcMU5ikB5stm 6F+xnuBYYd2LpGTlBq+3jwDfBTed6jPT8YHUg0r2I5cqo2it3TSO7juEq2wcWDUv40+qN25tXOv 7+xioFhxp+NzPNA+HT/ZfpG1Bwj1HAnPVGeYAMIwB5TV6PcBLZsP3ipwCRq5vrISJ4vf/Apqfgi 8o2DzBIEgXRlJCadZX0z3oug/gR1sQJh0FcbfX93rgaZjgIcho2uJt7qVwTFjDO39Oo2Sej4AYv 1sme/KYUT1ZKQWANSlFbnY3Jt9C+zBJ5CoDnYlyldVFZHKAf25oQJDKAoU6F4wAf8EyiShd4V/M l1tAHq9XMoGTSIGhcVTq60CVNuUzqDqIyySTonJ1LeIIPcLEdMmIPKNlPhXW7sxxwYo0z6dQeFK kX3IsLHLx8Qmd2P+yEDQyUazG0W3YKoGAI35ITV0atg3rYqolW4PF8Cwq6dMZChnmF4XKw== X-Received: by 2002:a05:600c:1c08:b0:4a5:5fb9:5d35 with SMTP id 5b1f17b1804b1-4b6df5eac1amr10248335e9.21.1793920039994; Thu, 05 Nov 2026 15:07:19 -0800 (PST) Received: from figssurface ([176.223.29.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-492d3d60e94sm183428f8f.2.2026.11.05.15.07.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 15:07:19 -0800 (PST) From: Afonso Figuinha To: libcamera-devel@lists.libcamera.org Subject: [PATCH 3/4] libcamera: sensor: Initialize the test pattern mode Date: Thu, 5 Nov 2026 23:07:07 +0000 Message-ID: <20261105230708.14601-4-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" testPatternMode_ is never initialized in CameraSensorLegacy and CameraSensorRaw. init() calls applyTestPatternMode(TestPatternModeOff), but that function returns early without updating testPatternMode_ when the sensor has no test pattern modes, which is the case for sensors missing from the camera sensor properties database. setTestPatternMode() then compares the requested mode with an uninitialized value. When the pipeline handler disables the test pattern before starting the camera, as the IPU3 pipeline handler does, the result depends on that value: the call either returns 0 or fails with -EINVAL, and Camera::start() fails intermittently. Initialize testPatternMode_ to TestPatternModeOff, which is the mode init() applies. 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. Fixes: 7ee7dc3369eb ("camera_sensor: Suppress error message if test patterns are unavailable") Signed-off-by: Afonso Figuinha --- src/libcamera/sensor/camera_sensor_legacy.cpp | 1 + src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index 792e4b09..fe5664e0 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -156,6 +156,7 @@ private: CameraSensorLegacy::CameraSensorLegacy(const MediaEntity *entity) : entity_(entity), pad_(UINT_MAX), staticProps_(nullptr), + testPatternMode_(controls::draft::TestPatternModeOff), bayerFormat_(nullptr), supportHFlips_(false), supportVFlips_(false), flipsAlterBayerOrder_(false), properties_(properties::properties) { diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index 55b386ce..58fdbfb7 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -164,7 +164,9 @@ private: */ CameraSensorRaw::CameraSensorRaw(const MediaEntity *entity) - : entity_(entity), staticProps_(nullptr), supportHFlips_(false), + : entity_(entity), staticProps_(nullptr), + testPatternMode_(controls::draft::TestPatternModeOff), + supportHFlips_(false), supportVFlips_(false), flipsAlterBayerOrder_(false), properties_(properties::properties) { From patchwork Thu Nov 5 23:07:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Figuinha X-Patchwork-Id: 28785 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 87116C3307 for ; Fri, 6 Nov 2026 06:12:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 226B76A7CD; Fri, 6 Nov 2026 07:12:11 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J8GVxyU2"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 638106A7C4 for ; Fri, 6 Nov 2026 00:07:21 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-48e47347279so43432f8f.1 for ; Thu, 05 Nov 2026 15:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793920041; x=1794524841; 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=9F+E294l2adgu9wF3wmw1CTlrEDywg6wMQdAx9enBB8=; b=J8GVxyU21zD7Qd6ryXmnhBfIWEZwIWtpm6IkZellR8vH7UJDVRwhehfoC8ZTR39puo PQnCsV2nLjiDFoSua2oWOAnAey+Xdin1UqxTXyncRxYPzPkqCTBoEWZNtykethp2ZoOH EY0BBZ5Jd4rE1fA7YjI0I3vPibHnhcSX0SViNHIzfJ2rKexeumQBOExrqmIqkI/2uGpy kZhyGYVItvxGMmt0/flLsvi4SiIJpZ+mxRXdGH584zQ7XXTqhKcRAYUUxzzM6yaNlDUl LR1LBQf4Iw6FtxYfXhmYHONdHwQu0yOt40vhY8QmwpthzlE9y+7xiS50r8QwI/e/uZNI kQ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793920041; x=1794524841; 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=9F+E294l2adgu9wF3wmw1CTlrEDywg6wMQdAx9enBB8=; b=oliHhlNiX9q97dLGvdQO6MRIxCEhxvFNyMs0Oh0BuwngiGoet30IbfZlW0XLlSwTku jWUcDOm0ItS5XczCy5kM9GndP2f5Nserryrp/0F22uFk+3KuVlQ7FPu9w1JOKBLlYv7D moG54tcDKnJqN02N8UAXJlLnxWlzJcLlXZYmmfNH+b0faGdimC3DLZ5lxALfQ+F8uWbS 7DKU2yFCNFwnVPZcwC5ntz93rdwC+V6epDyGBIfXyEmSEZnxw625Lf6eBLy41VLL7Jph ZSRDPf1TfQvpBL8B21zfN1xHlnFEpXQvz4lhp84Ou2XKL3Ogq1oAUOMQLUoH9YBNhc7H Ic4Q== X-Gm-Message-State: APuU4Z+d1JcoAXQ3FDhx6Izu72038PiuvAc+r6W5zIsRmZEieRJq1JHN X0Tc5SypyV8x7wHJsAmIQqOWZOplMNW8Sh/UqhNs/vnxlFrf/mWmDjgfjkC8ZhdP X-Gm-Gg: AYBFou0K7heXikEe7igeKAkoz39TkqkJEZrZWelOb7rmnq9+dEDoZo7VUsB9feX9O3L h9DVuiWBZnZepReocWk0whiOHlILXtmsf0+1El/F5wiaEcGKt5E6EiAUYsKAFCJ0QLtUnzOTq4U /Lsj3KfRsAVbvZfoEYNRqN8YsJKtRGnbKCpC3VV1bhAvBsRlMTkh7iwbT1lPzk6Gqe8oiKptQIP 21Ge/6qDJD0n6V6gsFIhdxMBtd18bXSFHQYIW7bjn93iZVCptcDUJIl/xy7upSsr9ivwu2fp0ih 25ABh8tcy0E9hQ1hkmq600LShcwF1Idpjed7nRwDyMM3Ale37gsQnEB0/BXGQ4dFk0ROiuE+lTf rsFENeDrURqHcH7R/U5Jw4TiMeIHEyuo0OPGbhOduGXa96hsUxTRRsOWi3E1bv1r4cWCYCUTSze u77p7ZQcw0xYbjZdCwUEkhc8etQEToocm+EXOfR+VlOQbs8lbZcB+ChaJBq3UxnG7/wPUVu2QJa PaazXoXVDl71Hv0Y44OyCElFFTZaTWL9W6Mr1hgT/jzEvS33ZoguWOoDsmQFHG+Q3zFpNxcqhc0 FAw7ORq54HC9jnsiF83wZ+rzG7r9uQpR0vyeqrC0Suq+5fgMBXqddiOIIF7Yy/sY4XB6S1k= X-Received: by 2002:a05:6000:26cb:b0:491:e062:383d with SMTP id ffacd0b85a97d-4928030bd26mr1726935f8f.57.1793920040764; Thu, 05 Nov 2026 15:07:20 -0800 (PST) Received: from figssurface ([176.223.29.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-492d3d60e94sm183428f8f.2.2026.11.05.15.07.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 15:07:20 -0800 (PST) From: Afonso Figuinha To: libcamera-devel@lists.libcamera.org Subject: [PATCH 4/4] pipeline: ipu3: Apply the output margins to the default viewfinder size Date: Thu, 5 Nov 2026 23:07:08 +0000 Message-ID: <20261105230708.14601-5-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" For the Viewfinder and VideoRecording roles, generateConfiguration() caps the default size and the advertised maximum size to the sensor resolution and to 1280x720. validate() is stricter: it makes the output strictly smaller than the CIO2 output and aligns it down to 64 pixels horizontally and 32 lines vertically. For sensors whose resolution is close to 1280x720 the two disagree. The OmniVision OV9734 has a resolution of 1296x734, so generateConfiguration() offers 1280x720 and validate() adjusts it to 1280x704. Applications that use the advertised sizes then pick a size the pipeline cannot produce. With PipeWire 1.6.2, the libcamera SPA plugin offers 1280x720 to clients, GNOME Snapshot selects it, and the frames it displays have a green band at the bottom. Apply the same margins as validate(), and as the StillCapture role already does, before capping to 1280x720. Sensors with a resolution of at least 1281x737 keep the 1280x720 default. 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/libcamera/pipeline/ipu3/ipu3.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 14cab9e5..4958c956 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -444,12 +444,16 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, std::span