Show a patch.

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

{
    "id": 16274,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16274/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16274/",
    "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": "<20220620014305.26778-5-laurent.pinchart@ideasonboard.com>",
    "date": "2022-06-20T01:42:57",
    "name": "[libcamera-devel,v4,04/12] ipa: libipa: algorithm: Add init() function to the Algorithm class",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b7538b59df664e361a794c994d5ee7fe9718df36",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16274/mbox/",
    "series": [
        {
            "id": 3191,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3191/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3191",
            "date": "2022-06-20T01:42:53",
            "name": "Add tuning file support for the RkISP1 IPA module",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3191/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16274/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16274/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 4C427BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jun 2022 01:43:34 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9349D65633;\n\tMon, 20 Jun 2022 03:43:32 +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 DD9B865639\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jun 2022 03:43:26 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 520FD883;\n\tMon, 20 Jun 2022 03:43:26 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655689412;\n\tbh=Xxl+STqEGupZEhYQYUvsvYDr2vDwbtwqtSyAbTNUD/U=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=vAcYR3HgPbQBudJozWnD4aC/dF09kkezX4AzCvGSELxqp+0GyANthN4lJXb9aYzDF\n\tspPAKLYbFud5fjjE36bDRoXkmXcFAJ53kbUNfacC+c4fNzGTih63SNy6xYolOaIEfS\n\tlcBM/cVjLN5cQFC09JfoF5cwssT2+/JxTpfOB4sAjvRcY60oGg3vZ+z8R5RHDjgr8q\n\tCjnYAwUOjxUMy1RFMJyHgfA7wqlxjS2NXdVmWlYrCjNhstIkBeV8VnF8z7SicLnhRs\n\tbcQGHIQQiab46QtXh2DtPg+Hdqke8EWOtWo0yWF3e+0/yuG193gNLbC7IcvQpTX5UM\n\tP98V9eQmVmXvQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1655689406;\n\tbh=Xxl+STqEGupZEhYQYUvsvYDr2vDwbtwqtSyAbTNUD/U=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=FkMWohu1GQVxO1xKwH+kz7nGH23pOxKMzt46FP6JK1hXeLJ3VLK307O/JOAKHqpLV\n\tWPFpofBxDbIg3XwDhY58RVdNg1cn73ZBGO7ZO0Km189hXtrb2UYhYPB/TDxf4OFeWg\n\tIv+biqjy3MV7VMfbu3i6ePvsXT/57CnK7EIMVnPE="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"FkMWohu1\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 20 Jun 2022 04:42:57 +0300",
        "Message-Id": "<20220620014305.26778-5-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220620014305.26778-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220620014305.26778-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 04/12] ipa: libipa: algorithm: Add\n\tinit() function to the Algorithm class",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Florian Sylvestre <fsylvestre@baylibre.com>\n\nAdd the init() function that will be called during algorithm initialization\nto provide each algorithm the list of algorithms tuning data.\n\nSigned-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nChanges since v3:\n\n- Hardcode YamlObject as the data type of tuning data\n- Reword the Algorithm::init() documentation\n- Pass the algorithm-specific data to the init() function instead of the\n  global tuning data\n---\n src/ipa/libipa/algorithm.cpp | 13 +++++++++++++\n src/ipa/libipa/algorithm.h   |  8 ++++++++\n 2 files changed, 21 insertions(+)",
    "diff": "diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\nindex 6e0bba56ecb2..1b1fd80fb7b0 100644\n--- a/src/ipa/libipa/algorithm.cpp\n+++ b/src/ipa/libipa/algorithm.cpp\n@@ -37,6 +37,19 @@ namespace ipa {\n  * \\brief The IPA module type for this class of algorithms\n  */\n \n+/**\n+ * \\fn Algorithm::init()\n+ * \\brief Initialize the Algorithm with tuning data\n+ * \\param[in] context The shared IPA context\n+ * \\param[in] tuningData The tuning data for the algorithm\n+ *\n+ * This function is called once, when the IPA module is initialized, to\n+ * initialize the algorithm. The \\a tuningData YamlObject contains the tuning\n+ * data for algorithm.\n+ *\n+ * \\return 0 if successful, an error code otherwise\n+ */\n+\n /**\n  * \\fn Algorithm::configure()\n  * \\brief Configure the Algorithm given an IPAConfigInfo\ndiff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\nindex 356c094976d4..47cb3c01d2ce 100644\n--- a/src/ipa/libipa/algorithm.h\n+++ b/src/ipa/libipa/algorithm.h\n@@ -11,6 +11,8 @@\n \n namespace libcamera {\n \n+class YamlObject;\n+\n namespace ipa {\n \n template<typename _Module>\n@@ -21,6 +23,12 @@ public:\n \n \tvirtual ~Algorithm() {}\n \n+\tvirtual int init([[maybe_unused]] typename Module::Context &context,\n+\t\t\t [[maybe_unused]] const YamlObject &tuningData)\n+\t{\n+\t\treturn 0;\n+\t}\n+\n \tvirtual int configure([[maybe_unused]] typename Module::Context &context,\n \t\t\t      [[maybe_unused]] const typename Module::Config &configInfo)\n \t{\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "04/12"
    ]
}