From patchwork Sun Jan 18 20:31:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25834 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 C2090BDCBE for ; Sun, 18 Jan 2026 20:31:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7F7C761FCF; Sun, 18 Jan 2026 21:31:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pcj0GVJF"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C64AB61FCF for ; Sun, 18 Jan 2026 21:31:44 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F6021BA; Sun, 18 Jan 2026 21:31:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768768275; bh=E2J89dM7JMJHY3CjjKwFO7Ylt2jxrL1n5jaghF1NMXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pcj0GVJF6Px12I3DhPgGy7sY3h1JkGYQYyDK4LBCO1DY4Qm27u2lE6PBUtcurEFXs uT3QdLV8ynvHwsmp3yitnppNhFWdfuIgoVzz/hzr3TMEmZebyWsdRZuuZlD9HC4pOb tMuX6uDT01XNPcl8HrFmDiWb7mCZddAPiRYmphrg= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v9 4/6] ipa: rkisp1: algorithms: dpf: Add detailed config logging Date: Sun, 18 Jan 2026 15:31:16 -0500 Message-ID: <20260118203119.1554962-5-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260118203119.1554962-1-rui.wang@ideasonboard.com> References: <20260118203119.1554962-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" Add logConfig() helper function to log DPF configuration updates when they occur. This provides visibility into the active DPF parameters including: - Control mode and denoise enable state - Filter sizes (9x9 vs 13x9 for rb) - NLL scale mode (linear vs logarithmic) - Gain mode - Strength values (r, g, b) - Spatial filter coefficients (g and rb arrays) - Noise level lookup table coefficients The logging is triggered in prepareEnabledMode() whenever the configuration is updated, helping with debugging and tuning. Signed-off-by: Rui Wang Reviewed-by: Jacopo Mondi --- changelog since v5: - remove curly bracket in single state if-else Reviewed-by tags from v5 are carried over (no function changes). changelog since v6: No change changelog since v8: - add logConfi argument : rkisp1_cif_isp_dpf_config rkisp1_cif_isp_dpf_strength_config --- src/ipa/rkisp1/algorithms/dpf.cpp | 51 +++++++++++++++++++++++++++++-- src/ipa/rkisp1/algorithms/dpf.h | 6 +++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index f300d0a5..7a162f27 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -286,6 +286,49 @@ bool Dpf::loadConfig(int32_t mode) return true; } +void Dpf::logConfig(const IPAFrameContext &frameContext, + const struct rkisp1_cif_isp_dpf_config &config, + const struct rkisp1_cif_isp_dpf_strength_config &strengthConfig) const +{ + std::ostringstream ss; + + ss << "DPF config update: "; + ss << " control mode=" << modeName(activeMode_->modeValue); + ss << ", denoise=" << (frameContext.dpf.denoise ? "enabled" : "disabled"); + + ss << ", rb_fltsize=" + << (config.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 ? "13x9" : "9x9"); + ss << ", nll_scale=" + << (config.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC ? "log" : "linear"); + ss << ", gain_mode=" << config.gain.mode; + ss << ", strength=" << int(strengthConfig.r) << ',' << int(strengthConfig.g) << ',' << int(strengthConfig.b); + + ss << ", g=["; + for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) { + if (i) + ss << ','; + ss << int(config.g_flt.spatial_coeff[i]); + } + ss << "]"; + + ss << ", rb=["; + for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) { + if (i) + ss << ','; + ss << int(config.rb_flt.spatial_coeff[i]); + } + ss << "]"; + + ss << ", nll=["; + for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i) { + if (i) + ss << ','; + ss << int(config.nll.coeff[i]); + } + ss << "]"; + LOG(RkISP1Dpf, Debug) << ss.str(); +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ @@ -343,7 +386,7 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, return; } - prepareEnabledMode(context, params); + prepareEnabledMode(context, frameContext, params); } void Dpf::prepareDisabledMode(RkISP1Params *params) @@ -354,7 +397,8 @@ void Dpf::prepareDisabledMode(RkISP1Params *params) dpfStrength.setEnabled(false); } -void Dpf::prepareEnabledMode(IPAContext &context, RkISP1Params *params) +void Dpf::prepareEnabledMode(IPAContext &context, IPAFrameContext &frameContext, + RkISP1Params *params) { if (activeMode_ == noiseReductionModes_.end()) return; @@ -390,6 +434,9 @@ void Dpf::prepareEnabledMode(IPAContext &context, RkISP1Params *params) auto strengthConfig = params->block(); strengthConfig.setEnabled(true); *strengthConfig = modeConfig.strength; + + if (frameContext.dpf.update) + logConfig(frameContext, *config, *strengthConfig); } REGISTER_IPA_ALGORITHM(Dpf, "Dpf") diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index df9d5746..dcd14dc6 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -42,9 +42,13 @@ private: rkisp1_cif_isp_dpf_strength_config &strengthConfig); bool loadConfig(int32_t mode); + void logConfig(const IPAFrameContext &frameContext, + const struct rkisp1_cif_isp_dpf_config &config, + const struct rkisp1_cif_isp_dpf_strength_config &strengthConfig) const; void prepareDisabledMode(RkISP1Params *params); - void prepareEnabledMode(IPAContext &context, RkISP1Params *params); + void prepareEnabledMode(IPAContext &context, IPAFrameContext &frameContext, + RkISP1Params *params); std::vector noiseReductionModes_; std::vector::const_iterator activeMode_;