From patchwork Sun Feb 1 19:16:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26066 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 F3628C328F for ; Sun, 1 Feb 2026 19:16:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C2BB61FF1; Sun, 1 Feb 2026 20:16:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZviGWE2X"; 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 EE9C561FCC for ; Sun, 1 Feb 2026 20:16:25 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F6744E1; Sun, 1 Feb 2026 20:15:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973346; bh=u65hDl8yP+/MlVqK9viTix+Kmr4Nb8Bt1oS7/K+yeRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZviGWE2XM1/0LzpYpRsshLDVb7p0foXfr16UR81ISM3GHZNOigxjT38+TKr7lk3Dm 2CVcTD1zRbY3ZfiqJkmM0u28N6uqXNW8M9HZZLjtQ9hynxABal5GoS55EH5j2HnoOa QrHEyCdkdd0bjoiUYLfJbxXTu9IPpyJTB1sxqY/A= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Isaac Scott Subject: [PATCH v12 3/7] ipa: rkisp1: algorithms: register noise reduction controls Date: Sun, 1 Feb 2026 14:16:03 -0500 Message-ID: <20260201191607.2740223-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-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 Reviewed-by: Isaac Scott --- changelog : --No change since v10 changelog since v11: - Simple Debug log --- 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 9d7fcc1c..303d5cab 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -52,6 +52,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context, if (ret) return ret; + /* Register available controls. */ + registerControls(context); + return 0; } @@ -117,6 +120,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{}; + 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 */