Show a patch.

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

{
    "id": 15597,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15597/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15597/",
    "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": "<20220331163058.171418-5-umang.jain@ideasonboard.com>",
    "date": "2022-03-31T16:30:56",
    "name": "[libcamera-devel,IPAIPU3,v4,4/6] ipu3: Use the new IPAIPU3 interface",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "fb8af4e4d96f70ca244e4c6b08ebd53f1704e6da",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/1.1/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/15597/mbox/",
    "series": [
        {
            "id": 3020,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3020/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3020",
            "date": "2022-03-31T16:30:52",
            "name": "ipa: ipu3: Replace event-based ops with dedicated functions​",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3020/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15597/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15597/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 60C0BC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 31 Mar 2022 16:31:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 13F6465635;\n\tThu, 31 Mar 2022 18:31:29 +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 B3A0265634\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Mar 2022 18:31:27 +0200 (CEST)",
            "from perceval.ideasonboard.com (unknown [103.74.73.150])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D9277486;\n\tThu, 31 Mar 2022 18:31:24 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648744289;\n\tbh=iQP5eAvRsUy/OgVVjshQKc/QqGsiL4OgAA5JP8Gyv2o=;\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=edhIS1d3E2soGBZl8SPzIkyAC+qjBYIb3YXOx/YvObZvlz4l4HPem7pxaM+sXve6E\n\tobjcr2GmEyBn8DsQlk1G48tFUJiHeffYu1EcklTzqCgqmA+e7kUyMrUjJIJJg2wgkR\n\tMZ4OVM/PXD2DRlvryXd/ocgBHJHtv2NieupTke/kSNaMkYrL2yYXh4jwxisFx65//D\n\t5U9u7oN3z/X47Ime9ThvlL4cJRyqARzcVB4pQFq5yYqZQry5w4+WhGRIb0oetar4zP\n\t8ge6ew4YQfr4J//0mKOpMpwUrjW21yp3kYnEC2zLM80G4fKU47GHj91RnuvgmDHtku\n\thMtHhJvwae0rw==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648744287;\n\tbh=iQP5eAvRsUy/OgVVjshQKc/QqGsiL4OgAA5JP8Gyv2o=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ZoBBunwbb9rlNRjPtc7zHS6svIQUre9uKK1K2WiHZy9qZ7j6o3H/rRtANRnit+7qh\n\t9ONCIps8L8BZpkLHdOH0iXJu2G7m1Z1DcuMI0wJPTEulvksxwLa8ovRSU/SP9vL8bK\n\tIx4ZpbyCmwbg1U5MUQQmFhgbdaz89K/zasBnBSyM="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZoBBunwb\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 31 Mar 2022 22:00:56 +0530",
        "Message-Id": "<20220331163058.171418-5-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20220331163058.171418-1-umang.jain@ideasonboard.com>",
        "References": "<20220331163058.171418-1-umang.jain@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [IPAIPU3 PATCH v4 4/6] ipu3: Use the new IPAIPU3\n\tinterface",
        "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": "Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Umang Jain <umang.jain@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Use the new IPAIPU3 interface that migrates the event-based ops\nto dedication functions.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n ipu3.cpp | 102 ++++++++++++++++++++++---------------------------------\n 1 file changed, 41 insertions(+), 61 deletions(-)",
    "diff": "diff --git a/ipu3.cpp b/ipu3.cpp\nindex 6ab86e0..289cc77 100644\n--- a/ipu3.cpp\n+++ b/ipu3.cpp\n@@ -49,13 +49,17 @@ public:\n \n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n-\tvoid processEvent(const IPU3Event &event) override;\n+\n+\tvoid fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) override;\n+\tvoid processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n+\t\t\t\tconst uint32_t bufferId,\n+\t\t\t\tconst ControlList &sensorControls) override;\n+\tvoid queueRequest(const uint32_t frame, const ControlList &controls) override;\n \n private:\n \tvoid updateControls(const IPACameraSensorInfo &sensorInfo,\n \t\t\t    const ControlInfoMap &sensorControls,\n \t\t\t    ControlInfoMap *ipaControls);\n-\tvoid processControls(unsigned int frame, const ControlList &metadata);\n \tvoid runAiq(unsigned int frame);\n \tvoid fillParams(unsigned int frame, ipu3_uapi_params *params);\n \tvoid parseStatistics(unsigned int frame,\n@@ -321,54 +325,41 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n \t}\n }\n \n-void IPAIPU3::processEvent(const IPU3Event &event)\n+void IPAIPU3::queueRequest([[maybe_unused]] unsigned int frame,\n+\t\t\t   [[maybe_unused]] const ControlList &controls)\n {\n-\tswitch (event.op) {\n-\tcase EventProcessControls: {\n-\t\tprocessControls(event.frame, event.controls);\n-\t\tbreak;\n-\t}\n-\tcase EventStatReady: {\n-\t\tauto it = buffers_.find(event.bufferId);\n-\t\tif (it == buffers_.end()) {\n-\t\t\tLOG(IPAIPU3, Error) << \"Could not find stats buffer!\";\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tSpan<uint8_t> mem = it->second.maps()[0];\n-\t\tconst ipu3_uapi_stats_3a *stats =\n-\t\t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n-\n-\t\tparseStatistics(event.frame,\n-\t\t\t\tevent.frameTimestamp,\n-\t\t\t\tstats,\n-\t\t\t\tevent.sensorControls);\n-\t\tbreak;\n-\t}\n-\tcase EventFillParams: {\n-\t\tauto it = buffers_.find(event.bufferId);\n-\t\tif (it == buffers_.end()) {\n-\t\t\tLOG(IPAIPU3, Error) << \"Could not find param buffer!\";\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tSpan<uint8_t> mem = it->second.maps()[0];\n-\t\tipu3_uapi_params *params =\n-\t\t\treinterpret_cast<ipu3_uapi_params *>(mem.data());\n-\n-\t\tfillParams(event.frame, params);\n-\t\tbreak;\n-\t}\n-\tdefault:\n-\t\tLOG(IPAIPU3, Error) << \"Unknown event \" << event.op;\n-\t\tbreak;\n+\t/* \\todo Start processing for 'frame' based on 'controls'. */\n+}\n+\n+void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n+{\n+\tauto it = buffers_.find(bufferId);\n+\tif (it == buffers_.end()) {\n+\t\tLOG(IPAIPU3, Error) << \"Could not find params buffer\";\n+\t\treturn;\n \t}\n+\n+\tSpan<uint8_t> mem = it->second.maps()[0];\n+\tipu3_uapi_params *params =\n+\t\treinterpret_cast<ipu3_uapi_params *>(mem.data());\n+\n+\tfillParams(frame, params);\n }\n \n-void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n-\t\t\t      [[maybe_unused]] const ControlList &controls)\n+void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n+\t\t\t\t const uint32_t bufferId, const ControlList &sensorControls)\n {\n-\t/* \\todo Start processing for 'frame' based on 'controls'. */\n+\tauto it = buffers_.find(bufferId);\n+\tif (it == buffers_.end()) {\n+\t\tLOG(IPAIPU3, Error) << \"Could not find stats buffer\";\n+\t\treturn;\n+\t}\n+\n+\tSpan<uint8_t> mem = it->second.maps()[0];\n+\tconst ipu3_uapi_stats_3a *stats =\n+\t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n+\n+\tparseStatistics(frame, frameTimestamp, stats, sensorControls);\n }\n \n void IPAIPU3::runAiq([[maybe_unused]] unsigned int frame)\n@@ -424,10 +415,7 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n \n \tsetControls(frame);\n \n-\tIPU3Action op;\n-\top.op = ActionParamFilled;\n-\n-\tqueueFrameAction.emit(frame, op);\n+\tparamsBufferReady.emit(frame);\n }\n \n void IPAIPU3::parseStatistics(unsigned int frame,\n@@ -488,27 +476,19 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n \t\t\t\t(sensorInfo_.pixelRate / 1e6);\n \tctrls.set(controls::FrameDuration, frameDuration);\n \n-\tIPU3Action op;\n-\top.op = ActionMetadataReady;\n-\top.controls = ctrls;\n-\n-\tqueueFrameAction.emit(frame, op);\n+\tmetadataReady.emit(frame, ctrls);\n }\n \n void IPAIPU3::setControls(unsigned int frame)\n {\n-\tIPU3Action op;\n-\top.op = ActionSetSensorControls;\n-\n \tControlList sensorCtrls(ctrls_);\n \tsensorCtrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));\n \tsensorCtrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n \n-\top.sensorControls = sensorCtrls;\n-\n-\top.lensControls.set(V4L2_CID_FOCUS_ABSOLUTE, lensPosition_);\n+\tControlList lensCtrls(ctrls_);\n+\tlensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, lensPosition_);\n \n-\tqueueFrameAction.emit(frame, op);\n+\tsetSensorControls.emit(frame, sensorCtrls, lensCtrls);\n }\n \n } /* namespace ipa::ipu3 */\n",
    "prefixes": [
        "libcamera-devel",
        "IPAIPU3",
        "v4",
        "4/6"
    ]
}