Patch Detail
Show a patch.
GET /api/1.1/patches/13357/?format=api
{ "id": 13357, "url": "https://patchwork.libcamera.org/api/1.1/patches/13357/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13357/", "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": "<20210814050912.15113-5-umang.jain@ideasonboard.com>", "date": "2021-08-14T05:09:12", "name": "[libcamera-devel,v3,4/4] ipa: vimc: Send and retrieve FrameBuffers from IPA", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "693584dff490bbee662886b279936a168036d234", "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/13357/mbox/", "series": [ { "id": 2358, "url": "https://patchwork.libcamera.org/api/1.1/series/2358/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2358", "date": "2021-08-14T05:09:08", "name": "Pass buffers to VIMC IPA", "version": 3, "mbox": "https://patchwork.libcamera.org/series/2358/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13357/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13357/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 2FDBCBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 14 Aug 2021 05:09:34 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D7C94688AC;\n\tSat, 14 Aug 2021 07:09:33 +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 869226888F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 14 Aug 2021 07:09:32 +0200 (CEST)", "from perceval.ideasonboard.com (unknown [103.251.226.70])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 819703E5;\n\tSat, 14 Aug 2021 07:09:31 +0200 (CEST)" ], "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=\"G/E/jePa\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628917772;\n\tbh=AMLZ++qxWAAmoYlo4B72a1dsoQXNL0ulAKNwTio/+xI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=G/E/jePaQed2aNCjlqT3tg5QRQus/7+cpD1eXBDrFaJMMxafppxgzlHq9wGXUfoND\n\tUvktPn+gRRcR/Bw48vMMBmbI9BepIXdI33ksmIG77uNB8dsBDuk8rEX1q7hlw8k4Qs\n\tXRLH/Ai2lvmqJKhkJAqN550aOHGWym1T//q5puFs=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 14 Aug 2021 10:39:12 +0530", "Message-Id": "<20210814050912.15113-5-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20210814050912.15113-1-umang.jain@ideasonboard.com>", "References": "<20210814050912.15113-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 4/4] ipa: vimc: Send and retrieve\n\tFrameBuffers from IPA", "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": "Plumb through VIMC mojo interface to enable buffers passing.\nVIMC does not have parameters or statistics buffers but we can\nmimick the typical case of passing IPA buffers from pipeline\nhandler to IPA using mock buffers. The mock IPA buffers are\nFrameBuffers which are dmabuf backed (in other words, mmap()able\nthrough MappedFramebuffer inside the IPA).\n\nThis commits shows:\n- Passing the parameter buffer from the pipeline handler to\n the IPA through functions defined in mojom interface.\n- Passing request controls ControlList to the IPA.\n\nAny tests using VIMC will now loop in the IPA paths. Any tests running\nin isolated mode will help us to test IPA IPC code paths especially\naround (de)serialization of data passing from pipeline handlers to the\nIPA. Future IPA interface tests can simply extend the vimc mojom\ninterface to achieve/test a specific use case as required.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n include/libcamera/ipa/vimc.mojom | 11 ++++++++++-\n src/ipa/vimc/vimc.cpp | 19 +++++++++++++++++++\n src/libcamera/pipeline/vimc/vimc.cpp | 11 +++++++++++\n 3 files changed, 40 insertions(+), 1 deletion(-)", "diff": "diff --git a/include/libcamera/ipa/vimc.mojom b/include/libcamera/ipa/vimc.mojom\nindex 8cb240d3..e3b14e38 100644\n--- a/include/libcamera/ipa/vimc.mojom\n+++ b/include/libcamera/ipa/vimc.mojom\n@@ -29,8 +29,17 @@ interface IPAVimcInterface {\n \n \tmapBuffers(array<libcamera.IPABuffer> buffers);\n \tunmapBuffers(array<uint32> ids);\n+\n+\t/*\n+\t * The vimc driver doesn't use parameters buffers. To maximize coverage\n+\t * of unit tests that rely on the VIMC pipeline handler, we still define\n+\t * interface functions that mimick how other pipeline handlers typically\n+\t * handle parameters at runtime.\n+\t */\n+\t[async] fillParams(uint32 frame, uint32 bufferId);\n+\t[async] processControls(uint32 frame, libcamera.ControlList controls);\n };\n \n interface IPAVimcEventInterface {\n-\tdummyEvent(uint32 val);\n+\tparamsFilled(uint32 bufferId);\n };\ndiff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp\nindex 7d9d22d0..8481b82b 100644\n--- a/src/ipa/vimc/vimc.cpp\n+++ b/src/ipa/vimc/vimc.cpp\n@@ -43,6 +43,9 @@ public:\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \n+\tvoid fillParams(uint32_t frame, uint32_t bufferId) override;\n+\tvoid processControls(uint32_t frame, const ControlList &controls) override;\n+\n private:\n \tvoid initTrace();\n \tvoid trace(enum ipa::vimc::IPAOperationCode operation);\n@@ -126,6 +129,22 @@ void IPAVimc::unmapBuffers(const std::vector<unsigned int> &ids)\n \t}\n }\n \n+void IPAVimc::fillParams([[maybe_unused]] uint32_t frame, uint32_t bufferId)\n+{\n+\tauto it = buffers_.find(bufferId);\n+\tif (it == buffers_.end()) {\n+\t\tLOG(IPAVimc, Error) << \"Could not find parameter buffer\";\n+\t\treturn;\n+\t}\n+\n+\tparamsFilled.emit(bufferId);\n+}\n+\n+void IPAVimc::processControls([[maybe_unused]] uint32_t frame,\n+\t\t\t [[maybe_unused]] const ControlList &controls)\n+{\n+}\n+\n void IPAVimc::initTrace()\n {\n \tstruct stat fifoStat;\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex b08325c2..b9fa6227 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -52,6 +52,7 @@ public:\n \tint init();\n \tint allocateMockIPABuffers();\n \tvoid bufferReady(FrameBuffer *buffer);\n+\tvoid paramsFilled(unsigned int id);\n \n \tMediaDevice *media_;\n \tstd::unique_ptr<CameraSensor> sensor_;\n@@ -432,6 +433,8 @@ int PipelineHandlerVimc::queueRequestDevice(Camera *camera, Request *request)\n \tif (ret < 0)\n \t\treturn ret;\n \n+\tdata->ipa_->processControls(request->sequence(), request->controls());\n+\n \treturn 0;\n }\n \n@@ -465,6 +468,8 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \t}\n \n+\tdata->ipa_->paramsFilled.connect(data.get(), &VimcCameraData::paramsFilled);\n+\n \tstd::string conf = data->ipa_->configurationFile(\"vimc.conf\");\n \tdata->ipa_->init(IPASettings{ conf, data->sensor_->model() });\n \n@@ -569,6 +574,8 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer)\n \n \tpipe_->completeBuffer(request, buffer);\n \tpipe_->completeRequest(request);\n+\n+\tipa_->fillParams(request->sequence(), mockIPABufs_[0]->cookie());\n }\n \n int VimcCameraData::allocateMockIPABuffers()\n@@ -586,6 +593,10 @@ int VimcCameraData::allocateMockIPABuffers()\n \treturn video_->exportBuffers(kBufCount, &mockIPABufs_);\n }\n \n+void VimcCameraData::paramsFilled([[maybe_unused]] unsigned int id)\n+{\n+}\n+\n REGISTER_PIPELINE_HANDLER(PipelineHandlerVimc)\n \n } /* namespace libcamera */\n", "prefixes": [ "libcamera-devel", "v3", "4/4" ] }