From a4e6a5085b465216546b802e6bb9d55ecf278c63 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 21 Dec 2023 11:12:33 +0100 Subject: libcamera: Add 'required' property to controls Add to the ControlId class a 'required' boolean flag that determine if the control (or property) is mandatory to be supported by a Camera in order to comply with the libcamera API specification. Add support for a 'required' field to the controls and properties yaml file definition and control generation scripts. Also plumb support for the flag in the control serializer component to allow pass the information across IPC borders. Signed-off-by: Jacopo Mondi --- include/libcamera/controls.h | 10 ++++++---- include/libcamera/ipa/ipa_controls.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index cf942055..01821191 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -213,14 +213,15 @@ private: class ControlId { public: - ControlId(unsigned int id, const std::string &name, ControlType type) - : id_(id), name_(name), type_(type) + ControlId(unsigned int id, const std::string &name, ControlType type, bool required) + : id_(id), name_(name), type_(type), required_(required) { } unsigned int id() const { return id_; } const std::string &name() const { return name_; } ControlType type() const { return type_; } + bool required() const { return required_; } private: LIBCAMERA_DISABLE_COPY_AND_MOVE(ControlId) @@ -228,6 +229,7 @@ private: unsigned int id_; std::string name_; ControlType type_; + bool required_; }; static inline bool operator==(unsigned int lhs, const ControlId &rhs) @@ -256,8 +258,8 @@ class Control : public ControlId public: using type = T; - Control(unsigned int id, const char *name) - : ControlId(id, name, details::control_type>::value) + Control(unsigned int id, const char *name, bool required) + : ControlId(id, name, details::control_type>::value, required) { } diff --git a/include/libcamera/ipa/ipa_controls.h b/include/libcamera/ipa/ipa_controls.h index e5da1946..5268b0a8 100644 --- a/include/libcamera/ipa/ipa_controls.h +++ b/include/libcamera/ipa/ipa_controls.h @@ -46,7 +46,8 @@ struct ipa_control_info_entry { uint32_t id; uint32_t type; uint32_t offset; - uint32_t padding[1]; + uint8_t required; + uint8_t padding[3]; }; #ifdef __cplusplus -- cgit v1.2.1