Patch Detail
Show a patch.
GET /api/1.1/patches/15579/?format=api
{ "id": 15579, "url": "https://patchwork.libcamera.org/api/1.1/patches/15579/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15579/", "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": "<20220328173612.138332-3-umang.jain@ideasonboard.com>", "date": "2022-03-28T17:36:12", "name": "[libcamera-devel,v3,IPAIPU3,2/2] ipu3: Use the new IPAIPU3 interface", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "cd5f8dc7590bead8d65d425e0cd2a57dd565828b", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15579/mbox/", "series": [ { "id": 3010, "url": "https://patchwork.libcamera.org/api/1.1/series/3010/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3010", "date": "2022-03-28T17:36:10", "name": "ipa: ipu3: Replace event-based ops with dedicated functions", "version": 3, "mbox": "https://patchwork.libcamera.org/series/3010/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15579/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15579/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 22E87C3266\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Mar 2022 17:36:28 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C978A65633;\n\tMon, 28 Mar 2022 19:36:27 +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 0613B65631\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Mar 2022 19:36:26 +0200 (CEST)", "from perceval.ideasonboard.com (unknown\n\t[IPv6:2401:4900:1f3e:6e7e:1ff:a5c2:a86e:ae1b])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 139382F7;\n\tMon, 28 Mar 2022 19:36:24 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648488987;\n\tbh=hGOqIaMwdiKcZFtziOzgybd1YGzn7f13YOYrJ6irdeA=;\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=fXC5XRM1w5bvYQZQHRbx5qYqZ3TQZG8QPacwNnQNqlVvUEsyCk52X/YGAIiE/k7aW\n\toDCrxOqabBU9m+PpFEcO9lECiZX3WIt2KeiA62oykl4zH0QXEBl9OP9ug2WfBjFIZF\n\tXq42wqgNmhw6OFRX7OO+VCAOsfBVHkCpZx7/gfQYI4+oVbqJZP3mBPB2etJz9yHFQN\n\thpDsSnMCzk8aeANu2DXbpqOi9BU/+js9QBTTAYdZ2371Kkt4QoZ9iBr/dzsW50hQgq\n\taACItUnqBxHHsPsfj7xSkw0Fd4OjshO9/6YvkjWJ2WCsHWOEmrCfsmoKzyQIyBoHKW\n\tBfPqvM/QVbcaw==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648488985;\n\tbh=hGOqIaMwdiKcZFtziOzgybd1YGzn7f13YOYrJ6irdeA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=LHVzQ5fxFbBQwvVDr1Zvg1DZ4LKEK3DaLEhUz4/k2n7L74Ii43nyW7UZ7p250J4XJ\n\tFZlJA7+mdqR4h2NbBvr6rLRJMCfHk5td+CPGTJfE50GflFF3G64yrQ2klz4LQocar1\n\tipBKy363MxcM/GX56ua+GDYC8vXsAUcb7e1JRR0w=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LHVzQ5fx\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 28 Mar 2022 23:06:12 +0530", "Message-Id": "<20220328173612.138332-3-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20220328173612.138332-1-umang.jain@ideasonboard.com>", "References": "<20220328173612.138332-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 IPAIPU3 2/2] 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 | 108 +++++++++++++++++++++++--------------------------------\n 1 file changed, 45 insertions(+), 63 deletions(-)", "diff": "diff --git a/ipu3.cpp b/ipu3.cpp\nindex 6ab86e0..d02581d 100644\n--- a/ipu3.cpp\n+++ b/ipu3.cpp\n@@ -49,13 +49,16 @@ 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 processParamsBuffer(const uint32_t frame, const uint32_t bufferId) override;\n+\tvoid processControls(const uint32_t frame, const ControlList &controls) override;\n+\tvoid processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n+\t\t\t\tconst uint32_t bufferId, const ControlList &sensorControls) 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 +324,41 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n \t}\n }\n \n-void IPAIPU3::processEvent(const IPU3Event &event)\n+void IPAIPU3::processControls([[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::processParamsBuffer(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 +414,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 +475,22 @@ 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+\tControlList ctrls(ctrls_);\n+\tctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));\n+\tctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n \n-\top.sensorControls = sensorCtrls;\n+\tControlList lensCtrls(ctrls_);\n+\t/*\n+\t * \\todo: lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, <lens_position>));\n+\t */\n \n-\top.lensControls.set(V4L2_CID_FOCUS_ABSOLUTE, lensPosition_);\n \n-\tqueueFrameAction.emit(frame, op);\n+\tsetSensorControls.emit(frame, ctrls, lensCtrls);\n }\n \n } /* namespace ipa::ipu3 */\n", "prefixes": [ "libcamera-devel", "v3", "IPAIPU3", "2/2" ] }