From patchwork Fri Oct 11 18:46:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 21602 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 B0FB2C326B for ; Fri, 11 Oct 2024 18:46:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6D6716539F; Fri, 11 Oct 2024 20:46:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="fkFNwYx0"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D2A8165393 for ; Fri, 11 Oct 2024 20:46:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1728672395; cv=none; d=zohomail.com; s=zohoarc; b=VqI2pKdlOc3sUOsWnmDzCpnzmX2akMoU7ONHVEUHS5+bJHXQ+j6IbeYb3XOlnYXI5tAnqZWBMRlJOxKHqKmF+Un8FV5z0txXkdgISZD21NvH4WZXRLdHNbNThs8iRAx9SJu7J5LaWhcfqgeCJGJh8248A6awjw9+pDHHGj+F26g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728672395; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=Da02uDy0TYwajcpfyOeVb5Yo1O7mDq+rMUSHk70MY+o=; b=bekLX13zyeKfXcU8eYz1G7ceaf0m5gq+ppDeSiDI+YyQnhI7BBPHz4O+tgVr8ZHphee53VkgC+iExX0A2qKJnlFpT/zJfYIqV4+2exn4NuLja5xDbY1zyDjhjo2S5dBu6rw1mFxZopGT1TZVR8zcDbxkdcpst4AYqvlDQ2X3AzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1728672395; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=Da02uDy0TYwajcpfyOeVb5Yo1O7mDq+rMUSHk70MY+o=; b=fkFNwYx0ok8yVrLf+BSBswam+YHv9hykvQ8ul9hzCIvXYQeceX6gE5coxCYU24Rc YgRqEJQGmMHFo5Ca0H2JzMYyZYmryokrIVeJ5KiOZUJj+RZqKAaKD78QKdSdhHxRODe WDrXHlm8CU5iPK+KgD9/dlFMiulWxrB8Dk0ZXoiY= Received: by mx.zohomail.com with SMTPS id 1728672392909844.9142306216343; Fri, 11 Oct 2024 11:46:32 -0700 (PDT) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH] pipeline: simple: Consider output sizes when choosing pipe config Date: Fri, 11 Oct 2024 20:46:00 +0200 Message-ID: <20241011184600.17118-1-robert.mader@collabora.com> X-Mailer: git-send-email 2.47.0 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" In order to avoid having to adjust the size further down below which again can break user assumptions. Notably, without this the capture size of 1920x1080 gets adjusted to 1912x1080 when used with the swISP using a bayer pattern width of 4, breaking users like Gstreamer down the line. Closes https://bugs.libcamera.org/show_bug.cgi?id=236 Signed-off-by: Robert Mader --- I'm not really sure if this is the correct approach, but sending it out already for feedback. So far this gives me promissing results on tested devices. --- src/libcamera/pipeline/simple/simple.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 3ddce71d..2d185b90 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1048,7 +1048,8 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate() const Size &size = pipeConfig->captureSize; if (size.width >= maxStreamSize.width && - size.height >= maxStreamSize.height) { + size.height >= maxStreamSize.height && + pipeConfig->outputSizes.contains(maxStreamSize)) { if (!pipeConfig_ || size < pipeConfig_->captureSize) pipeConfig_ = pipeConfig; }