[{"id":5389,"web_url":"https://patchwork.libcamera.org/comment/5389/","msgid":"<20200625014019.GU5980@pendragon.ideasonboard.com>","date":"2020-06-25T01:40:19","subject":"Re: [libcamera-devel] [PATCH v3 00/10] libcamera: ipu3: Allow\n\tzero-copy RAW stream","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nOn Tue, Jun 23, 2020 at 04:09:20AM +0200, Niklas Söderlund wrote:\n> Hi,\n> \n> This series removes the need to copy the buffer when capturing RAW\n> buffers from the IPU3 pipeline. This is made possible by allocating an\n> internal queue of buffers in the pipeline handler which is used when the\n> application does not provide an buffer for the RAW stream.\n> \n> There is on issue with this series. If the camera is configured to\n> supply the application with more then one stream and one of them is a\n> RAW stream. Then the sequence number of the RAW buffers in all requests\n> are set to 0 before the request completes. This is due to that if two or\n> more streams are used the RAW buffer is always queued to the ImgU input\n> to serve as input to the vf and/or output buffers. When the RAW buffers\n> is dequeued from the ImgU input device the kernel sets the sequence\n> number to zero. This should either be solved in the kernel or by \n> reworking how sequence numbers handled going out of libcamera, does it \n> make sens to have seq numbers on the buffer level ?\n> \n> As the RPi pipeline handler already started using the copy approach we\n> can not yet rename to role nor remove the copyFrom() helper. I aim to\n> work on that once the approach taken in this series is agreed upon.\n\nI think the approach is good. It will be a good occasion to add support\nin the core for what CIO2Device::tryReturnBuffer() does in private :-)\n\n> Niklas Söderlund (10):\n>   libcamera: camera_sensor: Make mbusCodes() return a set\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>  include/libcamera/internal/camera_sensor.h |   4 +-\n>  include/libcamera/internal/formats.h       |   2 +-\n>  src/libcamera/camera_sensor.cpp            |   1 -\n>  src/libcamera/formats.cpp                  |   7 +-\n>  src/libcamera/pipeline/ipu3/cio2.cpp       | 298 ++++++++++++\n>  src/libcamera/pipeline/ipu3/cio2.h         |  66 +++\n>  src/libcamera/pipeline/ipu3/ipu3.cpp       | 497 +++++----------------\n>  src/libcamera/pipeline/ipu3/meson.build    |   1 +\n>  test/camera-sensor.cpp                     |   2 +-\n>  9 files changed, 475 insertions(+), 403 deletions(-)\n>  create mode 100644 src/libcamera/pipeline/ipu3/cio2.cpp\n>  create mode 100644 src/libcamera/pipeline/ipu3/cio2.h","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 04684C0101\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Jun 2020 01:40:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C51DB609C3;\n\tThu, 25 Jun 2020 03:40:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BC710603BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Jun 2020 03:40:20 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 549C5521;\n\tThu, 25 Jun 2020 03:40:20 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"JgyFcq82\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593049220;\n\tbh=XyP5xRRUyGShHmP1rBIL3CoVWXMEqCe/HjJ8L6g0dhk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JgyFcq82b5XoIT7BhayyH13Ih4fq6mT5VS/8gbOAad0orgwPecOD2J7Laml2TuU5/\n\tB7mnBHS6jRflWWTzjMktqKJ8SBS9JfUrzQIOoMlvjW75AKm/+Fd+tocnGNWZ9/oDMF\n\tib0YK5MpU63vAhjOarnvODGVyTbX3/9JHHaQvvSw=","Date":"Thu, 25 Jun 2020 04:40:19 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200625014019.GU5980@pendragon.ideasonboard.com>","References":"<20200623020930.1781469-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200623020930.1781469-1-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v3 00/10] libcamera: ipu3: Allow\n\tzero-copy RAW 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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}}]