From patchwork Fri Mar 6 15:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2972 Return-Path: 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 7265160424 for ; Fri, 6 Mar 2020 17:00:11 +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 E96BA24B for ; Fri, 6 Mar 2020 17:00:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583510411; bh=MpJvuZDjzBrOPvsg/HgJH2pGkWqIMvr3TvteRSPH9R4=; h=From:To:Subject:Date:From; b=cWeaFSApvGY9hs2jgsB5595lcAK91mbADtKz3ufW4h+A9ACurcq6iPq09fCqBqemh CCpkG3os1ph6xzEWt4XrkdySLuwBy097E/IGcYPifuG4UDgWhAHAh28uZ12mOGzHJ5 wLDnjikcew4t0YVAyp1TQjFiXKe+bGFNmRj+GByA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Mar 2020 17:59:30 +0200 Message-Id: <20200306160002.30549-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/32] 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: Fri, 06 Mar 2020 16:00:11 -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. Compared to v1, small issues have been fixed, based on review comments. The patches not meant for integration have been dropped. The first two patches (01/32 and 02/32) 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/32 to 15/32) refactor the control-related classes, as well as the IPA control code, to prepare for array controls. Patch 16/32 is then the main change in the series, implementing support for array controls, and patch 17/32 improves the ControlList::set() API to make array controls more usable. Patch 18/32 wires this up in the yaml parser. Patches 19/32 and 20/32 are a small intermission that add support for float and bytes controls (previously int8_t). The latter is particularly useful to create byte array controls. Patch 21/32 then changes to boolean control print code to use lower case. Patch 22/32 adds support for array controls in the IPA protocol, patches 23/32 to 25/32 improve the ByteStreamBuffer class and patches 26/32 to 29/32 extend the control serializer to support array controls. Patches 30/32 and 31/32 extend the ControlValue test cases to test all control types and array controls. Note that the array control API of the ControlList class isn't tested here, for lack of an array control defined in libcamera. Separate tests with a fictional array control have been performed and will be reposted separately when a real array control will be available. Patch 32/32 finally extends the cam utility to support array controls. Jacopo Mondi (12): 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 byte 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 Laurent Pinchart (20): 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 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: controls: Convert bool ControlValue to lowercase strings libcamera: ipa: Support array controls in ipa_control_value_entry libcamera: byte_stream_buffer: Add zero-copy read() variant libcamera: control_serializer: Use explicit ControlTypeNone case libcamera: control_serializer: Simplify serialization of ControlValue libcamera: control_serializer: Use zero-copy ByteStreamBuffer::read() test: controls: control_value: Expand test to cover all control types test: controls: control_value: Expand test to cover array controls Documentation/Doxyfile.in | 5 +- 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_serializer.cpp | 184 ++++----- src/libcamera/controls.cpp | 308 +++++++++------ 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 +-- test/controls/control_value.cpp | 211 +++++++++-- test/meson.build | 1 + test/span.cpp | 181 +++++++++ 17 files changed, 1394 insertions(+), 294 deletions(-) create mode 100644 include/libcamera/span.h create mode 100644 test/span.cpp