Show a patch.

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

{
    "id": 2032,
    "url": "https://patchwork.libcamera.org/api/patches/2032/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2032/",
    "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": "<20190927024417.725906-9-niklas.soderlund@ragnatech.se>",
    "date": "2019-09-27T02:44:12",
    "name": "[libcamera-devel,v3,08/13] libcamera: ipa: Extend to support IPA interactions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "47dc49efd1b209ec18fbfa9521d7a1b9c918f920",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2032/mbox/",
    "series": [
        {
            "id": 508,
            "url": "https://patchwork.libcamera.org/api/series/508/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=508",
            "date": "2019-09-27T02:44:04",
            "name": "libcamera: ipa: Add basic IPA support",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/508/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2032/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2032/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 363C66191D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Sep 2019 04:45:31 +0200 (CEST)",
            "from bismarck.berto.se (unknown [84.172.88.101])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid cf80c3f3-e0d0-11e9-bdc3-005056917a89;\n\tFri, 27 Sep 2019 04:45:05 +0200 (CEST)"
        ],
        "X-Halon-ID": "cf80c3f3-e0d0-11e9-bdc3-005056917a89",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 27 Sep 2019 04:44:12 +0200",
        "Message-Id": "<20190927024417.725906-9-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20190927024417.725906-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190927024417.725906-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 08/13] libcamera: ipa: Extend to\n\tsupport IPA interactions",
        "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>",
        "X-List-Received-Date": "Fri, 27 Sep 2019 02:45:31 -0000"
    },
    "content": "The IPA interface needs to support interactions with the pipeline, add\ninterfaces to control the sensor and handling of request ISP parameters\nand statistics.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/ipa/ipa_interface.h             |  21 +++++\n src/ipa/ipa_dummy.cpp                   |   6 +-\n src/libcamera/ipa_interface.cpp         | 106 ++++++++++++++++++++++++\n src/libcamera/proxy/ipa_proxy_linux.cpp |  13 ++-\n 4 files changed, 137 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h\nindex 2c5eb1fd524311cb..feeb00b1b1315ca5 100644\n--- a/include/ipa/ipa_interface.h\n+++ b/include/ipa/ipa_interface.h\n@@ -7,14 +7,35 @@\n #ifndef __LIBCAMERA_IPA_INTERFACE_H__\n #define __LIBCAMERA_IPA_INTERFACE_H__\n \n+#include <libcamera/controls.h>\n+#include <libcamera/signal.h>\n+\n+#include \"v4l2_controls.h\"\n+\n namespace libcamera {\n \n+class BufferMemory;\n+class Request;\n+struct IPAMetaData;\n+\n class IPAInterface\n {\n public:\n \tvirtual ~IPAInterface() {}\n \n \tvirtual int init() = 0;\n+\n+\tvirtual void initSensor(const V4L2ControlInfoMap &controls) = 0;\n+\tvirtual void initBuffers(unsigned int type, const std::vector<BufferMemory> &buffers) = 0;\n+\n+\tvirtual void signalBuffer(unsigned int type, unsigned int id) = 0;\n+\n+\tvirtual void queueRequest(unsigned int frame, const ControlList &controls) = 0;\n+\n+\tSignal<unsigned int, V4L2ControlList> updateSensor;\n+\tSignal<unsigned int, unsigned int, unsigned int> queueBuffer;\n+\tSignal<unsigned int, int, int> setDelay;\n+\tSignal<unsigned int, IPAMetaData> metaDataReady;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/ipa_dummy.cpp b/src/ipa/ipa_dummy.cpp\nindex 9d0cbdc8b1ad5565..4d429f20d7aaa955 100644\n--- a/src/ipa/ipa_dummy.cpp\n+++ b/src/ipa/ipa_dummy.cpp\n@@ -15,7 +15,11 @@ namespace libcamera {\n class IPADummy : public IPAInterface\n {\n public:\n-\tint init();\n+\tint init() override;\n+\tvoid initSensor(const V4L2ControlInfoMap &controls) override {}\n+\tvoid initBuffers(unsigned int type, const std::vector<BufferMemory> &buffers) override {}\n+\tvoid signalBuffer(unsigned int type, unsigned int id) override {}\n+\tvoid queueRequest(unsigned int frame, const ControlList &controls) override {}\n };\n \n int IPADummy::init()\ndiff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\nindex d7d8ca8881efcf66..79853771c70f15d4 100644\n--- a/src/libcamera/ipa_interface.cpp\n+++ b/src/libcamera/ipa_interface.cpp\n@@ -24,4 +24,110 @@ namespace libcamera {\n  * \\brief Initialise the IPAInterface\n  */\n \n+/**\n+ * \\fn IPAInterface::initSensor()\n+ * \\brief Initialize the IPA sensor settings\n+ * \\param[in] controls List of controls provided by the sensor\n+ *\n+ * This function is called when a pipeline attaches to an IPA to inform the IPA\n+ * of the controls and limits the sensor in the video pipeline supports. The IPA\n+ * have the option to set controls of the sensor by emitting the updateSensor\n+ * signal.\n+ */\n+\n+/**\n+ * \\fn IPAInterface::initBuffers()\n+ * \\brief Initialize the buffers shared between pipeline and IPA\n+ * \\param[in] type Type of buffers described in \\a buffers\n+ * \\param[in] buffers List of buffers of \\a type\n+ *\n+ * This function is called when a pipeline handler wants to inform the IPA of\n+ * which buffers it has mapped for a specific purpose. All buffers shared\n+ * between these two object's needs to be shared using this function prior to\n+ * use.\n+ *\n+ * After the buffers have been initialized they are referenced using an\n+ * numerical \\a id which represents the insertion order in the \\a buffers list\n+ * given as an argument here.\n+ *\n+ * It is possible to call this function multiple times for different kinds of\n+ * buffer types, e.g. once for statistic buffers and once more for parameter\n+ * buffers. It's also possible to call this function multiple times for the\n+ * same buffer type if the pipeline handler wants to update the mappings inside\n+ * the IPA.\n+ *\n+ * The buffer type numerical ids and it's usage are not enforced by the IPA\n+ * interface and is left as pipeline handler specific.\n+ */\n+\n+/**\n+ * \\fn IPAInterface::signalBuffer()\n+ * \\brief Signal that the pipeline handlers is done processing a buffer\n+ * \\param[in] type Type of buffer\n+ * \\param[in] id Buffer id in \\a type\n+ *\n+ * A pipeline handler can signal to the IPA that it is done with buffer. This\n+ * may have different meanings for different buffer types. For example signaling\n+ * a parameter buffer may be an indication that it's now free and the IPA can\n+ * update its content and schedule it to be written to the hardware again. While\n+ * signaling a parameters buffer may indicate that it's filled with data from\n+ * the hardware and are ready to be consumed by the IPA.\n+ *\n+ * As all pipeline designs are under the unique it must document what signaling\n+ * a buffer of a specific type means for that particular IPA interface.\n+ */\n+\n+/**\n+ * \\fn IPAInterface::queueRequest()\n+ * \\brief Inform the IPA that a request have been queued to the pipeline\n+ * \\param[in] frame The frame number for the request\n+ * \\param[in] controls List of controls associated with the request\n+ *\n+ * This function is called by a pipeline handler when it has a request to\n+ * process. The pipeline informs the IPA that \\a frame shall be processed\n+ * with the parameters in \\a controls.\n+ *\n+ * The IPA may act on this by emitting different signals in the IPA interface\n+ * to configure the pipeline to act on \\a frame according to the \\a controls.\n+ */\n+\n+/**\n+ * \\var IPAInterface::updateSensor\n+ * \\brief Signal emitted when the IPA wish to update sensor V4L2 controls\n+ *\n+ * This signal is emitted when the IPA wish to update one or more V4L2 control\n+ * of the sensor in the video pipeline. The frame number the settings should be\n+ * ready for and a list of controls to modify is passed as parameters.\n+ */\n+\n+/**\n+ * \\var IPAInterface::queueBuffer\n+ * \\brief Signal emitted when the IPA wish to queue a buffer to the hardware\n+ *\n+ * This signal is emitted then the IPA wish to queue q buffer to the hardware.\n+ * The frame number and buffer type and id are passed as parameters.\n+ */\n+\n+/**\n+ * \\var IPAInterface::setDelay\n+ * \\brief Signal emitted when the IPA wish to set a delay in the pipeline\n+ *\n+ * This signal is emitted when the IPA wish to change a delay inside the\n+ * pipeline timeline. The action type, frame and time offsets are passed as\n+ * parameters.\n+ *\n+ * The unit for the time offset is not fixed in the IPA interface, it is up to\n+ * the pipeline implementation to choose a suitable unit for its use-case.\n+ */\n+\n+/**\n+ * \\var IPAInterface::metaDataReady\n+ * \\brief Signal emitted when the IPA is done processing statistics\n+ *\n+ * This signal is emitted when the IPA have finished processing the statistics\n+ * buffer and have created an IPAMetaData object which are ready to be consumed\n+ * by the pipeline handler. The frame number and the meta data is passed as\n+ * parameters.\n+ */\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp\nindex 62fcb529e1c7e4ff..17d09fb21582376d 100644\n--- a/src/libcamera/proxy/ipa_proxy_linux.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp\n@@ -26,7 +26,11 @@ public:\n \tIPAProxyLinux(IPAModule *ipam);\n \t~IPAProxyLinux();\n \n-\tint init();\n+\tint init() override { return 0; }\n+\tvoid initSensor(const V4L2ControlInfoMap &controls) override {}\n+\tvoid initBuffers(unsigned int type, const std::vector<BufferMemory> &buffers) override {}\n+\tvoid signalBuffer(unsigned int type, unsigned int id) override {}\n+\tvoid queueRequest(unsigned int frame, const ControlList &controls) override {}\n \n private:\n \tvoid readyRead(IPCUnixSocket *ipc);\n@@ -36,13 +40,6 @@ private:\n \tIPCUnixSocket *socket_;\n };\n \n-int IPAProxyLinux::init()\n-{\n-\tLOG(IPAProxy, Debug) << \"initializing IPA via dummy proxy!\";\n-\n-\treturn 0;\n-}\n-\n IPAProxyLinux::IPAProxyLinux(IPAModule *ipam)\n \t: proc_(nullptr), socket_(nullptr)\n {\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "08/13"
    ]
}