From patchwork Tue Nov 25 00:08:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25173 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 88AF9C3257 for ; Tue, 25 Nov 2025 00:09:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 413EE60AAE; Tue, 25 Nov 2025 01:09:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="NM2AyiEK"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B0E960A8B for ; Tue, 25 Nov 2025 01:09:14 +0100 (CET) Received: from rui-Precision-7560.local (unknown [IPv6:2607:fea8:935b:7220:cb34:a7b8:53d:5466]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F9041785; Tue, 25 Nov 2025 01:07:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764029225; bh=+a+kr1XhxCJeDB+hUFWNDEQC0gKZhoIYYErNDTALa5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NM2AyiEK3xJ/8M3xEL+av3qlKXxQe9853hvA3b0wK6GHjZYCuL5t558sulYB3Wnh/ D6thvnpbYvYcbXk8cjyHK9SLZL0IYCrSTjj+eCFW/LOxDziaOSfcqciS9/0sY0F/Bt QezMrZ2p1xt1zlWATZesThSKuq/yU8TpQJeaqM/8= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v1 06/11] ipa: rkisp1: algorithms: dpf: detect DPF dev overrides Date: Mon, 24 Nov 2025 19:08:43 -0500 Message-ID: <20251125000848.4103786-7-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251125000848.4103786-1-rui.wang@ideasonboard.com> References: <20251125000848.4103786-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" Introduce checkDevModeOverridesChanged() to detect when developer-mode controls have been modified. This function compares override values against the current hardware configuration for: - Spatial coefficients (green and RB) - RB filter size - NLL coefficients and scale mode Updates queueRequest() to trigger hardware updates whenever dev-mode overrides differ from active settings. This ensures spatial kernels, NLL tables, and filter size changes are applied immediately in manual mode. Signed-off-by: Rui Wang --- src/ipa/rkisp1/algorithms/dpf.cpp | 50 +++++++++++++++++++++++++++++++ src/ipa/rkisp1/algorithms/dpf.h | 1 + 2 files changed, 51 insertions(+) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 2d7d6414..0b070206 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -424,6 +424,56 @@ void Dpf::collectManualOverrides(const ControlList &controls) } } +bool Dpf::checkOverridesChanged() +{ + /* Check strength always (not dev-mode specific) */ + if (overrides_.strength) { + if (overrides_.strength->r != strengthConfig_.r || + overrides_.strength->g != strengthConfig_.g || + overrides_.strength->b != strengthConfig_.b) { + return true; + } + } + + if (!isDevMode()) + return false; + + if (overrides_.spatialGreen && + !std::equal(overrides_.spatialGreen->coeffs.begin(), overrides_.spatialGreen->coeffs.end(), + config_.g_flt.spatial_coeff)) { + return true; + } + if (overrides_.spatialRb && + !std::equal(overrides_.spatialRb->coeffs.begin(), overrides_.spatialRb->coeffs.end(), + config_.rb_flt.spatial_coeff)) { + return true; + } + if (overrides_.rbSize) { + bool currentRbSize = + (config_.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9) + ? 1 + : 0; + if (*overrides_.rbSize != currentRbSize) { + return true; + } + } + if (overrides_.nll) { + bool coeffsChanged = + !std::equal(overrides_.nll->coeffs.begin(), + overrides_.nll->coeffs.end(), + config_.nll.coeff); + bool scaleChanged = + overrides_.nll->scaleMode != + (config_.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC + ? 1 + : 0); + if (coeffsChanged || scaleChanged) { + return true; + } + } + return false; +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 4cbd7414..d6707d34 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -79,6 +79,7 @@ private: uint32_t frame) override; void loadReductionModeConfig(IPAFrameContext &frameContext); void collectManualOverrides(const ControlList &controls) override; + bool checkOverridesChanged(); bool parseConfig(const YamlObject &tuningData) override; bool parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config,