From patchwork Fri Apr 1 00:06:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Rauch X-Patchwork-Id: 15603 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 52BD3C0F1B for ; Fri, 1 Apr 2022 00:06:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 85DC165633; Fri, 1 Apr 2022 02:06:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1648771593; bh=l/tZWxQ1Somu1FPOzMlLIrfe4No3CI/birou7jckx48=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wINShdzL73FleeS1Vzi/3xDTB1j0SdHnGdejhtmnuKexs57u93Wo00k2dcjAPMOcz 7Yap2Wu+aCSQ+sPty+sI6LWg+nM3dntoSlwVno3Vsg19nQhgPukpgQy9acqpyfC/Oe lhk5vNF69HoNmfH0mMNMxgb0uhth/lLb7opemmOCtjVUxF99uwVW5TooqFVUO2LbtG DuuNfR0/VpT3gqn2XxDBTiMwVBTapC0y2wkCsrUEyVXxEOXnwitU0mpmlMITx2OjaU 72kxaKEdlLaeZVFDaW1IpVjgttd10I9mXVL17YLairP0NblZX1YPyXjcyFNtb+2Kq/ FM9aC2crMVlsg== Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E7DA160135 for ; Fri, 1 Apr 2022 02:06:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=gmx.net header.i=@gmx.net header.b="Aj5xEIsf"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1648771591; bh=l/tZWxQ1Somu1FPOzMlLIrfe4No3CI/birou7jckx48=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=Aj5xEIsfEWyW7k0sXXL85Puhoa+6yhgtfdPST7jTJhz4SmHeg9rfgmzCDfk5MOh2s 7WIzxZVUpMlXIGVHQX4Y+c+EhZ5aY11ASDpoIFgJ/2lo6qc0a1ardwTGCFbfY0fmNO 9u+V7BHQNG748EqCMFvxUiM0KxrOeibb7zkmiaQQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([92.10.251.63]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MIMbO-1nmER11sgu-00EIYK; Fri, 01 Apr 2022 02:06:31 +0200 To: libcamera-devel@lists.libcamera.org Date: Fri, 1 Apr 2022 01:06:11 +0100 Message-Id: <20220401000616.12976-1-Rauch.Christian@gmx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:OVnlV5mIycrJpRVVSFmjLdCZWOIb7AUKMAN36QrhEl4xen62VFh rlLHaVd0Q0WVUxskGgkmgkPJFWT+CLYdLDUJKJYCBdOgQLx/P7EZIch5qSs5Wa3jOMc+gKc KMP9PZM5JMqZ0aTe3IRSTfeZd+5Ks0YMlsOy2Uksk09/rHnYKG00RtTv1bCWvZFtEFHFECk hAjWXwLslCXQNHibEop3w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:+LKxQE8IhXs=:6wmyk0DHWfWabbH0wHXhI+ O+t46riB81orcfLFDUWedqZCntYpwftm1f887CqFaVpAq2wdQvpvUoCQh7GAAtYkubkaLzgK8 D9hQRdL3r7//KRI5BnIdjQqXk63ZUgxkBRkjZ3UYtAFVgscPXNqeGnzfqIHGyWHS2aacIoirA pfiw8kkPl15AJfqO8M/eomN4p5tVN4/tEgcFdPOFpn+1FL06uPjbWtTBeDEjQxFV+IgWhXD/H cISryqIG9RlMzE2JYcDC//rxfLMj2fPPN5XD+rqiK5SBHdgMu7j0MWdSm4LTnQoEyAeAbYalT VYfYClaugocsiNXAoNtHxAcddo+pPfLeSejZqFzkGXMjMue8jIDtd78A39BBw2IYEtbfZKCjk Jlu115cPV9ytRMDMRtBCxIBzDtdGVvAGW4QwkNl7zSH8ugVnB4szbvVTilEmojyko9FgWASAv HEbf6hwTgBpNBn/bWH3EBZ4OxCZtpsZXF7mB99+D3T8oAq5vsguD192OLThK4XY4ytLyMDShL Tp5rS6sBP9kjr7YukQncaDlqMh+64gWnJtm+xO7PawsDz7GlVaBWeCrL2oAOli+bm299heyjb eQH3z3SgT+/YPMTPXvC/7hGF6ParceldacewMQFXJTbU3MNtiVTYG8RUBTxamvtI4UqasDhdP r07IuAKtqCq0BK8jd3qRz22pDEO1yYumXL8RsoFPunlHtdx6VEgRmyP1hhhQxwdFwFMO5Cl/b dbV3CZXtlXJS28tF9Kl2PQBX7RUsbENHeWoOCN2rP0HWrDzEXdCysGB0w6SZJisnlESV2wW9b bQl1AzEcBjCF3au8m9XDwl3rxZJjFwk0qv36LbZeE8attbTUHCj68vt8PedHGcRY1YuEKE1zR OInD7qqgsvaDNGCDFcY4IFXSD2IcDDvsfKQ/l3zSqMWWW9cFXf0hWf10kenlqsQdr/1idgsKR hR5n4ReH2wHvzyMibBuY+f7DtYbR84DfzRizyZSWzPmLPWgeot/oiSFCYzeHmxiFKQlLnGNDJ KQxinXtl6VuiNKbLvrAnhkWiyvtVQMqMBeXfCbikfuxiYFUripzIPBE1Q8lhQAnHe/Eavk+5i bU+X54G4PCRLDk= Subject: [libcamera-devel] [PATCH 0/5] generate and use fixed-sized Span Control types 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: , X-Patchwork-Original-From: Christian Rauch via libcamera-devel From: Christian Rauch Reply-To: Christian Rauch Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This series of patches explicitely defines Spans of Control as either fixed- or variable- sized. The control and property definitions in "control_ids.yaml" and "property_ids.yaml", respectively, already specify the size of array-typed Controls. The "gen-controls.py" script, which generates source and header files from those definitions, currently ignores the provided "size" value and translates any "size" into a variable-sized Span. The motivation for this is to carry the dimensionaltiy of a Control from its original definition within the source into the public API, in order to provide information about the dimension of the settings that a camera is expecting. Currently, this information is not available via the public API. This patch series implements the fixed-sized Span generation in three steps: 1. The format of the "size" property in the definitions is now interpreted as a shape array, where an array of size greater than 1 (e.g. [3,3]) defines the shape of a multi-dimensional array (a.k.a. tensor), and an empty size (e.g. []) defines a variable-sized array. 2. When a Control is deifned with a size in the yaml (e.g. "size: [2]"), the "gen-controls.py" script now translates this into a fixed-sized Span (e.g. with N=2). This requires a default contructor for fixed-sized Spans and the removal of 0-fixed-sized Spans (i.e. Span). 2. Where applicable, the old variable-sized Span types are replaced by the new fixed-sized Span types, in some cases by explicit casts. This patch set is submitted in conjunction with my set of patches that fully define the ControlInfo of Span Controls, but can be applied seperately without a change in the default behaviour. Best, Christian Christian Rauch (5): define Span size as shape vector generate fixed- and variable-sized Span Controls provide a default fixed-sized Span constructor apply clang-format style apply explicit fixed-sized Span type casts include/libcamera/base/span.h | 50 +++--- include/libcamera/controls.h | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 21 +-- src/libcamera/control_ids.yaml | 2 +- .../pipeline/raspberrypi/raspberrypi.cpp | 36 +++-- src/libcamera/property_ids.yaml | 4 +- src/qcam/dng_writer.cpp | 142 +++++++++--------- test/span.cpp | 6 +- utils/gen-controls.py | 33 ++-- 9 files changed, 160 insertions(+), 136 deletions(-) --- 2.25.1