From patchwork Sun Feb 8 17:44:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26104 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 734A0BD78E for ; Sun, 8 Feb 2026 17:45:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B03A66209D; Sun, 8 Feb 2026 18:45:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rZVKJSyh"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6984D61FC6 for ; Sun, 8 Feb 2026 18:45:43 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 94B3516AE; Sun, 8 Feb 2026 18:44:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1770572698; bh=Tn4eHwTeLZtRNw3dLTBBXMQ5eWqhoyRAk65CZtNdcoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rZVKJSyhDRWCjkTu0zxWXYnUhQPte54S43SF7gRLPJau275CyhtXELOFP21GNqxLR 6TsTUWNm7Xq/DD1F2RRBdQRin64gdUG5BTNSEK9zXgGMwB72pzmTsUt32qZ56I3IuM 5qQNMYZG6tAk/HoeQwwJ/TQQsbj/WABhOwT9lrLc= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v1 1/4] libcamera: rkisp1: Define Denoise Pre-Filter (DPF) controls Date: Sun, 8 Feb 2026 12:44:47 -0500 Message-ID: <20260208174450.416314-2-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260208174450.416314-1-rui.wang@ideasonboard.com> References: <20260208174450.416314-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 vendor-specific controls for the Rockchip ISP1 Denoise Pre-Filter (DPF) algorithm. These controls allow detailed configuration of the DPF block, including: - DpfEnable: Enable/disable DPF processing. - DpfChannelStrengths: Per-channel filter strength configuration. - DpfGreenSpatialCoefficients: Spatial kernel coefficients for the Green channel. - DpfRedBlueSpatialCoefficients: Spatial kernel coefficients for Red/Blue channels. - DpfRedBlueFilterSize: Filter size selection (9x9 or 13x9). - DpfNoiseLevelLookupCoefficients: Noise Level Lookup (NLL) table coefficients. - DpfNoiseLevelLookupScaleMode: NLL scaling mode (Linear/Logarithmic). Add 'NoiseReductionModeManual' to the draft control definitions to support manual control of noise reduction parameters. The 'rkisp1' vendor controls are registered in the build system with a dedicated control ID range. Signed-off-by: Rui Wang --- include/libcamera/meson.build | 1 + src/libcamera/control_ids_draft.yaml | 4 ++ src/libcamera/control_ids_rkisp1.yaml | 93 +++++++++++++++++++++++++++ src/libcamera/control_ranges.yaml | 4 +- 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 src/libcamera/control_ids_rkisp1.yaml diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 30ea76f9..3fd7ef94 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -39,6 +39,7 @@ controls_map = { 'draft': 'control_ids_draft.yaml', 'rpi/pisp': 'control_ids_rpi.yaml', 'rpi/vc4': 'control_ids_rpi.yaml', + 'rkisp1': 'control_ids_rkisp1.yaml', }, 'properties': { diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml index 03309eea..97ccda1c 100644 --- a/src/libcamera/control_ids_draft.yaml +++ b/src/libcamera/control_ids_draft.yaml @@ -58,6 +58,10 @@ controls: value: 4 description: | Noise reduction is applied at different levels to different streams. + - name: NoiseReductionModeManual + value: 5 + description: | + Manual control all noise reduction parameters. - ColorCorrectionAberrationMode: type: int32_t diff --git a/src/libcamera/control_ids_rkisp1.yaml b/src/libcamera/control_ids_rkisp1.yaml new file mode 100644 index 00000000..7ce9533a --- /dev/null +++ b/src/libcamera/control_ids_rkisp1.yaml @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# Copyright (C) 2026, Ideas On Board +# +# RkISP1 specific control definitions +--- +vendor: rkisp1 +controls: + - DpfEnable: + type: int32_t + direction: inout + description: | + Enable or disable the Denoise Pre-Filter (DPF) processing. + When disabled (false) the hardware DPF is forced off regardless of + denoise mode selection. When enabled (true) the algorithm may + program parameters and adapt them from manual mode overrides. + Reported in metadata as an int32_t. + enum: + - name: DpfEnableOff + value: 0 + description: The DPF is disabled. + - name: DpfEnableOn + value: 1 + description: The DPF is enabled. + + - DpfChannelStrengths: + type: int32_t + direction: inout + description: | + Sets the filter strength for Red, Green, and Blue channels respectively. + Values map to hardware strength registers (typically 0..255). + Size must be exactly 3 when set. Order: R, G, B. + size: [3] + + - DpfGreenSpatialCoefficients: + type: int32_t + direction: inout + description: | + Sets the 6 spatial kernel coefficients for the Green channel (9x9 kernel). + Order must follow the hardware expectation. + Each value corresponds to a coefficient (typically 0..16). + All 6 values are required when provided; otherwise ignored. + size: [6] + + - DpfRedBlueSpatialCoefficients: + type: int32_t + direction: inout + description: | + Sets the spatial kernel coefficients for the Red and Blue channels. + Applies to either 9x9 or 13x9 filter size. + For 9x9 mode, the 6th value is ignored by the driver if 6 are provided, + or pass 5 values if supported. + Values correspond to coefficients (typically 0..16). + size: [6] + + - DpfRedBlueFilterSize: + type: int32_t + direction: inout + description: | + Sets the filter size for the Red and Blue channels. + Values correspond to hardware filter size settings. + enum: + - name: DpfRedBlueFilterSize9x9 + value: 0 + description: 9x9 filter size. + - name: DpfRedBlueFilterSize13x9 + value: 1 + description: 13x9 filter size. + + - DpfNoiseLevelLookupCoefficients: + type: int32_t + direction: inout + description: | + Sets the 17 coefficients for the Noise Level Lookup (NLL) table. + The table defines a piecewise-linear function characterizing sensor noise. + Must supply the full set of 17 values when used. + Values correspond to coefficients (typically 1..1023). + size: [17] + + - DpfNoiseLevelLookupScaleMode: + type: int32_t + direction: inout + description: | + Sets the NLL scale mode (0=linear, 1=logarithmic). + Matches hardware RKISP1_CIF_ISP_NLL_SCALE_* constants. + enum: + - name: DpfNoiseLevelLookupScaleLinear + value: 0 + description: Linear scale. + - name: DpfNoiseLevelLookupScaleLogarithmic + value: 1 + description: Logarithmic scale. +... \ No newline at end of file diff --git a/src/libcamera/control_ranges.yaml b/src/libcamera/control_ranges.yaml index 6752eb98..4964894b 100644 --- a/src/libcamera/control_ranges.yaml +++ b/src/libcamera/control_ranges.yaml @@ -15,6 +15,8 @@ ranges: rpi: 20000 # Controls for debug metadata debug: 30000 - # Next range starts at 40000 + # Rockchip ISP1 vendor controls + rkisp1: 40000 + # Next range starts at 50000 ...