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