From patchwork Thu Jan 23 12:09:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22633 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 48B50C3200 for ; Thu, 23 Jan 2025 12:09:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C6596855F; Thu, 23 Jan 2025 13:09:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gSf7n2yZ"; dkim-atps=neutral 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 3ACD461878 for ; Thu, 23 Jan 2025 13:09:22 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c0a:33cd:b453:5d3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8F611465; Thu, 23 Jan 2025 13:08:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1737634098; bh=4HgAWBMYl79OOa6CYIs/yxuW6WaW3lTsDCD7FaT8P+E=; h=From:To:Cc:Subject:Date:From; b=gSf7n2yZMIa5+CnTmJoY3meVFpcB409bQPH5dBiU5ZMXbkyYYk2VSoosKRxH/nXWX Nk3n/oOdTOePijAAnAaYMC3eIZlgud2tZFWjhtnv7M4CdRDkHQcRhFGhEh3lW4qkf9 XK0WPgVAgh4J7Nm8VeOc14cZD5dsIy4erNqTlIJI= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [RFC PATCH] ipa: rkisp1: agc: Initialize enum controls with a list of values Date: Thu, 23 Jan 2025 13:09:14 +0100 Message-ID: <20250123120918.86780-1-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 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" The controls ExposureTimeMode and AnalogueGainMode are shown in camshark as normal int entries instead of enum popups. The reason is that ControlInfos for these controls are constructed using min/max instead of a list of valid ControlValues. Camshark uses the values() vector to deduce if the control is an enum or not. It might be debatable if this is the correct check, but all other ControlInfos for enum controls in libcamera are initialized using a list. Modify the construction of the ControlInfos to use the Span based constructor to fix that issue. Signed-off-by: Stefan Klug Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- src/ipa/rkisp1/algorithms/agc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 1680669c6875..e7c6de757593 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -149,13 +149,13 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData) return ret; context.ctrlMap[&controls::ExposureTimeMode] = - ControlInfo(static_cast(controls::ExposureTimeModeAuto), - static_cast(controls::ExposureTimeModeManual), - static_cast(controls::ExposureTimeModeAuto)); + ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto), + ControlValue(controls::ExposureTimeModeManual) } }, + controls::ExposureTimeModeAuto); context.ctrlMap[&controls::AnalogueGainMode] = - ControlInfo(static_cast(controls::AnalogueGainModeAuto), - static_cast(controls::AnalogueGainModeManual), - static_cast(controls::AnalogueGainModeAuto)); + ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto), + ControlValue(controls::AnalogueGainModeManual) } }, + controls::AnalogueGainModeAuto); /* \todo Move this to the Camera class */ context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true); context.ctrlMap.merge(controls());