Show a patch.

GET /api/1.1/patches/21260/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21260,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21260/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21260/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240913103759.2166-2-umang.jain@ideasonboard.com>",
    "date": "2024-09-13T10:37:58",
    "name": "[v2,1/2] pipeline: rkisp1: Bound RkISP1 path to ISP maximum input",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4be58dcf744e5e6fc304a8ac0ee2f3ff0df141a3",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21260/mbox/",
    "series": [
        {
            "id": 4588,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4588/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4588",
            "date": "2024-09-13T10:37:57",
            "name": "pipeline: rkisp1: Filter out sensor sizes not supported by the pipeline",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4588/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21260/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21260/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 85F86C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Sep 2024 10:38:14 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 343F4634FC;\n\tFri, 13 Sep 2024 12:38:12 +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 3B8A1634E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Sep 2024 12:38:08 +0200 (CEST)",
            "from ATX.abc.com (unknown\n\t[IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C67F6EA5;\n\tFri, 13 Sep 2024 12:36:48 +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=\"v9olU9cd\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726223809;\n\tbh=yVj/SIPMZy7M9m0HCZSpq2RwX556oqea0I6BQ86aEQk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=v9olU9cdKRscSlas1VFapq2RteUrDG+O9BTSWMbganxcuqgemLadov5SQIMUdWu3N\n\tB28h5KPe2pJGvb7OacWK9zBhT0mKq1owqhm0KpiYbBG1EjJOPOweR6DAi2Ixkr9gDM\n\td2tJ6wE1zPuJANxO2S0aTi1b3lHvoUxh9BqtEXpw=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Umang Jain <umang.jain@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>",
        "Subject": "[PATCH v2 1/2] pipeline: rkisp1: Bound RkISP1 path to ISP maximum\n\tinput",
        "Date": "Fri, 13 Sep 2024 16:07:58 +0530",
        "Message-ID": "<20240913103759.2166-2-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.0",
        "In-Reply-To": "<20240913103759.2166-1-umang.jain@ideasonboard.com>",
        "References": "<20240913103759.2166-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>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 15 +++++++++++++--\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 13 ++++++++++++-\n src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  2 +-\n 3 files changed, 26 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 0a794d63..00b0dad8 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+\tconst V4L2Subdevice::Formats ispFormats = isp_->formats(0);\n+\tconst SizeRange range = ispFormats.cbegin()->second[0];\n+\tconst Size 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..08b39e1e 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,17 @@ bool RkISP1Path::init(MediaDevice *media)\n \n \tpopulateFormats();\n \n+\t/*\n+\t * The maximum size reported by the video node during populateFormats()\n+\t * is hard coded to a fixed size which can exceed the platform specific\n+\t * ISP limitations.\n+\t *\n+\t * The video node should report a maximum size according to the ISP\n+\t * model. This should be fixed in the kernel. For now, restrict the\n+\t * maximum size to the ISP limitations correctly.\n+\t */\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": [
        "v2",
        "1/2"
    ]
}