Show a patch.

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

{
    "id": 1354,
    "url": "https://patchwork.libcamera.org/api/patches/1354/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1354/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20190605005316.4835-7-paul.elder@ideasonboard.com>",
    "date": "2019-06-05T00:53:12",
    "name": "[libcamera-devel,v3,06/10] libcamera: ipa_module: match IPA module with pipeline handler",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0b4a34304d8c8bc30a06e079e88ebb5541fb534a",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1354/mbox/",
    "series": [
        {
            "id": 336,
            "url": "https://patchwork.libcamera.org/api/series/336/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=336",
            "date": "2019-06-05T00:53:06",
            "name": "Add IPAManager and IPAInterface",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/336/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1354/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1354/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 32B9D64723\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jun 2019 02:53:32 +0200 (CEST)",
            "from localhost.localdomain (unknown [96.44.9.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 57CA62D1;\n\tWed,  5 Jun 2019 02:53:31 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559696011;\n\tbh=d5RStYmQgp2dyUwQv6sD0WwJcVGkJn/hWKI80THwihQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=L4YE9CUieAeggNSWmBW7Mpqnx7VkFnNooaDUEBvz8gNv6zEreF5XIcVnFhtiLlB9J\n\tsH+o4nL3zfDvSmgv4t+jgXdDg6ZkhXX1x5DlBV2Rx2oUM/4hw5z+VIC2jQa7vvccfM\n\toECHAJ7mkcMwiP3wBgilZ4a2NHqyZwpllL1fFR5k=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  4 Jun 2019 20:53:12 -0400",
        "Message-Id": "<20190605005316.4835-7-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190605005316.4835-1-paul.elder@ideasonboard.com>",
        "References": "<20190605005316.4835-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 06/10] libcamera: ipa_module: match IPA\n\tmodule with pipeline handler",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Wed, 05 Jun 2019 00:53:32 -0000"
    },
    "content": "Add a method to IPAModule to check if it matches with a given pipeline\nhandler and pipeline version range.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nChanges in v3:\n- match() now takes a version range from the caller to match against,\n  instead of getting a version number from the pipeline handler input\n\nv2: New patch, but this IPAModule::match method used to be IPAManager::match\n\n src/libcamera/include/ipa_module.h |  5 +++++\n src/libcamera/ipa_module.cpp       | 20 ++++++++++++++++++++\n 2 files changed, 25 insertions(+)",
    "diff": "diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h\nindex 7ac5cad..fec4237 100644\n--- a/src/libcamera/include/ipa_module.h\n+++ b/src/libcamera/include/ipa_module.h\n@@ -13,6 +13,8 @@\n #include <libcamera/ipa/ipa_interface.h>\n #include <libcamera/ipa/ipa_module_info.h>\n \n+#include \"pipeline_handler.h\"\n+\n namespace libcamera {\n \n class IPAModule\n@@ -29,6 +31,9 @@ public:\n \n \tstd::unique_ptr<IPAInterface> createInstance();\n \n+\tbool match(PipelineHandler *pipe,\n+\t\t   uint32_t minVersion, uint32_t maxVersion) const;\n+\n private:\n \tstruct IPAModuleInfo info_;\n \ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 8ec4e5a..09e96b4 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -18,6 +18,7 @@\n #include <unistd.h>\n \n #include \"log.h\"\n+#include \"pipeline_handler.h\"\n \n /**\n  * \\file ipa_module.h\n@@ -389,4 +390,23 @@ std::unique_ptr<IPAInterface> IPAModule::createInstance()\n \treturn std::unique_ptr<IPAInterface>(ipaCreate_());\n }\n \n+/**\n+ * \\brief Verify if the IPA module maches a given pipeline handler\n+ * \\param[in] pipe Pipeline handler to match with\n+ * \\param[in] minVersion Minimum acceptable version of IPA module\n+ * \\param[in] maxVersion Maximum acceptable version of IPA module\n+ *\n+ * This method checks if this IPA module matches the \\a pipe pipeline handler,\n+ * and the input version range.\n+ *\n+ * \\return True if the pipeline handler matches the IPA module, or false otherwise\n+ */\n+bool IPAModule::match(PipelineHandler *pipe,\n+\t\t      uint32_t minVersion, uint32_t maxVersion) const\n+{\n+\treturn info_.pipelineVersion >= minVersion &&\n+\t       info_.pipelineVersion <= maxVersion &&\n+\t       !strcmp(info_.pipelineName, pipe->name());\n+}\n+\n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "06/10"
    ]
}