Show a patch.

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

{
    "id": 14766,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14766/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14766/",
    "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": "<20211125054259.24792-6-jeanmichel.hautbois@ideasonboard.com>",
    "date": "2021-11-25T05:42:53",
    "name": "[libcamera-devel,v5,05/11] ipa: rkisp1: Introduce IPAContext",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5a559f1889252a4dc887b0539d59dc7c3d895d8a",
    "submitter": {
        "id": 75,
        "url": "https://patchwork.libcamera.org/api/1.1/people/75/?format=api",
        "name": "Jean-Michel Hautbois",
        "email": "jeanmichel.hautbois@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14766/mbox/",
    "series": [
        {
            "id": 2752,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2752/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2752",
            "date": "2021-11-25T05:42:48",
            "name": "Introduce AGC for RkISP1",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2752/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14766/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14766/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 BD4CCBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 05:43:14 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8553A603D9;\n\tThu, 25 Nov 2021 06:43:13 +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 D1FCD6011E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 06:43:04 +0100 (CET)",
            "from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:d9a5:5e40:3323:d95])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8E31690E;\n\tThu, 25 Nov 2021 06:43:04 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pS5F5FFD\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637818984;\n\tbh=/AillO5/wmQaq9rVhDawE0pFgfQm1NqVClMmCk2E5ig=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=pS5F5FFDZDSCHDKzihE/O0KRwwmUsmr/I/aKG5dK4oMPAKmIq9koXklThtq7N3kmx\n\tSJtZ0HEnTZ5bg1Hz/uCRFedUJxic56Kse5BgiHNa6ih1oeBS8UWX89u1UTw50yxugy\n\ti0XIbIVln+L/LNms5HG+SqDP5zp7WjSr2NtvN4Xo=",
        "From": "Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 25 Nov 2021 06:42:53 +0100",
        "Message-Id": "<20211125054259.24792-6-jeanmichel.hautbois@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.32.0",
        "In-Reply-To": "<20211125054259.24792-1-jeanmichel.hautbois@ideasonboard.com>",
        "References": "<20211125054259.24792-1-jeanmichel.hautbois@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 05/11] ipa: rkisp1: Introduce IPAContext",
        "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": "Before using any algorithm, we want the IPAContext to be ready for\nthose. Introduce the IPAContext following the existing design from\nIPA::IPU3. Each algorithm will then introduce the needed fields.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nv4: use #pragma once\n---\n src/ipa/rkisp1/ipa_context.cpp | 58 ++++++++++++++++++++++++++++++++++\n src/ipa/rkisp1/ipa_context.h   | 28 ++++++++++++++++\n src/ipa/rkisp1/meson.build     |  7 +++-\n src/ipa/rkisp1/rkisp1.cpp      |  7 ++++\n 4 files changed, 99 insertions(+), 1 deletion(-)\n create mode 100644 src/ipa/rkisp1/ipa_context.cpp\n create mode 100644 src/ipa/rkisp1/ipa_context.h",
    "diff": "diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\nnew file mode 100644\nindex 00000000..819b2c73\n--- /dev/null\n+++ b/src/ipa/rkisp1/ipa_context.cpp\n@@ -0,0 +1,58 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021, Ideas On Board\n+ *\n+ * ipa_context.cpp - RkISP1 IPA Context\n+ */\n+\n+#include \"ipa_context.h\"\n+\n+/**\n+ * \\file ipa_context.h\n+ * \\brief Context and state information shared between the algorithms\n+ */\n+\n+namespace libcamera::ipa::rkisp1 {\n+\n+/**\n+ * \\struct IPASessionConfiguration\n+ * \\brief Session configuration for the IPA module\n+ *\n+ * The session configuration contains all IPA configuration parameters that\n+ * remain constant during the capture session, from IPA module start to stop.\n+ * It is typically set during the configure() operation of the IPA module, but\n+ * may also be updated in the start() operation.\n+ */\n+\n+/**\n+ * \\struct IPAFrameContext\n+ * \\brief Per-frame context for algorithms\n+ *\n+ * The frame context stores data specific to a single frame processed by the\n+ * IPA. Each frame processed by the IPA has a context associated with it,\n+ * accessible through the IPAContext structure.\n+ *\n+ * \\todo Detail how to access contexts for a particular frame\n+ *\n+ * Each of the fields in the frame context belongs to either a specific\n+ * algorithm, or to the top-level IPA module. A field may be read by any\n+ * algorithm, but should only be written by its owner.\n+ */\n+\n+/**\n+ * \\struct IPAContext\n+ * \\brief Global IPA context data shared between all algorithms\n+ *\n+ * \\var IPAContext::configuration\n+ * \\brief The IPA session configuration, immutable during the session\n+ *\n+ * \\var IPAContext::frameContext\n+ * \\brief The frame context for the frame being processed\n+ *\n+ * \\todo While the frame context is supposed to be per-frame, this\n+ * single frame context stores data related to both the current frame\n+ * and the previous frames, with fields being updated as the algorithms\n+ * are run. This needs to be turned into real per-frame data storage.\n+ */\n+\n+} /* namespace libcamera::ipa::rkisp1 */\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nnew file mode 100644\nindex 00000000..919139dd\n--- /dev/null\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -0,0 +1,28 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021, Ideas On Board\n+ *\n+ * ipa_context.h - RkISP1 IPA Context\n+ *\n+ */\n+\n+#pragma once\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1 {\n+\n+struct IPASessionConfiguration {\n+};\n+\n+struct IPAFrameContext {\n+};\n+\n+struct IPAContext {\n+\tIPASessionConfiguration configuration;\n+\tIPAFrameContext frameContext;\n+};\n+\n+} /* namespace ipa::rkisp1 */\n+\n+} /* namespace libcamera*/\ndiff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\nindex f76b37f5..3683c922 100644\n--- a/src/ipa/rkisp1/meson.build\n+++ b/src/ipa/rkisp1/meson.build\n@@ -2,8 +2,13 @@\n \n ipa_name = 'ipa_rkisp1'\n \n+rkisp1_ipa_sources = files([\n+    'ipa_context.cpp',\n+    'rkisp1.cpp',\n+])\n+\n mod = shared_module(ipa_name,\n-                    ['rkisp1.cpp', libcamera_generated_ipa_headers],\n+                    [rkisp1_ipa_sources, libcamera_generated_ipa_headers],\n                     name_prefix : '',\n                     include_directories : [ipa_includes, libipa_includes],\n                     dependencies : libcamera_private,\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 73a7f582..34c3f9a2 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -25,6 +25,7 @@\n \n #include <libcamera/internal/mapped_framebuffer.h>\n \n+#include \"ipa_context.h\"\n #include \"libipa/camera_sensor_helper.h\"\n \n namespace libcamera {\n@@ -78,6 +79,9 @@ private:\n \n \t/* Interface to the Camera Helper */\n \tstd::unique_ptr<CameraSensorHelper> camHelper_;\n+\n+\t/* Local parameter storage */\n+\tstruct IPAContext context_;\n };\n \n int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision)\n@@ -164,6 +168,9 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n \t\t<< \"Exposure: \" << minExposure_ << \"-\" << maxExposure_\n \t\t<< \" Gain: \" << minGain_ << \"-\" << maxGain_;\n \n+\t/* Clean context at configuration */\n+\tcontext_ = {};\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "05/11"
    ]
}