From patchwork Sat Feb 29 16:42:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2918 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4794B62689 for ; Sat, 29 Feb 2020 17:43:22 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B49B833E for ; Sat, 29 Feb 2020 17:43:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1582994601; bh=10e9c2Qbfi0mSsiKQ3nw1Eq+kgUEHqd8I9IpWQrzg+Q=; h=From:To:Subject:Date:From; b=qgm6k2Me3Vn40vjHJtSemdimWD/Cu/RxWbPIHHbRxoegDOyA+kVim4qGIPkAa6E/H 1wMKUOPOV7iX18IdRHd2oibYPKb4kUneWiCF3TQ7EVVFTVve7J1wbfa4QLke3CzzKD bQ73VA88lk7qOG/9DjAz4LMBwbJlRXiquXCCTfxE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 29 Feb 2020 18:42:23 +0200 Message-Id: <20200229164254.23604-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/31] libcamera: Add support for 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-List-Received-Date: Sat, 29 Feb 2020 16:43:22 -0000 Hello, This large patch series is the result of collective work from Jacopo and me. It adds support in the libcamera Control classes to handle array of values, in addition to the single values we support today. The first two patches (01/31 and 02/31) add an implementation of the C++20 std::span<> class and a related test. This will be used extensively to support array controls. The next 13 patches (03/31 to 15/31) refactor the control-related classes, as well as the IPA control code, to prepare for array controls. Patch 16/31 is then the main change in the series, implementing support for array controls, and patch 17/31 improves the ControlList::set() API to make array controls more usable. Patch 18/31 wires this up in the yaml parser. Patches 19/31 and 20/31 are a small intermission that add support for float and int8_t controls. The latter is particularly useful to create byte array controls. Patch 21/31 adds support for array controls in the IPA protocol, patches 22/31 to 24/31 improve the ByteStreamBuffer class and patches 25/31 to 27/31 extend the control serializer to support array controls. Patch 28/31 finally extends the cam utility to support array controls. Patches 29/31 to 31/31 add test-cases specific to array controls. Those are not meant to be integrated yet as we're missing a standard array control in libcamera, the patches thus create a fictional control for that purpose. They should be rebased on top of the first real array control and merged at that point. Jacopo Mondi (14): libcamera: Add a C++20-compliant std::span<> implementation libcamera: gen-controls: Fix documentation issue with << libcamera: ipa: Remove unused IPA control types libcamera: controls: Reorder ControlValue methods libcamera: controls: Support array controls in ControlValue libcamera: controls: Add a 'size' yaml property libcamera: controls: Add support for float controls libcamera: controls: Add support for int8_t controls libcamera: byte_stream_buffer: Fix documentation of read() and write() libcamera: byte_stream_buffer: Add Span<> support libcamera: control_serializer: Add support for array controls cam: Add option to list camera properties DNI: test array controls DNI: test: serialization: Serialize array controls Laurent Pinchart (17): test: Add Span test libcamera: ipa: Make self-contained libcamera: ipa: Test control structure size with static_assert libcamera: controls: Don't convert 32-bit and 64-bit implicitly libcamera: controls: Decouple control and value type in ControlList::set() libcamera: controls: Return control by value in ControlList::get() libcamera: controls: Add templates to convert a type T to a ControlType libcamera: controls: Move ControlValue get() and set() to controls.h libcamera: controls: Move ControlValue constructor to controls.h libcamera: controls: Move Control constructor to controls.h libcamera: controls: Expose raw data in ControlValue libcamera: controls: Allow passing an std::initializer list to set() libcamera: ipa: Support array controls in ipa_control_value_entry libcamera: byte_stream_buffer: Add zero-copy read() variant libcamera: control_serializer: Simplify serialization of ControlValue libcamera: control_serializer: Use zero-copy ByteStreamBuffer::read() DNI: test: serialization: Serialize array control with a single element Documentation/Doxyfile.in | 6 +- include/ipa/ipa_controls.h | 19 +- include/libcamera/controls.h | 170 +++++++- include/libcamera/meson.build | 1 + include/libcamera/span.h | 417 +++++++++++++++++++ src/cam/main.cpp | 28 ++ src/cam/main.h | 1 + src/libcamera/byte_stream_buffer.cpp | 61 ++- src/libcamera/control_ids.yaml | 5 + src/libcamera/control_serializer.cpp | 180 ++++---- src/libcamera/controls.cpp | 312 ++++++++------ src/libcamera/gen-controls.py | 16 +- src/libcamera/include/byte_stream_buffer.h | 26 ++ src/libcamera/include/control_serializer.h | 6 +- src/libcamera/ipa_controls.cpp | 53 ++- src/libcamera/meson.build | 1 + src/libcamera/pipeline/vimc.cpp | 5 + src/libcamera/span.cpp | 12 + test/controls/array_controls.cpp | 107 +++++ test/controls/meson.build | 1 + test/meson.build | 1 + test/serialization/control_serialization.cpp | 3 +- test/span.cpp | 177 ++++++++ 23 files changed, 1336 insertions(+), 272 deletions(-) create mode 100644 include/libcamera/span.h create mode 100644 src/libcamera/span.cpp create mode 100644 test/controls/array_controls.cpp create mode 100644 test/span.cpp