{"id":21204,"url":"https://patchwork.libcamera.org/api/1.1/patches/21204/?format=json","web_url":"https://patchwork.libcamera.org/patch/21204/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240909163719.267211-2-umang.jain@ideasonboard.com>","date":"2024-09-09T16:37:18","name":"[1/2] pipeline: rkisp1: Bound RkISP1 path to ISP maximum input","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"0eb2f5bc57a202868bc5ccb146fc025444a8e2e7","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/1.1/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21204/mbox/","series":[{"id":4571,"url":"https://patchwork.libcamera.org/api/1.1/series/4571/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4571","date":"2024-09-09T16:37:17","name":"pipeline: rkisp1: Filter out sensor sizes not supported by the pipeline","version":1,"mbox":"https://patchwork.libcamera.org/series/4571/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21204/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21204/checks/","tags":{},"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 9CC90C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Sep 2024 16:37:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C97A5634FB;\n\tMon,  9 Sep 2024 18:37:36 +0200 (CEST)","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 9922E634EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2024 18:37:33 +0200 (CEST)","from localhost.localdomain (unknown\n\t[IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F2748D4A;\n\tMon,  9 Sep 2024 18:36:16 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HSY8u9bR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725899777;\n\tbh=KTmoNqzjKa74nZWG4hb83GikNYhJ6mH0qMAdnr1XOBE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=HSY8u9bRz73kkZLCKOoOrkGF9vrMjdGsp0MkGiYyDIEi35MtWVZEUS0no/9Mf1d2Z\n\tFoC0Egb8ekfQBtUB51d5oR9wE0xUrxNwT98JIETN1g0EXmUAOJfoYQAa0Pp6D3RLUQ\n\tsOInSGnppo3S9bcegERNCitZ5KpXC3K4gcZVwMBA=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Umang Jain <umang.jain@ideasonboard.com>","Subject":"[PATCH 1/2] pipeline: rkisp1: Bound RkISP1 path to ISP maximum input","Date":"Mon,  9 Sep 2024 22:07:18 +0530","Message-ID":"<20240909163719.267211-2-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.45.0","In-Reply-To":"<20240909163719.267211-1-umang.jain@ideasonboard.com>","References":"<20240909163719.267211-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The RkISP1Path class has maximum resolution defined by\nRKISP1_RSZ_*_SRC_MAX macros. It might get updated in populateFormats()\nby querying the formats on the rkisp1_*path video nodes. However, it\ndoes not take into account the maximum resolution that the ISP can\nhandle.\n\nFor instance on i.MX8MP, 4096x3072 is the maximum supported ISP\nresolution however, RkISP1MainPath had the maximum resolution of\nRKISP1_RSZ_MP_SRC_MAX, prior to this patch.\n\nFix it by bounding the maximum resolution of RkISP1Path class by passing\nthe maximum resolution of the ISP during RkISP1Path::init().\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 15 +++++++++++++--\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  4 +++-\n src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  2 +-\n 3 files changed, 17 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 0a794d63..97ce8457 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -1274,6 +1274,17 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \tif (isp_->open() < 0)\n \t\treturn false;\n \n+\t/*\n+\t * Retrieve the ISP maximum input size for config validation in the\n+\t * path classes.\n+\t *\n+\t * The ISP maximum input size is independent of the media bus formats\n+\t * hence, pick the one first entry of ispFormats and its size range.\n+\t */\n+\tV4L2Subdevice::Formats ispFormats = isp_->formats(0);\n+\tconst SizeRange range = ispFormats.cbegin()->second[0];\n+\tSize ispMaxInputSize = range.max;\n+\n \t/* Locate and open the optional CSI-2 receiver. */\n \tispSink_ = isp_->entity()->getPadByIndex(0);\n \tif (!ispSink_ || ispSink_->links().empty())\n@@ -1300,10 +1311,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \n \t/* Locate and open the ISP main and self paths. */\n-\tif (!mainPath_.init(media_))\n+\tif (!mainPath_.init(media_, ispMaxInputSize))\n \t\treturn false;\n \n-\tif (hasSelfPath_ && !selfPath_.init(media_))\n+\tif (hasSelfPath_ && !selfPath_.init(media_, ispMaxInputSize))\n \t\treturn false;\n \n \tmainPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady);\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex c49017d1..9053af18 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -62,7 +62,7 @@ RkISP1Path::RkISP1Path(const char *name, const Span<const PixelFormat> &formats,\n {\n }\n \n-bool RkISP1Path::init(MediaDevice *media)\n+bool RkISP1Path::init(MediaDevice *media, Size ispMaxInputSize)\n {\n \tstd::string resizer = std::string(\"rkisp1_resizer_\") + name_ + \"path\";\n \tstd::string video = std::string(\"rkisp1_\") + name_ + \"path\";\n@@ -77,6 +77,8 @@ bool RkISP1Path::init(MediaDevice *media)\n \n \tpopulateFormats();\n \n+\tmaxResolution_.boundTo(ispMaxInputSize);\n+\n \tlink_ = media->link(\"rkisp1_isp\", 2, resizer, 0);\n \tif (!link_)\n \t\treturn false;\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\nindex 08edefec..13ba4b62 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -35,7 +35,7 @@ public:\n \tRkISP1Path(const char *name, const Span<const PixelFormat> &formats,\n \t\t   const Size &minResolution, const Size &maxResolution);\n \n-\tbool init(MediaDevice *media);\n+\tbool init(MediaDevice *media, Size ispMaxInputSize);\n \n \tint setEnabled(bool enable) { return link_->setEnabled(enable); }\n \tbool isEnabled() const { return link_->flags() & MEDIA_LNK_FL_ENABLED; }\n","prefixes":["1/2"]}