From patchwork Sat Feb 29 16:42:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2939 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A7C7C6279B for ; Sat, 29 Feb 2020 17:43:29 +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 3DC13A28 for ; Sat, 29 Feb 2020 17:43:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1582994609; bh=L0RUa2Fo8cBkPo9NUVkJbcQriLqiHOtWv0uA+4JKRFs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=D08DItmlSvBhDkW0bEfJ2gqfuGRAlmwnc7uG0uhtFpEe1faHpYONl2K9Wv+0tAD9p mR3DJKUZFwTGSkLhqSNEOGUQugtpAzs/bkn9Jc7DiOSkMVkwcV96col//JtyQWjrVD L8J5+2WmVxOqsl1ZiUMCFihwCJ6EPLGx1MCLHbW4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 29 Feb 2020 18:42:44 +0200 Message-Id: <20200229164254.23604-22-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 21/31] libcamera: ipa: Support array controls in ipa_control_value_entry 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:35 -0000 Report in a new field of the ipa_control_value_entry structure if the value contains an array. Reorganize the other fields of the structure to avoid increasing its size. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/ipa/ipa_controls.h | 6 ++++-- src/libcamera/ipa_controls.cpp | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/ipa/ipa_controls.h b/include/ipa/ipa_controls.h index 6371e34575f2..37f97d6ad2a4 100644 --- a/include/ipa/ipa_controls.h +++ b/include/ipa/ipa_controls.h @@ -26,9 +26,11 @@ struct ipa_controls_header { struct ipa_control_value_entry { uint32_t id; - uint32_t type; - uint32_t count; + uint8_t type; + uint8_t is_array; + uint16_t count; uint32_t offset; + uint32_t padding[1]; }; struct ipa_control_range_entry { diff --git a/src/libcamera/ipa_controls.cpp b/src/libcamera/ipa_controls.cpp index 25f38bab3dd9..cfb5c59dd028 100644 --- a/src/libcamera/ipa_controls.cpp +++ b/src/libcamera/ipa_controls.cpp @@ -163,11 +163,15 @@ static_assert(sizeof(ipa_controls_header) == 32, * The numerical ID of the control * \var ipa_control_value_entry::type * The type of the control (defined by enum ControlType) + * \var ipa_control_value_entry::is_array + * True if the control value stores an array, false otherwise * \var ipa_control_value_entry::count * The number of control array entries for array controls (1 otherwise) * \var ipa_control_value_entry::offset * The offset in bytes from the beginning of the data section to the control * value data (shall be a multiple of 8 bytes). + * \var ipa_control_value_entry::padding + * Padding bytes (shall be set to 0) */ static_assert(sizeof(ipa_control_value_entry) == 16,