From patchwork Sun Jun 28 00:15:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 8457 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 85DF8C2E69 for ; Sun, 28 Jun 2020 00:15:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA634609C5; Sun, 28 Jun 2020 02:15:47 +0200 (CEST) Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE432609A9 for ; Sun, 28 Jun 2020 02:15:45 +0200 (CEST) X-Halon-ID: 6bbd32ff-b8d4-11ea-86ee-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 6bbd32ff-b8d4-11ea-86ee-0050569116f7; Sun, 28 Jun 2020 02:15:10 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sun, 28 Jun 2020 02:15:19 +0200 Message-Id: <20200628001532.2685967-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/13] libcamera: ipu3: Refactoring of ImgU X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This series do some cleanup of the IPU3 pipeline. It removes dead or almost dead code, replacing it with something more coherent to what is done elsewhere in the pipeline. It breaks out the ImgU to a separate cpp and h file. It reworks a bit how the streams are identified and handled inside the pipeline. When the pipeline was first developed only the output and viewfinder streams where available, now we have a RAW stream in addition to this. Some of the abstraction around streams and which hardware resource they are backed by made sens in the earlier context but not so much once RAW is added to the mix. The biggest difference in this rework is that the ImgUDevice gets explicit functions to configure each of its sink instead of having a generic one which depends which pointer is passed to it. This makes reading code where RAW and ImgU streams are mixed much nicer IMHO. Lastly some assumptions that buffers must be allocated at video nodes that are not involved in the capture session are being challenged. This was true a year ago but not any more it seems. Chancing this simplifies the driver enormously and saves on memory that otherwise would be wasted. I have really tried to force the end result to failed by resetting the hardware between each test so that no video node configuration from a previous sessions saves the day. I have for both sensors reset the hardware and then tested the following capture combinations successfully. After the first capture session for each one in the list that was done after a power cycle all the other captures where tried in a semi random order and always succeeded. cam -c 1 -s role=viewfinder -C cam -c 1 -s role=still -C cam -c 1 -s role=still -s role=viewfinder -C cam -c 1 -s role=still -s role=viewfinder -s role=stillraw -C cam -c 1 -s role=stillraw -C Niklas Söderlund (13): libcamera: ipu3: Remove unused name_ filed from IPU3Stream libcamera: ipu3: Import instead of allocate statistic buffers libcamera: ipu3: Always import buffers for ImgU sinks libcamera: ipu3: Remove usage of IPU3CameraData from ImgUDevice libcamera: ipu3: imgu: Move the ImgUDevice class to separate files libcamera: ipu3: imgu: Do not cache index libcamera: ipu3: imgu: Mark things that are internal as private libcamera: ipu3: imgu: Use specific functions to configure each sink libcamera: ipu3: Do not duplicate data in IPU3Stream libcamera: ipu3: Remove the active flag from IPU3Stream libcamera: ipu3: Remove IPU3Stream libcamera: ipu3: imgu: Remove ImgUOutput libcamera: ipu3: imgu: Use unique_ptr for video and subdevices src/libcamera/pipeline/ipu3/imgu.cpp | 353 +++++++++++++++ src/libcamera/pipeline/ipu3/imgu.h | 87 ++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 548 +++--------------------- src/libcamera/pipeline/ipu3/meson.build | 1 + 4 files changed, 505 insertions(+), 484 deletions(-) create mode 100644 src/libcamera/pipeline/ipu3/imgu.cpp create mode 100644 src/libcamera/pipeline/ipu3/imgu.h