{"id":10775,"url":"https://patchwork.libcamera.org/api/1.1/patches/10775/?format=json","web_url":"https://patchwork.libcamera.org/patch/10775/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201229160318.77536-10-niklas.soderlund@ragnatech.se>","date":"2020-12-29T16:03:16","name":"[libcamera-devel,v2,09/11] libcamera: ipu3: Map buffers in IPA","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"1145de59b22c562636824d2d134e0d4a667d2dc3","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":{"id":16,"url":"https://patchwork.libcamera.org/api/1.1/users/16/?format=json","username":"neg","first_name":"Niklas","last_name":"Söderlund","email":"niklas.soderlund@ragnatech.se"},"mbox":"https://patchwork.libcamera.org/patch/10775/mbox/","series":[{"id":1559,"url":"https://patchwork.libcamera.org/api/1.1/series/1559/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1559","date":"2020-12-29T16:03:07","name":"libcamera: ipu3: Attach to an skeleton IPA","version":2,"mbox":"https://patchwork.libcamera.org/series/1559/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10775/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10775/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 9BB82C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Dec 2020 16:04:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6860560320;\n\tTue, 29 Dec 2020 17:04:15 +0100 (CET)","from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C9D8A61FF3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Dec 2020 17:04:12 +0100 (CET)","from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 7d7dbd61-49ef-11eb-a542-005056917a89;\n\tTue, 29 Dec 2020 17:04:11 +0100 (CET)"],"X-Halon-ID":"7d7dbd61-49ef-11eb-a542-005056917a89","Authorized-sender":"niklas.soderlund@fsdn.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 29 Dec 2020 17:03:16 +0100","Message-Id":"<20201229160318.77536-10-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.29.2","In-Reply-To":"<20201229160318.77536-1-niklas.soderlund@ragnatech.se>","References":"<20201229160318.77536-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 09/11] libcamera: ipu3: Map buffers in\n\tIPA","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>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Map and unmap the parameters and statistic buffers in the IPA when the\npipeline handler allocates and frees the buffers.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 26 ++++++++++++++++++++++++++\n 1 file changed, 26 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 95f1b75dc8be5d40..141066c528890c8e 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -138,6 +138,8 @@ private:\n \tImgUDevice imgu1_;\n \tMediaDevice *cio2MediaDev_;\n \tMediaDevice *imguMediaDev_;\n+\n+\tstd::vector<IPABuffer> ipaBuffers_;\n };\n \n IPU3CameraConfiguration::IPU3CameraConfiguration(IPU3CameraData *data)\n@@ -583,6 +585,23 @@ int PipelineHandlerIPU3::allocateBuffers(Camera *camera)\n \tif (ret < 0)\n \t\treturn ret;\n \n+\t/* Map buffers to the IPA. */\n+\tunsigned int ipaBufferId = 1;\n+\n+\tfor (const std::unique_ptr<FrameBuffer> &buffer : imgu->paramBuffers_) {\n+\t\tbuffer->setCookie(ipaBufferId++);\n+\t\tipaBuffers_.push_back({ .id = buffer->cookie(),\n+\t\t\t\t\t.planes = buffer->planes() });\n+\t}\n+\n+\tfor (const std::unique_ptr<FrameBuffer> &buffer : imgu->statBuffers_) {\n+\t\tbuffer->setCookie(ipaBufferId++);\n+\t\tipaBuffers_.push_back({ .id = buffer->cookie(),\n+\t\t\t\t\t.planes = buffer->planes() });\n+\t}\n+\n+\tdata->ipa_->mapBuffers(ipaBuffers_);\n+\n \treturn 0;\n }\n \n@@ -590,6 +609,13 @@ int PipelineHandlerIPU3::freeBuffers(Camera *camera)\n {\n \tIPU3CameraData *data = cameraData(camera);\n \n+\tstd::vector<unsigned int> ids;\n+\tfor (IPABuffer &ipabuf : ipaBuffers_)\n+\t\tids.push_back(ipabuf.id);\n+\n+\tdata->ipa_->unmapBuffers(ids);\n+\tipaBuffers_.clear();\n+\n \tdata->imgu_->freeBuffers();\n \n \treturn 0;\n","prefixes":["libcamera-devel","v2","09/11"]}