From patchwork Thu Oct 6 23:07:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17555 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 1798BBD16B for ; Thu, 6 Oct 2022 23:07:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9336762CFD; Fri, 7 Oct 2022 01:07:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665097674; bh=VrIlySdh6nxGSgR+FfjRqgQytDPM6rXi7VNW7fH9kmw=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=x88PRuebRwqTBPQeYZDy0S1LyoPhNs5X4CopWeJbU9h7Zwwuc6GjpmCn6LBOZ/qUf bX5cWl/7fIlJu+T+xBYxM4pDf4BupSdaJa9YZ3TU3BEP/mZosEvCsIqlHL81IkAYX5 Lpoc+2fAhFpMcyVVb2hDJZQzjqwpBe7RXVCRbZbM2mIhktcovjC4FmMkn45TsgtXHB 6mqOxSMFZDxT5h2dc/FDpDa6Xi6E2xKhGvWVA1YHIjKh6uLXV3yFJr5/Bt3njUnJWU 0sB9IghQgUv7ZosnpCJOAaFf42tm3eDPqkojwnUsNcSXkak3tPsUxu7uGdZdH6hx5g rux0ezBVDB1XQ== 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 7C8F6603D7 for ; Fri, 7 Oct 2022 01:07:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wI40zPWM"; 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 BC5D46D6; Fri, 7 Oct 2022 01:07:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665097673; bh=VrIlySdh6nxGSgR+FfjRqgQytDPM6rXi7VNW7fH9kmw=; h=From:To:Cc:Subject:Date:From; b=wI40zPWM81+zVPPTh30mmMS0JW6SUHPWWtGjA2ncS2ruPNQ3cVAOuCNm71VreQulR Rf5WGa6Uynuj/hsYG+LDjbQZJ/sDo1IKNWHSgILOG2RkPYNNw1825KTsld9Wp1Vfjk FPWJaJRfdK1yaE/XLFvRLn/yR0zrFQEB5iIr9b+k= To: libcamera-devel@lists.libcamera.org Date: Fri, 7 Oct 2022 02:07:43 +0300 Message-Id: <20221006230747.11688-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 "libcamera: 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 improves the Control::set() function to construct the Span using the size provided by the Control class definition. The result is patch 4/4, which reverts usage of the explicit Span constructor in the Rapsberry Pi IPA module. Compared to v1, the intrusive 3/4 patch got replaced with a much simpler version. 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: Construct Span with size for array controls ipa: raspberrypi: Remove unneeded Span casts include/libcamera/controls.h | 6 +- src/ipa/raspberrypi/raspberrypi.cpp | 19 ++- src/libcamera/control_ids.yaml | 2 +- src/libcamera/controls.cpp | 2 +- src/libcamera/property_ids.yaml | 4 +- utils/gen-controls.py | 175 ++++++++++++++++++++-------- 6 files changed, 141 insertions(+), 67 deletions(-) base-commit: 8c2b092a20ec0c6bcfc4af489fb6b4b7ab656d63