From patchwork Tue Mar 26 08:38:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 795 Return-Path: Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2FAAA610D5 for ; Tue, 26 Mar 2019 09:38:29 +0100 (CET) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9BA8F240005; Tue, 26 Mar 2019 08:38:28 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Mar 2019 09:38:43 +0100 Message-Id: <20190326083902.26121-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 00/19] libcamera: ipu3: Add ImgU support X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Mar 2019 08:38:29 -0000 Hello, patch count reduced a bit, from the 31 of v4+multiple-stream to this 19 for v5 of ImgU support series only. Quite some changes compared to v4 mostly suggested by Laurent during review: - Made CIO2Device and ImgUDevice classes and moved most of the code in class methods. The pipeline handler code now mostly interacts with a 'cio2' and an 'imgu' objects, and call methods on them to perform format configuration, memory allocation and start/stop of video devices. - Removed buffer queueing from viewfinder and stat: the nodes need to be linked and configured but buffers might not be queued there. - Profiled buffer sharing between CIO2 and ImgU input: requests for output buffers can be queued asynchronously without stalling the pipeline - Cache camera sizes and format at camera creation time - Add a few patches for geometry and v4l2_subdevice, to generalize helpers methods previously implemented for IPU3 pipeline only Two points remain to be clarified: - It is not yet clear to me how to calculate the sizes in the capture pipeline based on the requested output resolutions. Upstream pointed us to an XML file with all sizes hardcoded, which is an unacceptable solution as sizes have to be calculated dynamically based on requested stream configurations. -> upstream will provide a programmatic way to do so - When operating on one of the two ImgU pipes, if the other one is still linked from a previous capture operation, the whole ImgU unit stall. Please see 19/19 I try to explain the issue in a lengthy comment. -> to be notified to upstream I will send multiple stream support separately, to ease integration of ImgU support first. Thanks j Jacopo Mondi (19): libcamera: formats: Add toString() methods libcamera: formats: Define FormatEnum type libcamera: geometry: Add 0-initialized SizeRange constructor libcamera: geometry: Add toString to Rectangle libcamera: v4l2_subdevice: Rename deviceName() method libcamera: v4l2_device: Create device from entity name libcamera: v4l2_subdevice: Create device from entity name libcamera: ipu3: Cache the camera sizes libcamera: ipu3: Set stream configuration from sensor libcamera: ipu3: Create CIO2Device class libcamera: ipu3: Create ImgUDevice class libcamera: ipu3: Apply image format to the pipeline libcamera: ipu3: Implement memory handling libcamera: ipu3: Implement camera start/stop libcamera: ipu3: Queue requests to ImgU libcamera: ipu3: Connect CIO2 and ImgU bufferReady signals libcamera: ipu3: Use NV12 as default image format libcamera: ipu3: Limit resolution to 2560x1920 libcamera: ipu3: Enable ImgU media links src/libcamera/formats.cpp | 27 + src/libcamera/geometry.cpp | 27 +- src/libcamera/include/formats.h | 22 + src/libcamera/include/geometry.h | 13 +- src/libcamera/include/v4l2_device.h | 6 + src/libcamera/include/v4l2_subdevice.h | 15 +- src/libcamera/meson.build | 1 + src/libcamera/pipeline/ipu3/ipu3.cpp | 1183 ++++++++++++++++++++---- src/libcamera/v4l2_device.cpp | 40 + src/libcamera/v4l2_subdevice.cpp | 49 +- test/v4l2_subdevice/list_formats.cpp | 6 +- 11 files changed, 1203 insertions(+), 186 deletions(-) create mode 100644 src/libcamera/formats.cpp create mode 100644 src/libcamera/include/formats.h --- 2.21.0