From patchwork Tue Mar 21 17:20:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18423 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 3D0EAC3260 for ; Tue, 21 Mar 2023 17:20:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F30BE62713; Tue, 21 Mar 2023 18:20:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679419214; bh=lBbYlayk8S/W6icFP8NLeG4EOj+Cu3jQutb7rTAiHRk=; 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=h2sAZjWVIieePxhhz2+5TrV2GaHoTOjMdplXbHeXFzB54JfHMbY2nDUR/bHee4g5b Uol7lEW2PBsLz44fuvlS8jSjoAauak9IjG6mlodjgWThy3gPwFqGwQqmSHPxlKlWuI 8L8Tz7KEXQvkVDZaKFB0SMj38o3XkXrTksWXbICO2rtJy+mK4bTXA3a2ubSMttqpZA lVOBj5t/r+JZ13dBoLS7p3LVXxTedMxvNqAOkNvukLMpzHA1ccjz6XMOm9O2ipbSId xNudx9kiht2+WoxyshRH431rudH9lCneGMV/aXiqn5n8oaZv04rGzWyanfkRjLxtUi ks0SGUrNbh+zg== 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 A248661ED1 for ; Tue, 21 Mar 2023 18:20:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZRDi0amk"; dkim-atps=neutral Received: from uno.homenet.telecomitalia.it (host-87-18-61-243.retail.telecomitalia.it [87.18.61.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C904A496; Tue, 21 Mar 2023 18:20:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679419212; bh=lBbYlayk8S/W6icFP8NLeG4EOj+Cu3jQutb7rTAiHRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRDi0amkqbPHqfd0PSTLxcNmr3DRHJDDPh7yp6160lFYhaandtbUcitjgDvo4xi4b WldxjTQ6cunsr9UByCkJbmumtO2Gge/JiIGAp+4UGgam/03CU20tdVTsZLmkC+yPAz x6aIKSy6q2t/A7fVHUgTq6vHvurCah4jsEpnlJ7U= To: libcamera-devel@lists.libcamera.org Date: Tue, 21 Mar 2023 18:20:01 +0100 Message-Id: <20230321172004.176852-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230321172004.176852-1-jacopo.mondi@ideasonboard.com> References: <20230321172004.176852-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 8a30fe061d04..fd331168af80 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; @@ -681,12 +674,11 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera, RkISP1Path *path; - if (useMainPath) { + if (mainPathAvailable) { path = data->mainPath_; mainPathAvailable = false; } else { path = data->selfPath_; - selfPathAvailable = false; } StreamConfiguration cfg =