From patchwork Tue Jun 6 10:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18709 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 1A0FCC3200 for ; Tue, 6 Jun 2023 10:33:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E1286289E; Tue, 6 Jun 2023 12:33:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686047634; bh=29CLqUIJtUNbeJst7Mv1Xb+oxR7fwUW9vEEbTbKj7fI=; 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=jDS0oRcQGxkCafHBJDB30iExXQfxFmYQk86YVjKzKygptdyPpwz9DEwUSeHGb+VW1 21sUEtxkvTJAPM4FFu4oqhHYLjSDp2hZfiEMVhswremSSLlVcwaE966wE+M5oUmzNS N0S7mQyYgHqSYzhySgj0iISbjz93dzCwoBunhBtod9kilNTtLqA4s+e3tDoApTv3VS MJpDPOrhifIJLLs3sVXLF9tpL2pKC+E2qqIKnZU7SzHbCqACmGdwPI8c7PNMScFsRO gpel5BMih+/z4CBSAbB3Eum5OHDHNEy/S82zgi3CYqe4pUwpAeCUE05bhaWwCQKnfg zbEZs8wZJCqNA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F3BD62722 for ; Tue, 6 Jun 2023 12:33:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PT3hoogW"; dkim-atps=neutral Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D74B76B5; Tue, 6 Jun 2023 12:33:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1686047607; bh=29CLqUIJtUNbeJst7Mv1Xb+oxR7fwUW9vEEbTbKj7fI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PT3hoogWDpE+y/I89kIRm2n8FT1H0bJBJxMjiF23+OVUuZya7GBY7MjdlIB86JJv9 Ud+ALtwEfoFd+FEoeGFprTHsrJXVJe+q6FMneNCcQp+xSVFgYfSmdfHtkY+3g9tJ7j jFg5OzgStlf2XwwbGPJGrhXjLRoSe3iwgRWMBPSI= To: libcamera-devel@lists.libcamera.org Date: Tue, 6 Jun 2023 12:33:33 +0200 Message-Id: <20230606103336.17782-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606103336.17782-1-jacopo.mondi@ideasonboard.com> References: <20230606103336.17782-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 1/4] libcamera: rkisp1: Generate config using main path 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 generateConfiguration() implementation in the Rockchip RkISP1 pipeline handler uses by default the self path (if available) for the Viewfinder and VideoRecording StreamRoles. The validate() implementation, at the contrary, prefers using the main path, when available, for all streams. As the self-path is limited in output resolution to 1920x1920, generating a configuration using the self path limits the maximum stream size to 1920x1920, while higher resolutions can be obtained by using the main path. Align the generateConfiguration() implementation to the validate() one by using the main path by default if available. Bug: https://bugs.libcamera.org/show_bug.cgi?id=180 Reported-by: libcamera@luigi311.com Signed-off-by: Jacopo Mondi Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 8a30fe061d04..78c4a6dd60a4 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -630,23 +630,18 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, * first stream and use it for all streams. */ std::optional colorSpace; - bool mainPathAvailable = true; - bool selfPathAvailable = data->selfPath_; for (const StreamRole role : roles) { - bool useMainPath; switch (role) { case StreamRole::StillCapture: - useMainPath = mainPathAvailable; /* JPEG encoders typically expect sYCC. */ if (!colorSpace) colorSpace = ColorSpace::Sycc; break; case StreamRole::Viewfinder: - useMainPath = !selfPathAvailable; /* * sYCC is the YCbCr encoding of sRGB, which is commonly * used by displays. @@ -656,7 +651,6 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, break; case StreamRole::VideoRecording: - useMainPath = !selfPathAvailable; /* Rec. 709 is a good default for HD video recording. */ if (!colorSpace) colorSpace = ColorSpace::Rec709; @@ -669,7 +663,6 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, return nullptr; } - useMainPath = true; colorSpace = ColorSpace::Raw; break; @@ -679,14 +672,21 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, return nullptr; } + /* + * Prefer the main path if available, as it supports higher + * resolutions. + * + * \todo Using the main path unconditionally hides support for + * RGB (only available on the self path) in the streams formats + * exposed to applications. This likely calls for a better API + * to expose streams capabilities. + */ RkISP1Path *path; - - if (useMainPath) { + if (mainPathAvailable) { path = data->mainPath_; mainPathAvailable = false; } else { path = data->selfPath_; - selfPathAvailable = false; } StreamConfiguration cfg =