{"id":3889,"url":"https://patchwork.libcamera.org/api/covers/3889/?format=json","web_url":"https://patchwork.libcamera.org/cover/3889/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20200602013909.3170593-1-niklas.soderlund@ragnatech.se>","date":"2020-06-02T01:38:59","name":"[libcamera-devel,00/10] libcamera: ipu3: Allow zero-copy RAW stream","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"mbox":"https://patchwork.libcamera.org/cover/3889/mbox/","series":[{"id":943,"url":"https://patchwork.libcamera.org/api/series/943/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=943","date":"2020-06-02T01:38:59","name":"libcamera: ipu3: Allow zero-copy RAW stream","version":1,"mbox":"https://patchwork.libcamera.org/series/943/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/3889/comments/","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["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 34BBA603C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Jun 2020 03:39:28 +0200 (CEST)","from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid d060fa1b-a471-11ea-a73e-0050569116f7;\n\tTue, 02 Jun 2020 03:38:58 +0200 (CEST)"],"X-Halon-ID":"d060fa1b-a471-11ea-a73e-0050569116f7","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":"Tue,  2 Jun 2020 03:38:59 +0200","Message-Id":"<20200602013909.3170593-1-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.26.2","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 00/10] libcamera: ipu3: Allow zero-copy\n\tRAW stream","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>","X-List-Received-Date":"Tue, 02 Jun 2020 01:39:28 -0000"},"content":"Hi,\n\nThis series removes the need to copy the buffer when capturing RAW \nbuffers from the IPU3 pipeline. This is made possible by allocating an \ninternal queue of buffers in the pipeline handler which is used when the \napplication does not provide an buffer for the RAW stream.\n\nThe first 9 out of 10 patches in this series cleans up the IPU3 pipeline \nhandler a but and breaks out the CIO2Device helper class into separate \ncio.{cpp,h} files. The CIO2Device is also reworked to make its interface \nmore strict, making it easier to grasp what is going in in ipu3.cpp. I \nplan to post similar patches breaking out the ImgU on top of this \nseries.\n\nThere is on issue with this series. If the camera is configured to \nsupply the application with more then one stream and one of them is a \nRAW stream. Then the sequence number of the RAW buffers in all requests \nare set to 0 before the request completes. This is due to that if two or \nmore streams are used the RAW buffer is always queued to the ImgU input \nto serve as input to the vf and/or output buffers. When the RAW buffers \nis dequeued from the ImgU input device the kernel sets the sequence \nnumber to zero. I believe this is a kernel issue and should be fixed \nthere.\n\nAs the RPi pipeline handler already started using the copy approach we \ncan not yet rename to role nor remove the copyFrom() helper. I aim to \nwork on that once the approach taken in this series is agreed upon.\n\nNiklas Söderlund (10):\n  libcamera: stream: Initialize stride and bufferCount\n  libcamera: ipu3: Remove id from camera names\n  libcamera: ipu3: Fold mediaBusToFormat() into only caller\n  libcamera: ipu3: Breakout stream assignment to new function\n  libcamera: ipu3: Calculate number of buffers for ImgU\n  libcamera: ipu3: cio2: Move the CIO2Device class to separate files\n  libcamera: ipu3: cio2: Add function to generate configuration\n  libcamera: ipu3: cio2: Make the V4L2 devices private\n  libcamera: ipu3: cio2: Hide buffer allocation and freeing from users\n  libcamera: ipu3: Allow zero-copy RAW stream capture\n\n src/libcamera/pipeline/ipu3/cio2.cpp    | 292 ++++++++++++++\n src/libcamera/pipeline/ipu3/cio2.h      |  76 ++++\n src/libcamera/pipeline/ipu3/ipu3.cpp    | 500 +++++-------------------\n src/libcamera/pipeline/ipu3/meson.build |   1 +\n src/libcamera/stream.cpp                |   5 +-\n 5 files changed, 478 insertions(+), 396 deletions(-)\n create mode 100644 src/libcamera/pipeline/ipu3/cio2.cpp\n create mode 100644 src/libcamera/pipeline/ipu3/cio2.h"}