From patchwork Thu Jan 15 16:33: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: 25821 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 9DE81C3274 for ; Thu, 15 Jan 2026 16:33:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3FD8C61FCA; Thu, 15 Jan 2026 17:33:48 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Yt2aaP7w"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D571B61FC6 for ; Thu, 15 Jan 2026 17:33:46 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BBA7A2E0; Thu, 15 Jan 2026 17:33:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494799; bh=iY5ohKtTXYxPVWno5OBrQg4ADTRrn2+dmb2a8lb/EjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yt2aaP7wiWilD7oXLVCxRSTG8Ta3Th7r+xCkTsPbJMn3/cZUIO+sDhdKQ5lt0VKgF EjDEZs6Rt2f+Wrm9dHv8Z6T5SUt/eyNsWSaQhZMpRyXHAeIjAYLSXHgT6C2cB4l9xb sUU2YlNnw5ipCV840sMvc8kHhLPZrHNoHkxsZmHk= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v8 5/7] ipa: rkisp1: algorithms: dpf: Add detailed config logging Date: Thu, 15 Jan 2026 11:33:16 -0500 Message-ID: <20260115163318.1339354-6-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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 --- src/ipa/rkisp1/algorithms/dpf.cpp | 44 +++++++++++++++++++++++++++++++ src/ipa/rkisp1/algorithms/dpf.h | 1 + 2 files changed, 45 insertions(+) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index c7d7ade0..8aa1a049 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -262,6 +262,47 @@ bool Dpf::loadReductionConfig(int32_t mode) return true; } +void Dpf::logConfig(const IPAFrameContext &frameContext) +{ + std::ostringstream ss; + + ss << "DPF config update: "; + ss << " control mode=" << kModesMap.at(runningMode_); + 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 */ @@ -370,6 +411,9 @@ void Dpf::prepareEnabledMode(IPAContext &context, [[maybe_unused]] const uint32_ auto strengthConfig = params->block(); strengthConfig.setEnabled(true); *strengthConfig = strengthConfig_; + + if (frameContext.dpf.update) + logConfig(frameContext); } REGISTER_IPA_ALGORITHM(Dpf, "Dpf") diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index fcf121cb..1821da39 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -43,6 +43,7 @@ private: rkisp1_cif_isp_dpf_strength_config &strengthConfig); bool loadReductionConfig(int32_t mode); + void logConfig(const IPAFrameContext &frameContext); void prepareDisabledMode(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext,