From patchwork Thu Jan 22 23:47:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25949 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 32631BDCBF for ; Thu, 22 Jan 2026 23:47:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2DD4361FDC; Fri, 23 Jan 2026 00:47:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lvcTOwtI"; 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 1606261FD6 for ; Fri, 23 Jan 2026 00:47:28 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 936A3B3; Fri, 23 Jan 2026 00:46:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125616; bh=AyW3qXFXU8qdJwKkp+o/TSyoK1oIzkLke5Uk0huDKP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lvcTOwtI848O2We9vJP/e5wei5osEEsjNZ0G47W0kp5fC+AcffjjYqYsfu8K8pe6s +nKQj8VgZBwiSZTmKze9cqVLc/KgYRes8z1yPBhNcqo8xRMI1eR4uxZoyH5w4x9aO+ AsOLGej2WeakqZDNhg3PSgS3rNUXMpco06ms0w14= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Isaac Scott Subject: [PATCH v11 3/7] ipa: rkisp1: algorithms: register noise reduction controls Date: Thu, 22 Jan 2026 18:47:05 -0500 Message-ID: <20260122234709.2061370-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 --- 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 78a79fa5..282b8672 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; } @@ -112,6 +115,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 */