From patchwork Thu Jul 9 08:41:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 8691 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 34CF3BD790 for ; Thu, 9 Jul 2020 08:38:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C9F9B61186; Thu, 9 Jul 2020 10:38:01 +0200 (CEST) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2946E61158 for ; Thu, 9 Jul 2020 10:38:00 +0200 (CEST) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 0EEFD10001C; Thu, 9 Jul 2020 08:37:58 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Jul 2020 10:41:08 +0200 Message-Id: <20200709084128.5316-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/20] libcamera: ipu3: Rework configuration 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" Hello, this second version combines what was sent in v1 to just rework the stream validation process with the computation of the ImgU configuration parameters. The series steers things in the opposite direction compared to v1 when it comes to stream assignment. V1 moved stream assignment to configure(), we here retain it in validateion AND remove it from configure(), by using StreamConfiguration::setStream() to remove the custom array of Streams that was used to keep the association in place. In order to be able to use setStream() at validate() time, the Camera class has been changed to not zero the streams array between calls to the pipeline handler validate() and configure() functions. The intent of that sequence was to make sure streams where populated after configure(), the restriction that that has to happen at configure and not validate is now lifted, and what we only care about is that -after- validate+configure we have streams correctly populated. When reworking validation all the assumptions about how streams have to be assigned have been reworked, allowing multiple YUV outputs and not restricting the usage of the main output to streams which are full-size only. The ImgU outputs are now always (at least) 32 pixels in size smaller than the input frame. This is not a requirement stated anywhere in the documentation, but inspecting the xml configuration file for ChromeOS and the results from the pipe configuration tool[1] it seems best results are obtained by giving the IF and BDS components at least 32 pixels to scale/crop. Speaking of pipe configuration, IF, and BDS, this series introduces in the IPU3 pipeline handler dynamic calculation of the pipeline intermediate components sizes, by importing the procedures implemented in the pipeline configuration script provided by Intel: [1] https://github.com/intel/intel-ipu3-pipecfg The tool has been first ported as a standalone C++ application, its computation verified against the python script results, and then integrated in the IPU3 pipeline handler. The computed results match the python script ones for all the cases I have tested (all the stream combination modes, and configurations with explicit sizes). Unfortunately, the parameters computed by the python tool differs from the ones reported in the ChromeOS .xml configuration files. A github issue has been opened asking for directions, but as of now, we can only assume the script is correct. As now we calculate the proper pipeline configuration, restrictions on the maximum available sizes have been removed as well. Jacopo Mondi (20): libcamera: ipu3: Rename mbusCodesToInfo libcamera: ipu3: Remove streams from generateConfiguration libcamera: ipu3: Make sure the config is valid libcamera: ipu3: cio2: Report format and sizes libcamera: ipu3: Do not overwrite StreamConfiguration libcamera: ipu3: Report StreamFormats libcamera: ipu3: Remove initialization of Size libcamera: ipu3: Validate the stream combination libcamera: camera: Zero streams before validate() libcamera: ipu3: Adjust and assign streams in validate() libcamera: ipu3: Adjust full frame picture to 32 pixels libcamera: ipu3: Always use the maximum frame size libcamera: ipu3: Store CameraData as mutable in CameraConfiguration libcamera: ipu3: Remove streams from IPU3CameraConfiguration libcamera: ipu3: Remove camera_ from IPU3CameraConfiguration libcamera: geometry: Add isNull() function to Rectangle class libcamera: ipu3: imgu: Calculate ImgU pipe configuration libcamera: ipu3: Calculate ImgU pipe configuration lbcamera: ipu3: Configure ImgU with the computed parameters libcamera: ipu3: imgu: Rename configureInput() include/libcamera/geometry.h | 1 + src/libcamera/camera.cpp | 4 +- src/libcamera/geometry.cpp | 6 + src/libcamera/pipeline/ipu3/cio2.cpp | 58 +++- src/libcamera/pipeline/ipu3/cio2.h | 5 + src/libcamera/pipeline/ipu3/imgu. | 0 src/libcamera/pipeline/ipu3/imgu.cpp | 401 +++++++++++++++++++++++++-- src/libcamera/pipeline/ipu3/imgu.h | 22 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 389 ++++++++++++-------------- 9 files changed, 648 insertions(+), 238 deletions(-) create mode 100644 src/libcamera/pipeline/ipu3/imgu. --- 2.27.0