From patchwork Thu Mar 24 10:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 15532 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 35E9CBD80A for ; Thu, 24 Mar 2022 10:52:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C6C3604D5; Thu, 24 Mar 2022 11:52:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1648119150; bh=Ng2v11SpSfXzdLhF4e1u4bS4uQCk4myAo62c8i2AHtQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dy4w+HGTmbc/qNvZAdcxqElQDhKowjaiHomS9u6bTtaMgBjzw/82rP9mL39QdphUg /B3yGheZpjyZxg5Bfms9CPCnrYyCDkY/CPRltnW/hr4m5ganvHGaXQnd4zL+rVTlOt wSCxOlgu5/5OsxUP0yDHaOe0q+MPqnAc/t6B8hAWOefkVTbZvNaYIJYgd4UkO1vaeV YTyNnPXjiwuLXA3ZiaTGA8rJ4PT3gb41Mg+5Li+DNp7jux7jEGyBQAXM8p6DQtulUD u0CfdYjgS4iJIYxBMkJ2uleU5xDCQ1fzsGBCk4KYAB8tykInpAOixsOfw/UkRa3T0P PXWqmxO8dh7lw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E137A601F5 for ; Thu, 24 Mar 2022 11:52:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mluzizET"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-148.catv02.itscom.jp [175.177.42.148]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 990811844; Thu, 24 Mar 2022 11:52:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1648119149; bh=Ng2v11SpSfXzdLhF4e1u4bS4uQCk4myAo62c8i2AHtQ=; h=From:To:Cc:Subject:Date:From; b=mluzizETuSDbpRCjeUk7LEFaeeVTMO2efiSgpxawkEj20Db7FGUGzSes5mzzUxQpW Bl+uXgsrMnp0nLnwQRffI4uIE05SLRs0h5MvmHPcnf3BA8qVjVQ4ZloAr+lX3rh3tF vZGoNIQaUF2ZIgbJ7s2G3C/ZEmoXZ/IU5zaLojJg= To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Mar 2022 19:52:20 +0900 Message-Id: <20220324105220.3250438-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: rkisp1: Generate configuration from main path if only one role 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: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The current logic for generating configurations assumes that we have multiple roles. The consequence of this is that if only one role is requested, and it is for viewfinder or recording, then the self path's configuration generator would be used instead of the main path's. This is what causes the default resolution on the rkisp1 pipeline handler to be 1920x1920 (since it's the max resolution of the self path). Note that the main path is still used for streaming, just that it is using self path's default configuraion (if it isn't changed by the application). This patch skips all the logic for determining which path to assign to which role in the event that only one role is requested. In this case, we simply generate the configuration from the math path. This makes the default resolution for a single stream 2592x1944. Signed-off-by: Paul Elder --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index e6fc582b..6c39494e 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -515,6 +515,16 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera if (roles.empty()) return config; + if (roles.size() == 1) { + StreamConfiguration cfg = data->mainPath_->generateConfiguration( + data->sensor_->resolution()); + + config->addConfiguration(cfg); + config->validate(); + + return config; + } + bool mainPathAvailable = true; bool selfPathAvailable = true; for (const StreamRole role : roles) {