{"id":10347,"url":"https://patchwork.libcamera.org/api/1.1/patches/10347/?format=json","web_url":"https://patchwork.libcamera.org/patch/10347/","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":"<20201105001546.1690179-11-niklas.soderlund@ragnatech.se>","date":"2020-11-05T00:15:45","name":"[libcamera-devel,10/11] libcamera: ipu3: imgu: Allocate buffers for stats and param","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"cfc2a1a7074b4f473cc60d9297b24e14ea461752","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/10347/mbox/","series":[{"id":1447,"url":"https://patchwork.libcamera.org/api/1.1/series/1447/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1447","date":"2020-11-05T00:15:35","name":"libcamera: ipu3: Attach to an skeleton IPA","version":1,"mbox":"https://patchwork.libcamera.org/series/1447/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10347/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10347/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 5530FBE081\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Nov 2020 00:16:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2B15E62CB8;\n\tThu,  5 Nov 2020 01:16:25 +0100 (CET)","from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65C6E62C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Nov 2020 01:16:22 +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 6f35cb89-1efa-11eb-8a9c-005056917a89;\n\tThu, 05 Nov 2020 01:04:12 +0100 (CET)"],"X-Halon-ID":"6f35cb89-1efa-11eb-8a9c-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":"Thu,  5 Nov 2020 01:15:45 +0100","Message-Id":"<20201105001546.1690179-11-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.29.2","In-Reply-To":"<20201105001546.1690179-1-niklas.soderlund@ragnatech.se>","References":"<20201105001546.1690179-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 10/11] libcamera: ipu3: imgu: Allocate\n\tbuffers for stats and param","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":"Instead of preparing for buffer importing allocate buffers that can be\nused by an IPA.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/ipu3/imgu.cpp | 14 +++++---------\n src/libcamera/pipeline/ipu3/imgu.h   |  3 +++\n 2 files changed, 8 insertions(+), 9 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 547a9e00325e7519..1dfa968d00379631 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -551,20 +551,13 @@ int ImgUDevice::allocateBuffers(unsigned int bufferCount)\n \t\treturn ret;\n \t}\n \n-\tret = param_->importBuffers(bufferCount);\n+\tret = param_->allocateBuffers(bufferCount, &paramBuffers_);\n \tif (ret < 0) {\n \t\tLOG(IPU3, Error) << \"Failed to allocate ImgU param buffers\";\n \t\tgoto error;\n \t}\n \n-\t/*\n-\t * The kernel fails to start if buffers are not either imported or\n-\t * allocated for the statistics video device. As statistics buffers are\n-\t * not yet used by the pipeline import buffers to save memory.\n-\t *\n-\t * \\todo To be revised when we'll actually use the stat node.\n-\t */\n-\tret = stat_->importBuffers(bufferCount);\n+\tret = stat_->allocateBuffers(bufferCount, &statBuffers_);\n \tif (ret < 0) {\n \t\tLOG(IPU3, Error) << \"Failed to allocate ImgU stat buffers\";\n \t\tgoto error;\n@@ -602,6 +595,9 @@ void ImgUDevice::freeBuffers()\n {\n \tint ret;\n \n+\tparamBuffers_.clear();\n+\tstatBuffers_.clear();\n+\n \tret = output_->releaseBuffers();\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to release ImgU output buffers\";\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\nindex 1388d07a45b28590..05fbc26648549bd6 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.h\n+++ b/src/libcamera/pipeline/ipu3/imgu.h\n@@ -76,6 +76,9 @@ public:\n \tstd::unique_ptr<V4L2VideoDevice> param_;\n \tstd::unique_ptr<V4L2VideoDevice> stat_;\n \n+\tstd::vector<std::unique_ptr<FrameBuffer>> paramBuffers_;\n+\tstd::vector<std::unique_ptr<FrameBuffer>> statBuffers_;\n+\n private:\n \tstatic constexpr unsigned int PAD_INPUT = 0;\n \tstatic constexpr unsigned int PAD_PARAM = 1;\n","prefixes":["libcamera-devel","10/11"]}