From patchwork Wed Aug 10 00:29:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17061 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 4061AC3272 for ; Wed, 10 Aug 2022 00:29:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 998FD6332D; Wed, 10 Aug 2022 02:29:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660091360; bh=08poPdMZNXc+OeG5SY0glgzdV+tlhrwhu0UqyevsiZg=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XwawVj/3AGfPST2kGCzoHc3++4ZUBglTtD+Jwc3J5q5vP5Om3Xp48iYfy97526u21 Q9yiykqCDQi8gy5+IXFdtx/si9KFdS2b+pcvEL3D3ra6qQccoFmNhWaUL6BQ9RV0iB HKFlE9bArqBvU5IhKEtTeEBcf7gUOU9l2TGfkBfFqQYLYAxkBNNmlDJawlLkpMHobb K1J9PG0ai/l9evj/hzgtKM7HvrP3cVEgl6EvLRwUxicTQ72Ow2XCfTit1LIOtW2DNs qrLlVyywBB8Jb1tdRE2pGqDGFTcVa4e3m42NoJr58L8HA0Ec5NPmUJD+50OEd8HpYY HRI+rO7qo2adg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1349061FA9 for ; Wed, 10 Aug 2022 02:29:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="H6P2CG0w"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 627BC481; Wed, 10 Aug 2022 02:29:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1660091358; bh=08poPdMZNXc+OeG5SY0glgzdV+tlhrwhu0UqyevsiZg=; h=From:To:Cc:Subject:Date:From; b=H6P2CG0wAEm9sc195YrTYRju9+Tn1IacZAZHYvfhR/7h39veMoeK6NWXofcoPpQVv 0d1f8MGSafq1DP32q0GhqYk1QRNPuJOAHCvGoJusVALvXrdbmcdgJQ2CcVlAhoPLs1 RXLxAqr0RhrokddOQPFvGwedotNNxFUoH31IWCq0= To: libcamera-devel@lists.libcamera.org Date: Wed, 10 Aug 2022 03:29:02 +0300 Message-Id: <20220810002906.5406-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/4] libcamera: Improve handling of fixed-size array controls 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series builds up on top of Christian's "ibcamera: controls: Generate and use fixed-sized Span types" patch to improve support of fixed-size array controls. It started as an itch I wanted to scratch, being bothered by the explicit Span construction in the Raspberry Pi IPA module. The series starts with patch 1/4 that refactors the gen-controls.py script to make it (hopefully) more readable, without any functional change. Patch 2/4 then improves the YAML notation for variable-size array controls, and patch 3/4 extends the Control class to provide access, at compilation time, to the control size in addition to its type. The result is patch 4/4, which reverts usage of the explicit Span constructor in the Rapsberry Pi IPA module. As described in patch 3/4, this could be extended with the ability to perform runtime checks on control sizes, but that's an exercise I'll leave for later. Laurent Pinchart (4): utils: gen-controls: Factor out YAML data handling in classes utils: gen-controls: Improve YAML notation for variable-size array controls libcamera: controls: Store array control size in Control class ipa: raspberrypi: Remove unneeded Span casts include/libcamera/controls.h | 20 +-- src/ipa/raspberrypi/raspberrypi.cpp | 19 ++- src/libcamera/control_ids.yaml | 2 +- src/libcamera/controls.cpp | 37 ++++-- src/libcamera/property_ids.yaml | 4 +- utils/gen-controls.py | 195 +++++++++++++++++++++------- 6 files changed, 197 insertions(+), 80 deletions(-) base-commit: e1ca213609abb99cc1b6e6f16214bf5a0936f3b7