{"id":8425,"url":"https://patchwork.libcamera.org/api/covers/8425/?format=json","web_url":"https://patchwork.libcamera.org/cover/8425/","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":"<20200625223900.1282164-1-niklas.soderlund@ragnatech.se>","date":"2020-06-25T22:38:51","name":"[libcamera-devel,v4,0/9] 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/8425/mbox/","series":[{"id":1042,"url":"https://patchwork.libcamera.org/api/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/covers/8425/comments/","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 0E00AC2E65\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Jun 2020 22:39:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1ED21609C7;\n\tFri, 26 Jun 2020 00:39:19 +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 67859603BA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2020 00:39:17 +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 ace39f9b-b734-11ea-933e-005056917a89;\n\tFri, 26 Jun 2020 00:39:12 +0200 (CEST)"],"X-Halon-ID":"ace39f9b-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:51 +0200","Message-Id":"<20200625223900.1282164-1-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 0/9] 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>","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":"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\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. This should either be solved in the kernel or by\nreworking how sequence numbers handled going out of libcamera, does it\nmake sens to have seq numbers on the buffer level ?\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 next.\n\nNiklas Söderlund (9):\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: Consolidate information about formats\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    | 297 ++++++++++++++\n src/libcamera/pipeline/ipu3/cio2.h      |  68 ++++\n src/libcamera/pipeline/ipu3/ipu3.cpp    | 497 +++++-------------------\n src/libcamera/pipeline/ipu3/meson.build |   1 +\n 4 files changed, 469 insertions(+), 394 deletions(-)\n create mode 100644 src/libcamera/pipeline/ipu3/cio2.cpp\n create mode 100644 src/libcamera/pipeline/ipu3/cio2.h"}