{"id":24863,"url":"https://patchwork.libcamera.org/api/patches/24863/?format=json","web_url":"https://patchwork.libcamera.org/patch/24863/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251028170847.2673396-11-rui.wang@ideasonboard.com>","date":"2025-10-28T17:08:40","name":"[v1,11/16] ipa: rkisp1: algorithms: dpf: detect DPF dev overrides","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b9788c713f5f7cf237819652d48fc74a4fce7ff7","submitter":{"id":241,"url":"https://patchwork.libcamera.org/api/people/241/?format=json","name":"Rui Wang","email":"rui.wang@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/24863/mbox/","series":[{"id":5539,"url":"https://patchwork.libcamera.org/api/series/5539/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5539","date":"2025-10-28T17:08:30","name":"[v1,01/16] ipa: rkisp1: algorithms: add Denoise base class shell","version":1,"mbox":"https://patchwork.libcamera.org/series/5539/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/24863/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/24863/checks/","tags":{},"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 EAF44BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Oct 2025 17:09:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2560F6085B;\n\tTue, 28 Oct 2025 18:09:22 +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 A966760840\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Oct 2025 18:09:18 +0100 (CET)","from rui-Precision-7560.local (unknown [209.216.122.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B97D016A7;\n\tTue, 28 Oct 2025 18:07:29 +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=\"RxZT9WRz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761671250;\n\tbh=QPqeJ3qV3kxcVH0Yz7W/FsO3VOQKFjM7mgOFJmo0700=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=RxZT9WRznN5vs+QKLowacY6Sz4M8qrbxNjL+VgV+t8vpZT1WMsjLZh2dMcXBvp6Wt\n\tXc4tWJLG/WJPI+qFh4tFq9I2xvIULnyjCWnfPcVlJiCkde2n/5jyXfCHi+yRcLsX9v\n\tZjcN6jtQqfewy1e8PU8qCJ08YfZ5yrBgIJNebmpY=","From":"Rui Wang <rui.wang@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Rui Wang <rui.wang@ideasonboard.com>","Subject":"[PATCH v1 11/16] ipa: rkisp1: algorithms: dpf: detect DPF dev\n\toverrides","Date":"Tue, 28 Oct 2025 13:08:40 -0400","Message-ID":"<20251028170847.2673396-11-rui.wang@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20251028170847.2673396-1-rui.wang@ideasonboard.com>","References":"<20251028170847.2673396-1-rui.wang@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"Introduce checkDevModeOverridesChanged() to detect when developer-mode\ncontrols have been modified. This function compares override values against\nthe current hardware configuration for:\n- Spatial coefficients (green and RB)\n- RB filter size\n- NLL coefficients and scale mode\n\nUpdates queueRequest() to trigger hardware updates whenever dev-mode\noverrides differ from active settings. This ensures spatial kernels, NLL\ntables, and filter size changes are applied immediately in manual mode.\n\nSigned-off-by: Rui Wang <rui.wang@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/dpf.cpp | 51 +++++++++++++++++++++++++++++++\n src/ipa/rkisp1/algorithms/dpf.h   |  5 +++\n 2 files changed, 56 insertions(+)","diff":"diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\nindex 145f10b7..cefa5da5 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.cpp\n+++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n@@ -290,6 +290,54 @@ void Dpf::collectManualOverrides(const ControlList &controls)\n \t}\n }\n \n+bool Dpf::checkDevModeOverridesChanged()\n+{\n+\tif (!isDevMode())\n+\t\treturn false;\n+\n+\tbool changed = false;\n+\tif (overrides_.spatialGreen) {\n+\t\tbool coeffsChanged = false;\n+\t\tfor (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) {\n+\t\t\tif (overrides_.spatialGreen->coeffs[i] != config_.g_flt.spatial_coeff[i]) {\n+\t\t\t\tcoeffsChanged = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t\tif (coeffsChanged) {\n+\t\t\tchanged = true;\n+\t\t}\n+\t}\n+\tif (overrides_.spatialRb) {\n+\t\tbool coeffsChanged = false;\n+\t\tfor (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) {\n+\t\t\tif (overrides_.spatialRb->coeffs[i] != config_.rb_flt.spatial_coeff[i]) {\n+\t\t\t\tcoeffsChanged = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t\tif (coeffsChanged) {\n+\t\t\tchanged = true;\n+\t\t}\n+\t}\n+\tif (overrides_.rbSize && *overrides_.rbSize != (config_.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 ? 1 : 0)) {\n+\t\tchanged = true;\n+\t}\n+\tif (overrides_.nll) {\n+\t\tbool coeffsChanged = false;\n+\t\tfor (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i) {\n+\t\t\tif (overrides_.nll->coeffs[i] != config_.nll.coeff[i]) {\n+\t\t\t\tcoeffsChanged = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t\tif (coeffsChanged || overrides_.nll->scaleMode != (config_.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC ? 1 : 0)) {\n+\t\t\tchanged = true;\n+\t\t}\n+\t}\n+\treturn changed;\n+}\n+\n /**\n  * \\copydoc libcamera::ipa::Algorithm::queueRequest\n  */\n@@ -310,6 +358,9 @@ void Dpf::queueRequest(IPAContext &context,\n \t\t     overrides_.strength->b != strengthConfig_.b)) {\n \t\t\tframeContext.dpf.update = true;\n \t\t}\n+\t\tif (checkDevModeOverridesChanged()) {\n+\t\t\tframeContext.dpf.update = true;\n+\t\t}\n \t}\n }\n \ndiff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h\nindex 1a33a8c4..b971619b 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.h\n+++ b/src/ipa/rkisp1/algorithms/dpf.h\n@@ -80,8 +80,13 @@ private:\n \tbool enableDpf_ = true; /* YAML master enable */\n \n \tvoid handleEnableControl(const ControlList &controls, IPAFrameContext &frameContext, IPAContext &context) override;\n+\n \tvoid collectManualOverrides(const ControlList &controls) override;\n+\n+\tbool checkDevModeOverridesChanged();\n+\n \tbool parseConfig(const YamlObject &tuningData) override;\n+\n \tbool parseSingleConfig(const YamlObject &config,\n \t\t\t       rkisp1_cif_isp_dpf_config &cfg,\n \t\t\t       rkisp1_cif_isp_dpf_strength_config &strength);\n","prefixes":["v1","11/16"]}