[{"id":22433,"web_url":"https://patchwork.libcamera.org/comment/22433/","msgid":"<YjxnMuzVWjdBrdtv@pendragon.ideasonboard.com>","date":"2022-03-24T12:42:26","subject":"Re: [libcamera-devel] [PATCH] libcamera: rkisp1: Generate\n\tconfiguration from main path if only one role","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Thu, Mar 24, 2022 at 07:52:20PM +0900, Paul Elder via libcamera-devel wrote:\n> The current logic for generating configurations assumes that we have\n> multiple roles. The consequence of this is that if only one role is\n> requested, and it is for viewfinder or recording, then the self path's\n> configuration generator would be used instead of the main path's. This\n> is what causes the default resolution on the rkisp1 pipeline handler to\n> be 1920x1920 (since it's the max resolution of the self path). Note that\n> the main path is still used for streaming, just that it is using self\n> path's default configuraion (if it isn't changed by the application).\n\ns/configuraion/configuration/\n\n> This patch skips all the logic for determining which path to assign to\n> which role in the event that only one role is requested. In this case,\n> we simply generate the configuration from the math path. This makes the\n\ns/math/main/\n\nI like the concept of a math path better though :-)\n\n> default resolution for a single stream 2592x1944.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index e6fc582b..6c39494e 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -515,6 +515,16 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera\n>  \tif (roles.empty())\n>  \t\treturn config;\n>  \n> +\tif (roles.size() == 1) {\n> +\t\tStreamConfiguration cfg = data->mainPath_->generateConfiguration(\n> +\t\t\tdata->sensor_->resolution());\n> +\n> +\t\tconfig->addConfiguration(cfg);\n> +\t\tconfig->validate();\n> +\n> +\t\treturn config;\n> +\t}\n\nGiven that the ISP has two outputs only, we can have either one or two\nroles. It looks like the code below could then be simplified. Should\nthis function be rewritten ?\n\nLet's also note that the main and self paths don't only differ in the\nmaximum resolution they support. The main path can capture YUV 4:2:2 or\n4:2:0 in packed, semi-planar or planar variants (plus raw formats,\nunprocessed), while the self path can additionally capture YUV 4:4:4 and\n4:0:0 (but doesn't support packed YUV formats), RGB 565, 666 and 888,\nand can also support flipping and rotation. We may thus need a more\ncomplex logic here.\n\n> +\n>  \tbool mainPathAvailable = true;\n>  \tbool selfPathAvailable = true;\n>  \tfor (const StreamRole role : roles) {","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A4C3BC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Mar 2022 12:42:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BF076604D5;\n\tThu, 24 Mar 2022 13:42:29 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B79D460397\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Mar 2022 13:42:28 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 26B9E1844;\n\tThu, 24 Mar 2022 13:42:28 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648125749;\n\tbh=vysBYkzoGxqjYmKszzqWxNenKIxsXqmw9IMGujQJC8k=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=VAZ8qCF2x8mcG8A703HBeFAREHswVnY7dJcBTz2D292WH/8YmSSpUHswTMN1SOKPI\n\twBVAHe3QS1duVecVkFn7+IMx/c0aG8Y97m397HUOF+JUETmr5qC1qIbtNc8bzTdNOb\n\tEKnDnr2eVds+A5fUm5/H6JiJOcdw5XvNOobQBI9LFCne55hxs3CZyl3+1gPSwlPEx1\n\tnKzhIgaoy/snxjRi/7ACjIODNDPWCUXDlCsGwypXTThotR9aQbjC9ObRzMkrGftdXW\n\trVG5U9ZkCd2Q3chgsS4KsDPJ04ypkXwTVpBjWnWdOMsFhXtaL+hb9c/ZmnVN6q0+ub\n\tAI8sDET3bOSew==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648125748;\n\tbh=vysBYkzoGxqjYmKszzqWxNenKIxsXqmw9IMGujQJC8k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=k5a4tMfTJZfqtqbQ2j478Ap1EShezNdo8YylFKALFeI5CdBuD2wm3sAFvVuJruKS3\n\toDmg37FdwA/pCHJv8Se3ZjEZBRnTLS/MYYGRTk7AR6/prDmAhmoB0p1eW57uxPeXfm\n\tQ0mW+dJoX7IWnOhooe5d2Y6PkIdvx1ujkQIywnS8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"k5a4tMfT\"; dkim-atps=neutral","Date":"Thu, 24 Mar 2022 14:42:26 +0200","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<YjxnMuzVWjdBrdtv@pendragon.ideasonboard.com>","References":"<20220324105220.3250438-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220324105220.3250438-1-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: rkisp1: Generate\n\tconfiguration from main path if only one role","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]