Patch Detail
Show a patch.
GET /api/patches/15236/?format=api
{ "id": 15236, "url": "https://patchwork.libcamera.org/api/patches/15236/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15236/", "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": "<20220103170956.323025-3-umang.jain@ideasonboard.com>", "date": "2022-01-03T17:09:54", "name": "[libcamera-devel,2/4] ipa: ipu3: Replace event-based operations with dedicated functions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "965a91ba1916914aa11445e5d31cea31593c2f9b", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": { "id": 12, "url": "https://patchwork.libcamera.org/api/users/12/?format=api", "username": "uajain", "first_name": "Umang", "last_name": "Jain", "email": "umang.jain@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/15236/mbox/", "series": [ { "id": 2873, "url": "https://patchwork.libcamera.org/api/series/2873/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2873", "date": "2022-01-03T17:09:52", "name": "IPAIPU3 - Rework interface and introduce context", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2873/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15236/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15236/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 200ECBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 3 Jan 2022 17:10:14 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A13876090D;\n\tMon, 3 Jan 2022 18:10:13 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E493604F4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 3 Jan 2022 18:10:12 +0100 (CET)", "from perceval.ideasonboard.com (unknown\n\t[IPv6:2401:4900:1f3e:193e:9a73:f356:8c6a:a1aa])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9064CCC;\n\tMon, 3 Jan 2022 18:10:10 +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=\"Uu/ED6iR\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1641229811;\n\tbh=w0/DQSKgsAUOI2FVwi3uM0hVA/KSCmZjrOLTOJfhdYM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Uu/ED6iR6yMbFRQj9y65SDrEdLFVAYiCKfjSqHgYWySDNRpbDdzPqPFs3qotxlaGK\n\tqYs9Uhqsd//EYSL4BAACdlre7F+OXagbpFVmdUrYa+b9/tPd2BTfQjBJJId/LDcvoh\n\tQib+/ZOmfT6cMunS5EuTogYs8Iv3dRyeKw24rnnM=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 3 Jan 2022 22:39:54 +0530", "Message-Id": "<20220103170956.323025-3-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20220103170956.323025-1-umang.jain@ideasonboard.com>", "References": "<20220103170956.323025-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 2/4] ipa: ipu3: Replace event-based\n\toperations with dedicated functions", "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": "The IPAIPU3 interface currently uses event-type based structures in\norder to communicate with the pipeline-handler (and vice-versa).\nReplace the event based structures with dedicated functions associated\nto each operation.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n include/libcamera/ipa/ipu3.mojom | 36 ++------\n src/ipa/ipu3/ipu3-ipa-design-guide.rst | 19 ++--\n src/ipa/ipu3/ipu3.cpp | 117 ++++++++++-------------\n src/libcamera/pipeline/ipu3/ipu3.cpp | 123 +++++++++++--------------\n 4 files changed, 122 insertions(+), 173 deletions(-)", "diff": "diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom\nindex cc0d822f..12b8bb2f 100644\n--- a/include/libcamera/ipa/ipu3.mojom\n+++ b/include/libcamera/ipa/ipu3.mojom\n@@ -8,32 +8,6 @@ module ipa.ipu3;\n \n import \"include/libcamera/ipa/core.mojom\";\n \n-enum IPU3Operations {\n-\tActionSetSensorControls = 1,\n-\tActionParamFilled = 2,\n-\tActionMetadataReady = 3,\n-\tEventProcessControls = 4,\n-\tEventStatReady = 5,\n-\tEventFillParams = 6,\n-};\n-\n-struct IPU3Event {\n-\tIPU3Operations op;\n-\tuint32 frame;\n-\tint64 frameTimestamp;\n-\tuint32 bufferId;\n-\tlibcamera.ControlList controls;\n-\tlibcamera.ControlList sensorControls;\n-\tlibcamera.ControlList lensControls;\n-};\n-\n-struct IPU3Action {\n-\tIPU3Operations op;\n-\tlibcamera.ControlList controls;\n-\tlibcamera.ControlList sensorControls;\n-\tlibcamera.ControlList lensControls;\n-};\n-\n struct IPAConfigInfo {\n \tlibcamera.IPACameraSensorInfo sensorInfo;\n \tlibcamera.ControlInfoMap sensorControls;\n@@ -55,9 +29,15 @@ interface IPAIPU3Interface {\n \tmapBuffers(array<libcamera.IPABuffer> buffers);\n \tunmapBuffers(array<uint32> ids);\n \n-\t[async] processEvent(IPU3Event ev);\n+\t[async] fillParameterBuffer(uint32 frame, uint32 bufferId);\n+\t[async] processControls(uint32 frame, libcamera.ControlList controls);\n+\t[async] statsReady(uint32 frame, int64 frameTimestamp, uint32 bufferId,\n+\t\t\t libcamera.ControlList sensorControls);\n };\n \n interface IPAIPU3EventInterface {\n-\tqueueFrameAction(uint32 frame, IPU3Action action);\n+\tsetSensorControls(uint32 frame, libcamera.ControlList sensorControls,\n+\t\t\t libcamera.ControlList lensControls);\n+\tparamFilled(uint32 frame);\n+\tmetadataReady(uint32 frame, libcamera.ControlList metadata);\n };\ndiff --git a/src/ipa/ipu3/ipu3-ipa-design-guide.rst b/src/ipa/ipu3/ipu3-ipa-design-guide.rst\nindex 89c71108..83f8634d 100644\n--- a/src/ipa/ipu3/ipu3-ipa-design-guide.rst\n+++ b/src/ipa/ipu3/ipu3-ipa-design-guide.rst\n@@ -25,7 +25,8 @@ from applications, and managing events from the pipeline handler.\n └─┬───┬───┬──────┬────┬────┬────┬─┴────▼─┬──┘ 1: init()\n │ │ │ │ ▲ │ ▲ │ ▲ │ ▲ │ 2: configure()\n │1 │2 │3 │4│ │4│ │4│ │4│ │5 3: mapBuffers(), start()\n- ▼ ▼ ▼ ▼ │ ▼ │ ▼ │ ▼ │ ▼ 4: processEvent()\n+ │ │ │ │ │ │ │ │ │ │ │ │ 4: (▼) processControls(), fillParametersBuffer(), statsReady()\n+ ▼ ▼ ▼ ▼ │ ▼ │ ▼ │ ▼ │ ▼ (▲) setSensorControls, paramFilled, metadataReady Signals\n ┌──────────────────┴────┴────┴────┴─────────┐ 5: stop(), unmapBuffers()\n │ IPU3 IPA │\n │ ┌───────────────────────┐ │\n@@ -100,8 +101,9 @@ There are three main interactions with the algorithms for the IPU3 IPA\n to operate when running:\n \n - configure()\n-- processEvent(``EventFillParams``)\n-- processEvent(``EventStatReady``)\n+- fillParameterBuffer()\n+- processControls()\n+- statsReady()\n \n The configuration phase allows the pipeline-handler to inform the IPA of\n the current stream configurations, which is then passed into each\n@@ -115,7 +117,7 @@ When configured, the IPA is notified by the pipeline handler of the\n Camera ``start()`` event, after which incoming requests will be queued\n for processing, requiring a parameter buffer (``ipu3_uapi_params``) to\n be populated for the ImgU. This is given to the IPA through the\n-``EventFillParams`` event, and then passed directly to each algorithm\n+``fillParameterBuffer()``, and then passed directly to each algorithm\n through the ``prepare()`` call allowing the ISP configuration to be\n updated for the needs of each component that the algorithm is\n responsible for.\n@@ -125,7 +127,7 @@ structure that it modifies, and it should take care to ensure that any\n structure set by a use flag is fully initialised to suitable values.\n \n The parameter buffer is returned to the pipeline handler through the\n-``ActionParamFilled`` event, and from there queued to the ImgU along\n+``paramFilled`` signal, and from there queued to the ImgU along\n with a raw frame captured with the CIO2.\n \n Post-frame completion\n@@ -134,7 +136,7 @@ Post-frame completion\n When the capture of an image is completed, and successfully processed\n through the ImgU, the generated statistics buffer\n (``ipu3_uapi_stats_3a``) is given to the IPA through the\n-``EventStatReady`` event. This provides the IPA with an opportunity to\n+``statsReady()``. This provides the IPA with an opportunity to\n examine the results of the ISP and run the calculations required by each\n algorithm on the new data. The algorithms may require context from the\n operations of other algorithms, for example, the AWB might choose to use\n@@ -145,11 +147,14 @@ before they are needed.\n The ordering of the algorithm processing is determined by their\n placement in the ``IPU3::algorithms_`` ordered list.\n \n+Finally, the IPA metadata for the frame completed is returned back via\n+``metadataReady`` Signal.\n+\n Sensor Controls\n ~~~~~~~~~~~~~~~\n \n The AutoExposure and AutoGain (AGC) algorithm differs slightly from the\n others as it requires operating directly on the sensor, as opposed to\n through the ImgU ISP. To support this, there is a dedicated action\n-`ActionSetSensorControls` to allow the IPA to request controls to be set\n+``setSensorControls`` signal to allow the IPA to request controls to be set\n on the camera sensor through the pipeline handler.\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex aef232c3..4f03d7e9 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -142,14 +142,18 @@ 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 fillParameterBuffer(const uint32_t frame, const uint32_t bufferId) override;\n+\tvoid processControls(const uint32_t frame, const ControlList &controls) override;\n+\tvoid statsReady(const uint32_t frame, const int64_t frameTimestamp,\n+\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 updateSessionConfiguration(const ControlInfoMap &sensorControls);\n-\tvoid processControls(unsigned int frame, const ControlList &controls);\n+\n \tvoid fillParams(unsigned int frame, ipu3_uapi_params *params);\n \tvoid parseStatistics(unsigned int frame,\n \t\t\t int64_t frameTimestamp,\n@@ -505,58 +509,49 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n }\n \n /**\n- * \\brief Process an event generated by the pipeline handler\n- * \\param[in] event The event sent from pipeline handler\n- *\n- * The expected event handling over the lifetime of a Request has\n- * the following sequence:\n- *\n- * - EventProcessControls : Handle controls from a new Request\n- * - EventFillParams : Prepare the ISP to process the Request\n- * - EventStatReady : Process statistics after ISP completion\n+ * \\brief Prepare the ISP to process the Request\n+ * \\param[in] frame The frame number\n+ * \\param[in] bufferId Buffer ID\n */\n-void IPAIPU3::processEvent(const IPU3Event &event)\n+void IPAIPU3::fillParameterBuffer(const uint32_t frame, const uint32_t bufferId)\n {\n-\tswitch (event.op) {\n-\tcase EventProcessControls: {\n-\t\tprocessControls(event.frame, event.controls);\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.planes()[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+\tauto it = buffers_.find(bufferId);\n+\tif (it == buffers_.end()) {\n+\t\tLOG(IPAIPU3, Error) << \"Could not find param buffer!\";\n+\t\treturn;\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.planes()[0];\n-\t\tconst ipu3_uapi_stats_3a *stats =\n-\t\t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n-\n-\t\tcontext_.frameContext.sensor.exposure = event.sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n-\t\tcontext_.frameContext.sensor.gain = camHelper_->gain(event.sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n-\n-\t\tparseStatistics(event.frame, event.frameTimestamp, stats);\n-\t\tbreak;\n-\t}\n-\tdefault:\n-\t\tLOG(IPAIPU3, Error) << \"Unknown event \" << event.op;\n-\t\tbreak;\n+\n+\tSpan<uint8_t> mem = it->second.planes()[0];\n+\tipu3_uapi_params *params =\n+\t\treinterpret_cast<ipu3_uapi_params *>(mem.data());\n+\n+\tfillParams(frame, params);\n+}\n+\n+/**\n+ * \\brief Process statistics after ISP completion\n+ * \\param[in] frame The frame number\n+ * \\param[in] frameTimestamp Timestamp of the frame\n+ * \\param[in] bufferId Buffer ID\n+ * \\param[in] sensorControls Sensor controls\n+ */\n+void IPAIPU3::statsReady(const uint32_t frame, const int64_t frameTimestamp,\n+\t\t\t const uint32_t bufferId, const ControlList &sensorControls)\n+{\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.planes()[0];\n+\tconst ipu3_uapi_stats_3a *stats =\n+\t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n+\n+\tcontext_.frameContext.sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n+\tcontext_.frameContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n+\n+\tparseStatistics(frame, frameTimestamp, stats);\n }\n \n /**\n@@ -567,7 +562,7 @@ void IPAIPU3::processEvent(const IPU3Event &event)\n * Parse the request to handle any IPA-managed controls that were set from the\n * application such as manual sensor settings.\n */\n-void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n+void IPAIPU3::processControls(const uint32_t frame,\n \t\t\t [[maybe_unused]] const ControlList &controls)\n {\n \t/* \\todo Start processing for 'frame' based on 'controls'. */\n@@ -597,10 +592,7 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n \tfor (auto const &algo : algorithms_)\n \t\talgo->prepare(frame, context_, params);\n \n-\tIPU3Action op;\n-\top.op = ActionParamFilled;\n-\n-\tqueueFrameAction.emit(frame, op);\n+\tparamFilled.emit(frame);\n }\n \n /**\n@@ -642,11 +634,7 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n \t * likely want to avoid putting platform specific metadata in.\n \t */\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 /**\n@@ -658,18 +646,13 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n */\n void IPAIPU3::setControls(unsigned int frame)\n {\n-\tIPU3Action op;\n-\top.op = ActionSetSensorControls;\n-\n \texposure_ = context_.frameContext.agc.exposure;\n \tgain_ = camHelper_->gainCode(context_.frameContext.agc.gain);\n \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-\top.sensorControls = ctrls;\n+\tControlList lensCtrls;\n \n-\tqueueFrameAction.emit(frame, op);\n+\tsetSensorControls.emit(frame, ctrls, lensCtrls);\n }\n \n } /* namespace ipa::ipu3 */\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 6c5617cd..dd1780ef 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -86,8 +86,10 @@ public:\n \tControlInfoMap ipaControls_;\n \n private:\n-\tvoid queueFrameAction(unsigned int id,\n-\t\t\t const ipa::ipu3::IPU3Action &action);\n+\tvoid metadataReady(unsigned int id, const ControlList &metadata);\n+\tvoid paramFilled(unsigned int id);\n+\tvoid setSensorControls(unsigned int id, const ControlList &sensorControls,\n+\t\t\t const ControlList &lensControls);\n };\n \n class IPU3CameraConfiguration : public CameraConfiguration\n@@ -866,11 +868,7 @@ void IPU3CameraData::queuePendingRequests()\n \n \t\tinfo->rawBuffer = rawBuffer;\n \n-\t\tipa::ipu3::IPU3Event ev;\n-\t\tev.op = ipa::ipu3::EventProcessControls;\n-\t\tev.frame = info->id;\n-\t\tev.controls = request->controls();\n-\t\tipa_->processEvent(ev);\n+\t\tipa_->processControls(info->id, request->controls());\n \n \t\tpendingRequests_.pop();\n \t\tprocessingRequests_.push(request);\n@@ -1213,7 +1211,9 @@ int IPU3CameraData::loadIPA()\n \tif (!ipa_)\n \t\treturn -ENOENT;\n \n-\tipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);\n+\tipa_->setSensorControls.connect(this, &IPU3CameraData::setSensorControls);\n+\tipa_->paramFilled.connect(this, &IPU3CameraData::paramFilled);\n+\tipa_->metadataReady.connect(this, &IPU3CameraData::metadataReady);\n \n \t/*\n \t * Pass the sensor info to the IPA to initialize controls.\n@@ -1248,69 +1248,59 @@ int IPU3CameraData::loadIPA()\n \treturn 0;\n }\n \n-void IPU3CameraData::queueFrameAction(unsigned int id,\n-\t\t\t\t const ipa::ipu3::IPU3Action &action)\n+void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id,\n+\t\t\t\t const ControlList &sensorControls,\n+\t\t\t\t const ControlList &lensControls)\n {\n-\tswitch (action.op) {\n-\tcase ipa::ipu3::ActionSetSensorControls: {\n-\t\tconst ControlList &sensorControls = action.sensorControls;\n-\t\tdelayedCtrls_->push(sensorControls);\n+\tdelayedCtrls_->push(sensorControls);\n \n-\t\tCameraLens *focusLens = cio2_.sensor()->focusLens();\n-\t\tif (!focusLens)\n-\t\t\tbreak;\n-\n-\t\tconst ControlList lensControls = action.lensControls;\n-\t\tif (!lensControls.contains(V4L2_CID_FOCUS_ABSOLUTE))\n-\t\t\tbreak;\n+\tCameraLens *focusLens = cio2_.sensor()->focusLens();\n+\tif (!focusLens)\n+\t\treturn;\n \n-\t\tconst ControlValue &focusValue =\n-\t\t\tlensControls.get(V4L2_CID_FOCUS_ABSOLUTE);\n+\tif (!lensControls.contains(V4L2_CID_FOCUS_ABSOLUTE))\n+\t\treturn;\n \n-\t\tfocusLens->setFocusPostion(focusValue.get<int32_t>());\n+\tconst ControlValue &focusValue =\n+\t\tlensControls.get(V4L2_CID_FOCUS_ABSOLUTE);\n \n-\t\tbreak;\n-\t}\n-\tcase ipa::ipu3::ActionParamFilled: {\n-\t\tIPU3Frames::Info *info = frameInfos_.find(id);\n-\t\tif (!info)\n-\t\t\tbreak;\n-\n-\t\t/* Queue all buffers from the request aimed for the ImgU. */\n-\t\tfor (auto it : info->request->buffers()) {\n-\t\t\tconst Stream *stream = it.first;\n-\t\t\tFrameBuffer *outbuffer = it.second;\n+\tfocusLens->setFocusPostion(focusValue.get<int32_t>());\n+}\n \n-\t\t\tif (stream == &outStream_)\n-\t\t\t\timgu_->output_->queueBuffer(outbuffer);\n-\t\t\telse if (stream == &vfStream_)\n-\t\t\t\timgu_->viewfinder_->queueBuffer(outbuffer);\n-\t\t}\n+void IPU3CameraData::paramFilled(unsigned int id)\n+{\n+\tIPU3Frames::Info *info = frameInfos_.find(id);\n+\tif (!info)\n+\t\treturn;\n \n-\t\timgu_->param_->queueBuffer(info->paramBuffer);\n-\t\timgu_->stat_->queueBuffer(info->statBuffer);\n-\t\timgu_->input_->queueBuffer(info->rawBuffer);\n+\t/* Queue all buffers from the request aimed for the ImgU. */\n+\tfor (auto it : info->request->buffers()) {\n+\t\tconst Stream *stream = it.first;\n+\t\tFrameBuffer *outbuffer = it.second;\n \n-\t\tbreak;\n+\t\tif (stream == &outStream_)\n+\t\t\timgu_->output_->queueBuffer(outbuffer);\n+\t\telse if (stream == &vfStream_)\n+\t\t\timgu_->viewfinder_->queueBuffer(outbuffer);\n \t}\n-\tcase ipa::ipu3::ActionMetadataReady: {\n-\t\tIPU3Frames::Info *info = frameInfos_.find(id);\n-\t\tif (!info)\n-\t\t\tbreak;\n \n-\t\tRequest *request = info->request;\n-\t\trequest->metadata().merge(action.controls);\n+\timgu_->param_->queueBuffer(info->paramBuffer);\n+\timgu_->stat_->queueBuffer(info->statBuffer);\n+\timgu_->input_->queueBuffer(info->rawBuffer);\n+}\n \n-\t\tinfo->metadataProcessed = true;\n-\t\tif (frameInfos_.tryComplete(info))\n-\t\t\tpipe()->completeRequest(request);\n+void IPU3CameraData::metadataReady(unsigned int id, const ControlList &metadata)\n+{\n+\tIPU3Frames::Info *info = frameInfos_.find(id);\n+\tif (!info)\n+\t\treturn;\n \n-\t\tbreak;\n-\t}\n-\tdefault:\n-\t\tLOG(IPU3, Error) << \"Unknown action \" << action.op;\n-\t\tbreak;\n-\t}\n+\tRequest *request = info->request;\n+\trequest->metadata().merge(metadata);\n+\n+\tinfo->metadataProcessed = true;\n+\tif (frameInfos_.tryComplete(info))\n+\t\tpipe()->completeRequest(request);\n }\n \n /* -----------------------------------------------------------------------------\n@@ -1385,11 +1375,7 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)\n \tif (request->findBuffer(&rawStream_))\n \t\tpipe()->completeBuffer(request, buffer);\n \n-\tipa::ipu3::IPU3Event ev;\n-\tev.op = ipa::ipu3::EventFillParams;\n-\tev.frame = info->id;\n-\tev.bufferId = info->paramBuffer->cookie();\n-\tipa_->processEvent(ev);\n+\tipa_->fillParameterBuffer(info->id, info->paramBuffer->cookie());\n }\n \n void IPU3CameraData::paramBufferReady(FrameBuffer *buffer)\n@@ -1433,13 +1419,8 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)\n \t\treturn;\n \t}\n \n-\tipa::ipu3::IPU3Event ev;\n-\tev.op = ipa::ipu3::EventStatReady;\n-\tev.frame = info->id;\n-\tev.bufferId = info->statBuffer->cookie();\n-\tev.frameTimestamp = request->metadata().get(controls::SensorTimestamp);\n-\tev.sensorControls = info->effectiveSensorControls;\n-\tipa_->processEvent(ev);\n+\tipa_->statsReady(info->id, request->metadata().get(controls::SensorTimestamp),\n+\t\t\t info->statBuffer->cookie(), info->effectiveSensorControls);\n }\n \n /*\n", "prefixes": [ "libcamera-devel", "2/4" ] }