From patchwork Wed Jun 22 07:46:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 16304 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 9B8D1BE173 for ; Wed, 22 Jun 2022 07:46:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BD11465635; Wed, 22 Jun 2022 09:46:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655883983; bh=mFU3HIdtSva2ilBk2+tyTogAOdDpjdpPUYZ9lBAdbSE=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xkXaxamGRueTzsu9G3+lKJJ1WisL/7mCE6U74xFC+uwhqIOrxl7w2MLpIV+kxDe+L fPCqHr+MxL+BLG+1rxcZ1vy9b8WIhkjzqv+yDjDnClcflj+SYhyehuyBZq6/nzJwTv 5GnVft5WFtC5fzLC+sG3x43Dvbg857lLfILcdbgrZvQBDH+ZDs4F5mipvjDi0QDmUs J1Uq/JH2cKLlGRgsNAVRHhSlsIpFc0/UZPyxzMEFJPP3M1bQtEBkm/yNchOjLAPwkC GG3/mbwVMtMWwPWYIGK2eP44Ar/D2oa0nyl8fzt6n4PeVp6G4f4RruPEH3mbNZd32z qNc/Z3g+t+3jA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 061BE6559A for ; Wed, 22 Jun 2022 09:46:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wU8u9wPE"; dkim-atps=neutral Received: from pyrite.rasen.tech (softbank036240125119.bbtec.net [36.240.125.119]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 920CADD; Wed, 22 Jun 2022 09:46:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655883981; bh=mFU3HIdtSva2ilBk2+tyTogAOdDpjdpPUYZ9lBAdbSE=; h=From:To:Cc:Subject:Date:From; b=wU8u9wPEH5DSMpSlORfnbYxt+gOLMvizliuyquIw94ihr+VbrN7FDf/dc/bMdrPLy 8O5WGYTrNCbt3EvXYi5iybFEfxcP1a1oIpOCqh3pNpAwBjydJYy2EQxpWu9W34vJh3 7ZHd6eAC1qUmpwjU8Eq44Ghx6XXPzQd6cRkonzFU= To: libcamera-devel@lists.libcamera.org Date: Wed, 22 Jun 2022 16:46:08 +0900 Message-Id: <20220622074608.142669-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 7cf36524..43b76e14 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) {