From patchwork Tue Jul 14 10:41:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 8775 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 B1D56BD792 for ; Tue, 14 Jul 2020 10:38:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0D7D2605B0; Tue, 14 Jul 2020 12:38:49 +0200 (CEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 24B3B60486 for ; Tue, 14 Jul 2020 12:38:47 +0200 (CEST) Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id B0A6324000F; Tue, 14 Jul 2020 10:38:46 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 14 Jul 2020 12:41:52 +0200 Message-Id: <20200714104212.48683-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/20] libcamera: ipu3: Rework pipe 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, quite a big update compared to v2, even if most changes happens in 3 patches The new stream size computations which happens at generateConfiguration() and validate() time now enforces a new rule - All YUV streams should be aligned to the 64 pixels in widht and 32 pixels in height multiple which is strictly smaller than the CIO2 output frame. This is reflected in how configurations are generated, how the CIO2 size is computed when no raw stream is requested, and how the YUV streams are adjusted to respect this margin constraint and the device required alignment. Most of this changes happens in patch [5/20] and [14/20] I also have simplified a bit the ImgU pipe parameters calculation. There is a huge space for improvements there probably, but I'm very cautious in touching this. The changelog is in the patch for the records. Also, compared to v2, the ImgU pipe gets configured only if there's at least one YUV stream requested, otherwise setting sizes for the IF and BDS rectangle without actually capturing frames from any of the ImgU output, stalls the ImgU which require system to be rebooted to work correctly again. Validated by using all the possible stream roles combinations, and inspecting images which despite the horrible quality (as there's no 3A working) are actually there. I'm sure that poking the system with more size combinations will highlight more issues, but I still think this is an acceptable start. Thanks j v2 -> v3: - Rework stream size logic to respect alignements and margins - Add utils::alignUp/utils::alignDown - Rework stream adjustments - Simplify a bit the ImgU pipe parameters calculation - Do not configure the ImgU if only RAW stream is requested Jacopo Mondi (19): libcamera: ipu3: Rename mbusCodesToInfo libcamera: utils: Add alignUp and alignDown functions libcamera: geometry: Add isNull() function to Rectangle class 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: cio2: Mark sensor() as const libcamera: ipu3: Adjust and assign streams in validate() libcamera: ipu3: Remove streams from IPU3CameraConfiguration libcamera: ipu3: Remove camera_ from IPU3CameraConfiguration libcamera: ipu3: imgu: Calculate ImgU pipe configuration libcamera: ipu3: Validate the pipe configuration libcamera: ipu3: Configure ImgU with the computed parameters libcamera: ipu3: imgu: Rename configureInput() Laurent Pinchart (1): libcamera: geometry: Add helper functions to the Size class include/libcamera/geometry.h | 34 +++ include/libcamera/internal/utils.h | 3 + src/libcamera/camera.cpp | 4 +- src/libcamera/geometry.cpp | 42 +++ src/libcamera/pipeline/ipu3/cio2.cpp | 54 +++- src/libcamera/pipeline/ipu3/cio2.h | 7 +- src/libcamera/pipeline/ipu3/imgu. | 0 src/libcamera/pipeline/ipu3/imgu.cpp | 387 +++++++++++++++++++++++-- src/libcamera/pipeline/ipu3/imgu.h | 22 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 414 +++++++++++++-------------- src/libcamera/utils.cpp | 22 ++ test/geometry.cpp | 35 +++ test/utils.cpp | 18 ++ 13 files changed, 799 insertions(+), 243 deletions(-) create mode 100644 src/libcamera/pipeline/ipu3/imgu. --- 2.27.0