From patchwork Sat Feb 29 16:42:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2922 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A3A0862787 for ; Sat, 29 Feb 2020 17:43:23 +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 336B733E; Sat, 29 Feb 2020 17:43:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1582994603; bh=+wWhkoEz+xi/4MsIb+QgRnlaZWkFWTBMfQGULBbuYac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXUfPJs+i9xk4N2QPR+tKjPKVRhrUXAc3u9jS4K2DpxzcWhOcdak06tqe51MTBM4+ nvk65d7cObpJqC3xVbBICRgnfhqmctCFx9GN0KoMGx0VTvdm+g9wx2m7uegx1UiVc4 0xkbCo2ymVN87jSt8akNoI6HXzNlhHEdnuGEoqCc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 29 Feb 2020 18:42:27 +0200 Message-Id: <20200229164254.23604-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200229164254.23604-1-laurent.pinchart@ideasonboard.com> References: <20200229164254.23604-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/31] libcamera: ipa: Remove unused IPA control types 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:25 -0000 From: Jacopo Mondi The ipa_control_range_data structure is only used to document the IPA control serialization format, but isn't used in code at all as the ControlRange entries are directly serialized to a byte stream buffer. This applies to the ipa_control_value_data structure that is solely used by ipa_control_range_data. Expand the IPA control serialization format documentation to describe the layout of control range data in words and diagrams instead of through a C structure. Remove the unused structures as a result. Signed-off-by: Jacopo Mondi Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/ipa/ipa_controls.h | 11 ---------- src/libcamera/ipa_controls.cpp | 38 ++++++++++++++-------------------- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/include/ipa/ipa_controls.h b/include/ipa/ipa_controls.h index de3a017b0179..426d99689de2 100644 --- a/include/ipa/ipa_controls.h +++ b/include/ipa/ipa_controls.h @@ -36,17 +36,6 @@ struct ipa_control_range_entry { uint32_t padding[1]; }; -union ipa_control_value_data { - bool b; - int32_t i32; - int64_t i64; -}; - -struct ipa_control_range_data { - union ipa_control_value_data min; - union ipa_control_value_data max; -}; - #ifdef __cplusplus } #endif diff --git a/src/libcamera/ipa_controls.cpp b/src/libcamera/ipa_controls.cpp index ed12830c0d9e..6ea71bc6dc46 100644 --- a/src/libcamera/ipa_controls.cpp +++ b/src/libcamera/ipa_controls.cpp @@ -100,8 +100,22 @@ * * Entries are described by the ipa_control_range_entry structure. They contain * the numerical ID and type of the control. The control range data is stored - * in the data section as described by the ipa_control_range_data structure. - * The ipa_control_range_entry::offset field stores the offset from the + * in the data section as described by the following diagram. + * + * ~~~~ + * +-------------------------+ . + * / | ... | | entry[n].offset + * | +-------------------------+ <-----ยด + * Data | | minimum value (#n) | \ + * section | +-------------------------+ | Entry #n + * | | maximum value (#n) | / + * | +-------------------------+ + * \ | ... | + * +-------------------------+ + * ~~~~ + * + * The minimum and maximum value are stored in the platform's native data + * format. The ipa_control_range_entry::offset field stores the offset from the * beginning of the data section to the range data. * * Range data in the data section shall be stored in the same order as the @@ -164,23 +178,3 @@ * \var ipa_control_range_entry::padding * Padding bytes (shall be set to 0) */ - -/** - * \union ipa_control_value_data - * \brief Serialized control value - * \var ipa_control_value_data::b - * Value for ControlTypeBool controls - * \var ipa_control_value_data::i32 - * Value for ControlTypeInteger32 controls - * \var ipa_control_value_data::i64 - * Value for ControlTypeInteger64 controls - */ - -/** - * \struct ipa_control_range_data - * \brief Serialized control range - * \var ipa_control_range_data::min - * The control minimum value - * \var ipa_control_range_data::max - * The control maximum value - */