[{"id":37414,"web_url":"https://patchwork.libcamera.org/comment/37414/","msgid":"<y4rmnhwp3nveqls2hkajujbmjvfjdfvhzmmpf22hnfx3qk37nc@tg4ancqvm5yh>","date":"2025-12-16T17:03:56","subject":"Re: [PATCH v5 5/6] ipa: rkisp1: algorithms: dpf: Add detailed config\n\tlogging","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Rui\n\nOn Sun, Dec 14, 2025 at 01:16:45PM -0500, Rui Wang wrote:\n> Add logConfig() helper function to log DPF configuration\n> updates when they occur. This provides visibility into the active\n> DPF parameters including:\n>\n> - Control mode and denoise enable state\n> - Filter sizes (9x9 vs 13x9 for rb)\n> - NLL scale mode (linear vs logarithmic)\n> - Gain mode\n> - Strength values (r, g, b)\n> - Spatial filter coefficients (g and rb arrays)\n> - Noise level lookup table coefficients\n>\n> The logging is triggered in prepareEnabledMode() whenever the\n> configuration is updated, helping with debugging and tuning.\n>\n> Signed-off-by: Rui Wang <rui.wang@ideasonboard.com>\n> ---\n>\n> changelog :\n>\n> - Renamed logConfigIfChanged to logConfig and updated implementation:\n>   Moved the update check (if (update)) from inner to outer\n>\n>  src/ipa/rkisp1/algorithms/dpf.cpp | 47 +++++++++++++++++++++++++++++++\n>  src/ipa/rkisp1/algorithms/dpf.h   |  1 +\n>  2 files changed, 48 insertions(+)\n>\n> diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\n> index 4818ef28..4342e580 100644\n> --- a/src/ipa/rkisp1/algorithms/dpf.cpp\n> +++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n> @@ -271,6 +271,50 @@ bool Dpf::loadReductionConfig(int32_t mode)\n>  \treturn true;\n>  }\n>\n> +void Dpf::logConfig(const IPAFrameContext &frameContext)\n> +{\n> +\tstd::ostringstream ss;\n> +\n> +\tss << \"DPF config update: \";\n> +\tss << \" control mode=\" << kModesMap.at(runningMode_);\n> +\tss << \", denoise=\" << (frameContext.dpf.denoise ? \"enabled\" : \"disabled\");\n> +\n> +\tss << \", rb_fltsize=\"\n> +\t   << (config_.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 ? \"13x9\" : \"9x9\");\n> +\tss << \", nll_scale=\"\n> +\t   << (config_.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC ? \"log\" : \"linear\");\n> +\tss << \", gain_mode=\" << config_.gain.mode;\n> +\tss << \", strength=\" << int(strengthConfig_.r) << ',' << int(strengthConfig_.g) << ',' << int(strengthConfig_.b);\n> +\n> +\tss << \", g=[\";\n> +\tfor (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) {\n> +\t\tif (i) {\n> +\t\t\tss << ',';\n> +\t\t}\n\nno braces for single line statements, here and in all other places.\n\nDoesn't checkstyle.py complains ?\n\nWith that fixed\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> +\t\tss << int(config_.g_flt.spatial_coeff[i]);\n> +\t}\n> +\tss << \"]\";\n> +\n> +\tss << \", rb=[\";\n> +\tfor (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) {\n> +\t\tif (i) {\n> +\t\t\tss << ',';\n> +\t\t}\n> +\t\tss << int(config_.rb_flt.spatial_coeff[i]);\n> +\t}\n> +\tss << \"]\";\n> +\n> +\tss << \", nll=[\";\n> +\tfor (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i) {\n> +\t\tif (i) {\n> +\t\t\tss << ',';\n> +\t\t}\n> +\t\tss << int(config_.nll.coeff[i]);\n> +\t}\n> +\tss << \"]\";\n> +\tLOG(RkISP1Dpf, Debug) << ss.str();\n> +}\n> +\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::queueRequest\n>   */\n> @@ -379,6 +423,9 @@ void Dpf::prepareEnabledMode(IPAContext &context, [[maybe_unused]] const uint32_\n>  \tauto strengthConfig = params->block<BlockType::DpfStrength>();\n>  \tstrengthConfig.setEnabled(true);\n>  \t*strengthConfig = strengthConfig_;\n> +\n> +\tif (frameContext.dpf.update)\n> +\t\tlogConfig(frameContext);\n>  }\n>\n>  REGISTER_IPA_ALGORITHM(Dpf, \"Dpf\")\n> diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h\n> index fcf121cb..1821da39 100644\n> --- a/src/ipa/rkisp1/algorithms/dpf.h\n> +++ b/src/ipa/rkisp1/algorithms/dpf.h\n> @@ -43,6 +43,7 @@ private:\n>  \t\t\t      rkisp1_cif_isp_dpf_strength_config &strengthConfig);\n>\n>  \tbool loadReductionConfig(int32_t mode);\n> +\tvoid logConfig(const IPAFrameContext &frameContext);\n>\n>  \tvoid prepareDisabledMode(IPAContext &context, const uint32_t frame,\n>  \t\t\t\t IPAFrameContext &frameContext,\n> --\n> 2.43.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0F3DDBD7D8\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Dec 2025 17:04:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B743061A31;\n\tTue, 16 Dec 2025 18:04:00 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 555C56191D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Dec 2025 18:03:59 +0100 (CET)","from ideasonboard.com (93-46-82-201.ip106.fastwebnet.it\n\t[93.46.82.201])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E9A4594;\n\tTue, 16 Dec 2025 18:03:53 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"i5BIBd/g\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765904633;\n\tbh=6dYzM/R60ODqbRtXZAFVt32wEVd1CJO3cqyePJd7gJE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=i5BIBd/gRS9mw76aPKKTplLPgO2qcVoLlUNbdtR1G5tYkceu5dIAWP5nC3Vp8kZne\n\tqps871BmnQVM/x2bb+4L1Zb4qTWmcufp1wd/gBzBJm3fcGHzZpd8TaVZAW7wMetlNM\n\tgd6dJS/pv5itWqSTNNL+HVyfJzrw8eiHNNfA3HwQ=","Date":"Tue, 16 Dec 2025 18:03:56 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Rui Wang <rui.wang@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v5 5/6] ipa: rkisp1: algorithms: dpf: Add detailed config\n\tlogging","Message-ID":"<y4rmnhwp3nveqls2hkajujbmjvfjdfvhzmmpf22hnfx3qk37nc@tg4ancqvm5yh>","References":"<20251214181646.573675-1-rui.wang@ideasonboard.com>\n\t<20251214181646.573675-6-rui.wang@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20251214181646.573675-6-rui.wang@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37437,"web_url":"https://patchwork.libcamera.org/comment/37437/","msgid":"<176607565097.724385.6549466953327670024@rui-Precision-7560.local>","date":"2025-12-18T16:34:10","subject":"Re: [PATCH v5 5/6] ipa: rkisp1: algorithms: dpf: Add detailed config\n\tlogging","submitter":{"id":241,"url":"https://patchwork.libcamera.org/api/people/241/","name":"Rui Wang","email":"rui.wang@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2025-12-16 12:03:56)\n> Hi Rui\n> \n> On Sun, Dec 14, 2025 at 01:16:45PM -0500, Rui Wang wrote:\n> > Add logConfig() helper function to log DPF configuration\n> > updates when they occur. This provides visibility into the active\n> > DPF parameters including:\n> >\n> > - Control mode and denoise enable state\n> > - Filter sizes (9x9 vs 13x9 for rb)\n> > - NLL scale mode (linear vs logarithmic)\n> > - Gain mode\n> > - Strength values (r, g, b)\n> > - Spatial filter coefficients (g and rb arrays)\n> > - Noise level lookup table coefficients\n> >\n> > The logging is triggered in prepareEnabledMode() whenever the\n> > configuration is updated, helping with debugging and tuning.\n> >\n> > Signed-off-by: Rui Wang <rui.wang@ideasonboard.com>\n> > ---\n> >\n> > changelog :\n> >\n> > - Renamed logConfigIfChanged to logConfig and updated implementation:\n> >   Moved the update check (if (update)) from inner to outer\n> >\n> >  src/ipa/rkisp1/algorithms/dpf.cpp | 47 +++++++++++++++++++++++++++++++\n> >  src/ipa/rkisp1/algorithms/dpf.h   |  1 +\n> >  2 files changed, 48 insertions(+)\n> >\n> > diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\n> > index 4818ef28..4342e580 100644\n> > --- a/src/ipa/rkisp1/algorithms/dpf.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n> > @@ -271,6 +271,50 @@ bool Dpf::loadReductionConfig(int32_t mode)\n> >       return true;\n> >  }\n> >\n> > +void Dpf::logConfig(const IPAFrameContext &frameContext)\n> > +{\n> > +     std::ostringstream ss;\n> > +\n> > +     ss << \"DPF config update: \";\n> > +     ss << \" control mode=\" << kModesMap.at(runningMode_);\n> > +     ss << \", denoise=\" << (frameContext.dpf.denoise ? \"enabled\" : \"disabled\");\n> > +\n> > +     ss << \", rb_fltsize=\"\n> > +        << (config_.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 ? \"13x9\" : \"9x9\");\n> > +     ss << \", nll_scale=\"\n> > +        << (config_.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC ? \"log\" : \"linear\");\n> > +     ss << \", gain_mode=\" << config_.gain.mode;\n> > +     ss << \", strength=\" << int(strengthConfig_.r) << ',' << int(strengthConfig_.g) << ',' << int(strengthConfig_.b);\n> > +\n> > +     ss << \", g=[\";\n> > +     for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) {\n> > +             if (i) {\n> > +                     ss << ',';\n> > +             }\n> \n> no braces for single line statements, here and in all other places.\n> \n> Doesn't checkstyle.py complains ?\n> \nWill updated in next series.\nI run the utils/checkstyle.py when commit , it doesnot post any issue\n\n> With that fixed\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> Thanks\n>   j\n> \n> > +             ss << int(config_.g_flt.spatial_coeff[i]);\n> > +     }\n> > +     ss << \"]\";\n> > +\n> > +     ss << \", rb=[\";\n> > +     for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) {\n> > +             if (i) {\n> > +                     ss << ',';\n> > +             }\n> > +             ss << int(config_.rb_flt.spatial_coeff[i]);\n> > +     }\n> > +     ss << \"]\";\n> > +\n> > +     ss << \", nll=[\";\n> > +     for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i) {\n> > +             if (i) {\n> > +                     ss << ',';\n> > +             }\n> > +             ss << int(config_.nll.coeff[i]);\n> > +     }\n> > +     ss << \"]\";\n> > +     LOG(RkISP1Dpf, Debug) << ss.str();\n> > +}\n> > +\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::queueRequest\n> >   */\n> > @@ -379,6 +423,9 @@ void Dpf::prepareEnabledMode(IPAContext &context, [[maybe_unused]] const uint32_\n> >       auto strengthConfig = params->block<BlockType::DpfStrength>();\n> >       strengthConfig.setEnabled(true);\n> >       *strengthConfig = strengthConfig_;\n> > +\n> > +     if (frameContext.dpf.update)\n> > +             logConfig(frameContext);\n> >  }\n> >\n> >  REGISTER_IPA_ALGORITHM(Dpf, \"Dpf\")\n> > diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h\n> > index fcf121cb..1821da39 100644\n> > --- a/src/ipa/rkisp1/algorithms/dpf.h\n> > +++ b/src/ipa/rkisp1/algorithms/dpf.h\n> > @@ -43,6 +43,7 @@ private:\n> >                             rkisp1_cif_isp_dpf_strength_config &strengthConfig);\n> >\n> >       bool loadReductionConfig(int32_t mode);\n> > +     void logConfig(const IPAFrameContext &frameContext);\n> >\n> >       void prepareDisabledMode(IPAContext &context, const uint32_t frame,\n> >                                IPAFrameContext &frameContext,\n> > --\n> > 2.43.0\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DD381C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Dec 2025 16:34:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C7F061F3A;\n\tThu, 18 Dec 2025 17:34:25 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE88161A61\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Dec 2025 17:34:23 +0100 (CET)","from pyrite.rasen.tech (unknown [209.216.103.65])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 80A041189;\n\tThu, 18 Dec 2025 17:34:16 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GQjPmILR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1766075656;\n\tbh=qQiLWCBHPdbTIlgpUznSjsqYzw4Wfnh8idVOna6mLgA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=GQjPmILRPjFeK3Z5lSH8VR2jyL0+DZUOBH448d2VAz+Jjnb+XajESDfP3pYyNsYEj\n\tRRDePWjqYdo2SuOTpboylb+f3MnRzePXYvLwT1Q73soYQ0xqThagRBvgVmdYBS/zUG\n\tyohXDRWnP55LwGfsWePcu38P+CFgf7jW20FqDCCY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<y4rmnhwp3nveqls2hkajujbmjvfjdfvhzmmpf22hnfx3qk37nc@tg4ancqvm5yh>","References":"<20251214181646.573675-1-rui.wang@ideasonboard.com>\n\t<20251214181646.573675-6-rui.wang@ideasonboard.com>\n\t<y4rmnhwp3nveqls2hkajujbmjvfjdfvhzmmpf22hnfx3qk37nc@tg4ancqvm5yh>","Subject":"Re: [PATCH v5 5/6] ipa: rkisp1: algorithms: dpf: Add detailed config\n\tlogging","From":"Rui Wang <rui.wang@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Date":"Thu, 18 Dec 2025 11:34:10 -0500","Message-ID":"<176607565097.724385.6549466953327670024@rui-Precision-7560.local>","User-Agent":"alot/0.12","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]