From patchwork Tue Jan 20 15:30:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25893 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 21FE4BDCBF for ; Tue, 20 Jan 2026 15:31:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D4C6E61FC7; Tue, 20 Jan 2026 16:31:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QAshlnIV"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A6AEC61FBF for ; Tue, 20 Jan 2026 16:31:18 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 227212169; Tue, 20 Jan 2026 16:30:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923047; bh=cDbOWw+rhpoHqV0DVQ/wd9xIlgJXtvfMFeexp4vVYxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAshlnIVjKR+bymzeJpcJAqPSEglVWL/SPinf74erpTS99/UNxfqvojdiTviAD3Da ebbh5EvSHDYjNXfF6qTw8WZ17dJBUj4ma6W6O3rxIY7mifyOVBSOVQh8oG54FABgyu iqsP7jrO8w1oLVk9VD/33KkjE4PiED/LlsGkbZvo= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v10 3/7] ipa: rkisp1: algorithms: register noise reduction controls Date: Tue, 20 Jan 2026 10:30:53 -0500 Message-ID: <20260120153057.1703714-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-1-rui.wang@ideasonboard.com> 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" Register NoiseReductionMode controls based on the tuning data and default to the active DPF mode. Remove the static NoiseReductionMode entry from the IPA control map now that DPF owns its registration. Signed-off-by: Rui Wang --- src/ipa/rkisp1/algorithms/dpf.cpp | 21 +++++++++++++++++++++ src/ipa/rkisp1/algorithms/dpf.h | 1 + src/ipa/rkisp1/rkisp1.cpp | 1 - 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 659a1a82..21ce8ace 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -77,6 +77,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context, if (ret) return ret; + /* Register available controls. */ + registerControls(context); + return 0; } @@ -136,6 +139,24 @@ int Dpf::parseConfig(const YamlObject &tuningData) return 0; } +void Dpf::registerControls(IPAContext &context) +{ + /* + * Populate the control map with the available noise reduction modes. + * This allows applications to query and select from the modes defined + * in the tuning data. + */ + std::vector modes{ controls::draft::NoiseReductionModeOff }; + for (const auto &mode : noiseReductionModes_) { + modes.emplace_back(mode.modeValue); + } + /* + * Set the default mode to the active mode. + */ + context.ctrlMap[&controls::draft::NoiseReductionMode] = + ControlInfo(modes, activeMode_->modeValue); +} + int Dpf::parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config, rkisp1_cif_isp_dpf_strength_config &strengthConfig) diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 11fc88e4..43effcbe 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -37,6 +37,7 @@ private: }; int parseConfig(const YamlObject &tuningData); + void registerControls(IPAContext &context); int parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config, rkisp1_cif_isp_dpf_strength_config &strengthConfig); diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index fbcc3910..402ed62c 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -120,7 +120,6 @@ const IPAHwSettings ipaHwSettingsV12{ /* List of controls handled by the RkISP1 IPA */ const ControlInfoMap::Map rkisp1Controls{ { &controls::DebugMetadataEnable, ControlInfo(false, true, false) }, - { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, }; } /* namespace */