{"id":8428,"url":"https://patchwork.libcamera.org/api/1.1/patches/8428/?format=json","web_url":"https://patchwork.libcamera.org/patch/8428/","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":"<20200625223900.1282164-4-niklas.soderlund@ragnatech.se>","date":"2020-06-25T22:38:54","name":"[libcamera-devel,v4,3/9] libcamera: ipu3: Calculate number of buffers for ImgU","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"73e602414761cd4dbc069e4aabd3b31130a378a3","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":null,"mbox":"https://patchwork.libcamera.org/patch/8428/mbox/","series":[{"id":1042,"url":"https://patchwork.libcamera.org/api/1.1/series/1042/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1042","date":"2020-06-25T22:38:51","name":"libcamera: ipu3: Allow zero-copy RAW stream","version":4,"mbox":"https://patchwork.libcamera.org/series/1042/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8428/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8428/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 4514AC2E66\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Jun 2020 22:39:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E955760AF8;\n\tFri, 26 Jun 2020 00:39:22 +0200 (CEST)","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 7CD65609C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2020 00:39:19 +0200 (CEST)","from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid b2de80fe-b734-11ea-933e-005056917a89;\n\tFri, 26 Jun 2020 00:39:15 +0200 (CEST)"],"X-Halon-ID":"b2de80fe-b734-11ea-933e-005056917a89","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 26 Jun 2020 00:38:54 +0200","Message-Id":"<20200625223900.1282164-4-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200625223900.1282164-1-niklas.soderlund@ragnatech.se>","References":"<20200625223900.1282164-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 3/9] libcamera: ipu3: Calculate number\n\tof buffers for ImgU","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":"Decouple the number of buffers to allocate for the ImgU from the number\nof buffers allocated for the CIO2. Instead of blindly following the CIO2\npick the maximum number of buffers requested for any stream facing\napplications.\n\nThis is potentially wasteful, as each stream could allocate just as many\nbuffers as requested by the application instead of the maximum from the\nset. But this is not more wasteful than what is already used by the\npipeline and should be fixed on top after the decoupling of the two\nprocessing units.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n* Changes since v1\n- Use std::max({ ... })\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex db52bff46f45e55f..4fbc9ae54ddf049b 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -735,7 +735,11 @@ int PipelineHandlerIPU3::allocateBuffers(Camera *camera)\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tbufferCount = ret;\n+\tbufferCount = std::max({\n+\t\tdata->outStream_.configuration().bufferCount,\n+\t\tdata->vfStream_.configuration().bufferCount,\n+\t\tdata->rawStream_.configuration().bufferCount,\n+\t});\n \n \tret = imgu->allocateBuffers(data, bufferCount);\n \tif (ret < 0) {\n","prefixes":["libcamera-devel","v4","3/9"]}