From patchwork Fri Oct 23 17:11:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10225 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 06C58BDB13 for ; Fri, 23 Oct 2020 17:11:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BBA26619A3; Fri, 23 Oct 2020 19:11:32 +0200 (CEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B57C615D4 for ; Fri, 23 Oct 2020 19:11:28 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 55F721C0004; Fri, 23 Oct 2020 17:11:27 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 19:11:10 +0200 Message-Id: <20201023171116.24899-7-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023171116.24899-1-jacopo@jmondi.org> References: <20201023171116.24899-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 06/12] ipa: raspberry: Initialize ControlInfo with values list 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Initialize the ControlInfoMap of controls supported by the Raspberry pipeline handler and IPA using the list of the enumerated values instead of specifying them manually. Reviewed-by: Naushir Patuck Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/raspberrypi.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index b23baf2f1330..1d3827404966 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -50,13 +50,13 @@ static const ControlInfoMap Controls = { { &controls::AeEnable, ControlInfo(false, true) }, { &controls::ExposureTime, ControlInfo(0, 999999) }, { &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) }, - { &controls::AeMeteringMode, ControlInfo(0, static_cast(controls::MeteringModeMax)) }, - { &controls::AeConstraintMode, ControlInfo(0, static_cast(controls::ConstraintModeMax)) }, - { &controls::AeExposureMode, ControlInfo(0, static_cast(controls::ExposureModeMax)) }, + { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues.data(), controls::AeMeteringModeValues.size()) }, + { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues.data(), controls::AeConstraintModeValues.size()) }, + { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues.data(), controls::AeExposureModeValues.size()) }, { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) }, { &controls::AwbEnable, ControlInfo(false, true) }, { &controls::ColourGains, ControlInfo(0.0f, 32.0f) }, - { &controls::AwbMode, ControlInfo(0, static_cast(controls::AwbModeMax)) }, + { &controls::AwbMode, ControlInfo(controls::AwbModeValues.data(), controls::AwbModeValues.size()) }, { &controls::Brightness, ControlInfo(-1.0f, 1.0f) }, { &controls::Contrast, ControlInfo(0.0f, 32.0f) }, { &controls::Saturation, ControlInfo(0.0f, 32.0f) },