From patchwork Wed Feb 22 15:19:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18297 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 37CE4C329C for ; Wed, 22 Feb 2023 15:19:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5E64E62606; Wed, 22 Feb 2023 16:19:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677079173; bh=xMSBikLF+V4AF0eVUPM2TQhcjRD1TgaaxnkoKUwYyNw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EpPWu4q9xDOABzwTfz/SYSePHL76KkXqdUntrzeVkKe2n+0d/Z/AtaHDeto21csRc TubbomCXAaaO/fhlhGFkcXs8sw15BW2JtFd4oH7UIxn5lTsM8trPIYpND8ijcKD5CH btuF+nl1eF/ThIaOoQJwpXexlt1jYVgs8znpaESj8Eef1Wy6H67FVmJQGexkdJbkDA qINvjqmRyX0H6e/WOX01UXJ98Iov+/v2UE6IvhrJCSnGvP2b3GSP5nzqolaSb+rdSe 6eDGYWZy0h0et8EPhUAgw5z4WimP/fJWs+CvrX9Pg98ccV9GJzMUveK/Y92L/mBRKI pazZCHjCmERIw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E65D862606 for ; Wed, 22 Feb 2023 16:19:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Mmc+lX4r"; dkim-atps=neutral Received: from uno.homenet.telecomitalia.it (host-87-16-53-160.retail.telecomitalia.it [87.16.53.160]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 230831E7C; Wed, 22 Feb 2023 16:19:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1677079170; bh=xMSBikLF+V4AF0eVUPM2TQhcjRD1TgaaxnkoKUwYyNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mmc+lX4r1+a5vn5lv8mxhIlFAVW8MvxzUEZb6gneS9YDmQ7b0pMIEpex3c5caN8Ez zDJBKOLVyoiXbsATaW2zxtI0W81cXJPrxqpF0JN/0vlOqnH8vakwrvDKh2AqdKwGyt jIvs1CbIt2GKbfNa1OPiafDahkivY+RLxPQuaK6M= To: libcamera-devel@lists.libcamera.org Date: Wed, 22 Feb 2023 16:19:16 +0100 Message-Id: <20230222151917.669526-4-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230222151917.669526-1-jacopo.mondi@ideasonboard.com> References: <20230222151917.669526-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/4] libcamera: rkisp1: Reserve main path for StillCapture 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: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi , libcamera@luigi311.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The main output path can produce images in higher resolution and should be reserved for the StillCapture role when a configuration is generated. Before this change if StillCapture was not requested first it got assigned to the self-path and thus down-scaled to 1920x1920. With this change, StillCapture can be asked last and it would take precedence over other streams for the usage of the main path. $ cam -c1 --stream role=viewfinder --stream role=still Camera camera.cpp:969 streams configuration: (0) 1920x1080-NV12 (1) 4208x3120-NV12 Signed-off-by: Jacopo Mondi Reviewed-by: Paul Elder Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 05a7ba03b2d2..23ff859e3835 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -626,6 +626,16 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, if (roles.empty()) return config; + /* If still capture is requested, reserve the main path for it. */ + bool reserveMainPath = false; + for (const StreamRole role : roles) { + if (role != StreamRole::StillCapture) + continue; + + reserveMainPath = true; + break; + } + /* * As the ISP can't output different color spaces for the main and self * path, pick a sensible default color space based on the role of the @@ -644,6 +654,9 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, if (!colorSpace) colorSpace = ColorSpace::Sycc; + /* Unlock usage of main path which was reserved. */ + reserveMainPath = false; + size = data->sensor_->resolution(); break; @@ -685,7 +698,7 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, RkISP1Path *path; - if (useMainPath) { + if (useMainPath && !reserveMainPath) { path = data->mainPath_; mainPathAvailable = false; } else {