Show a patch.

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

{
    "id": 1897,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1897/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1897/",
    "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": "<20190829232653.13214-12-niklas.soderlund@ragnatech.se>",
    "date": "2019-08-29T23:26:50",
    "name": "[libcamera-devel,v2,11/14] libcamera: ipa: Extend to support IPA interactions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f807c9bd2f68723cffa05996cb805ad7d4f6ef22",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1897/mbox/",
    "series": [
        {
            "id": 475,
            "url": "https://patchwork.libcamera.org/api/1.1/series/475/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=475",
            "date": "2019-08-29T23:26:40",
            "name": "libcamera: ipa: Add basic IPA support",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/475/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1897/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1897/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 6864C60E38\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Aug 2019 01:27:36 +0200 (CEST)",
            "from bismarck.berto.se (unknown [79.202.45.17])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 91eec3c1-cab4-11e9-837a-0050569116f7;\n\tFri, 30 Aug 2019 01:27:30 +0200 (CEST)"
        ],
        "X-Halon-ID": "91eec3c1-cab4-11e9-837a-0050569116f7",
        "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, 30 Aug 2019 01:26:50 +0200",
        "Message-Id": "<20190829232653.13214-12-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.22.1",
        "In-Reply-To": "<20190829232653.13214-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190829232653.13214-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 11/14] libcamera: ipa: Extend to\n\tsupport IPA interactions",
        "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": "Thu, 29 Aug 2019 23:27:36 -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\nThe interface needs to be extended further to support attaching the\nresult of the statistic analyses to the request before the request\ncompletes to the user. It also needs to modified to allow proper per\nframe control of capture parameters.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/ipa/ipa_interface.h   | 17 ++++++\n src/ipa/ipa_dummy.cpp                   |  5 ++\n src/ipa/ipa_dummy_isolate.cpp           |  5 ++\n src/libcamera/ipa_interface.cpp         | 73 +++++++++++++++++++++++++\n src/libcamera/proxy/ipa_proxy_linux.cpp | 12 ++--\n 5 files changed, 104 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h\nindex 9bbc4cf58ec66420..38e16ff37214f7b9 100644\n--- a/include/libcamera/ipa/ipa_interface.h\n+++ b/include/libcamera/ipa/ipa_interface.h\n@@ -7,12 +7,29 @@\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 Buffer;\n+class Request;\n+\n class IPAInterface\n {\n public:\n \tvirtual ~IPAInterface() {}\n+\n+\tvirtual int initSensor(const V4L2ControlInfoMap &controls) = 0;\n+\tvirtual void processRequest(const void *cookie,\n+\t\t\t\t    const ControlList &controls,\n+\t\t\t\t    Buffer &parameters) = 0;\n+\tvirtual void updateStatistics(const void *cookie, Buffer &statistics) = 0;\n+\n+\tSignal<V4L2ControlList> updateSensor;\n+\tSignal<const void *> queueRequest;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/ipa_dummy.cpp b/src/ipa/ipa_dummy.cpp\nindex 09f1b96a8f3d5c36..11dcc54ce4ebc6f4 100644\n--- a/src/ipa/ipa_dummy.cpp\n+++ b/src/ipa/ipa_dummy.cpp\n@@ -14,6 +14,11 @@ namespace libcamera {\n \n class IPADummy : public IPAInterface\n {\n+public:\n+\tint initSensor(const V4L2ControlInfoMap &controls) { return 0; }\n+\tvoid processRequest(const void *cookie, const ControlList &controls,\n+\t\t\t    Buffer &parameters) {}\n+\tvoid updateStatistics(const void *cookie, Buffer &statistics) {}\n };\n \n /*\ndiff --git a/src/ipa/ipa_dummy_isolate.cpp b/src/ipa/ipa_dummy_isolate.cpp\nindex fa50be5309eba3c4..4d49c0e372466af6 100644\n--- a/src/ipa/ipa_dummy_isolate.cpp\n+++ b/src/ipa/ipa_dummy_isolate.cpp\n@@ -15,6 +15,11 @@ namespace libcamera {\n \n class IPADummyIsolate : public IPAInterface\n {\n+public:\n+\tint initSensor(const V4L2ControlInfoMap &controls) { return 0; }\n+\tvoid processRequest(const void *cookie, const ControlList &controls,\n+\t\t\t    Buffer &parameters) {}\n+\tvoid updateStatistics(const void *cookie, Buffer &statistics) {}\n };\n \n /*\ndiff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\nindex 273477a5272677b7..be9eab3cda32379d 100644\n--- a/src/libcamera/ipa_interface.cpp\n+++ b/src/libcamera/ipa_interface.cpp\n@@ -19,4 +19,77 @@ namespace libcamera {\n  * \\brief Interface for IPA implementation\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+ * \\return 0 on success or a negative error code otherwise\n+ */\n+\n+/**\n+ * \\fn IPAInterface::processRequest()\n+ * \\brief Provide IPA with a parameter buffer to fill\n+ * \\param[in] cookie Cookie for the request\n+ * \\param[in] controls List of controls associated with the request\n+ * \\param[in,out] parameters Buffer containing an empty parameters buffer\n+ *\n+ * This function is called by a pipeline handler when it has a request to\n+ * process. The IPA shall fill in the \\a parameters buffer to achieve the\n+ * capture result described in \\a controls. The \\a cookie value identifies\n+ * the request the controls and parameters buffer corresponds to and can be\n+ * matched in updateStatistics() once the request have been processed by the\n+ * hardware. The cookie value is only valid from that processRequest() is\n+ * called and until updateStatistics() return.\n+ *\n+ * When the \\a parameters buffer is filled in and ready to be queued to hardware\n+ * the IPA shall signal pipeline handler using the queueRequest signal with the\n+ * cookie value corresponding to the request the parameters belong to.\n+ */\n+\n+/**\n+ * \\fn IPAInterface::updateStatistics()\n+ * \\brief Provide IPA with statistic buffer to examine\n+ * \\param[in] cookie Cookie for the request\n+ * \\param[in] statistics Buffer containing a filled in statistic buffer\n+ *\n+ * This function is called once a statistic buffer is completed and have been\n+ * dequeue. The IPA may inspect the buffer and update its internal view of the\n+ * capture conditions. The \\a cookie value can be used to associate the dequeued\n+ * statistics buffer with the parameters buffer filled in by the IPA in\n+ * processRequest().\n+ *\n+ * \\todo Extend this function to return or signal the result of the statistic\n+ * examination by the IPA.\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 list of controls to modify is passed\n+ * as a parameter.\n+ *\n+ * \\todo Extend this function to work with per-frame control setting of\n+ * controls.\n+ */\n+\n+/**\n+ * \\var IPAInterface::queueRequest\n+ * \\brief Signal emitted when the IPA is done preparing a request\n+ *\n+ * This signal is emitted then the IPA have finished filling in the parameters\n+ * buffer and is ready for the request to be committed to hardware for capture.\n+ * The request cookie is passed as a parameter.\n+ *\n+ * \\todo Extend this function to work with per-frame control setting of\n+ * controls.\n+ */\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp\nindex f881aab5b2e1178a..bb7aeedf12779c66 100644\n--- a/src/libcamera/proxy/ipa_proxy_linux.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp\n@@ -26,7 +26,10 @@ public:\n \tIPAProxyLinux(IPAModule *ipam);\n \t~IPAProxyLinux();\n \n-\tint init();\n+\tint initSensor(const V4L2ControlInfoMap &controls) { return 0; }\n+\tvoid processRequest(const void *cookie, const ControlList &controls,\n+\t\t\t    Buffer &parameters) {}\n+\tvoid updateStatistics(const void *cookie, Buffer &statistics) {}\n \n private:\n \tvoid readyRead(IPCUnixSocket *ipc);\n@@ -36,13 +39,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 {\n \tLOG(IPAProxy, Debug)\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "11/14"
    ]
}