From patchwork Tue Nov 25 00:08:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25170 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 01AF2C3257 for ; Tue, 25 Nov 2025 00:09:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B653460A8B; Tue, 25 Nov 2025 01:09:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oRmjqTgL"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 489BC608CF for ; Tue, 25 Nov 2025 01:09:09 +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 735ED1785; Tue, 25 Nov 2025 01:07:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764029220; bh=UkCapkV5odQxTizNmJzAW0W4EduQbmEB8OJC9PPaCu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oRmjqTgLfHAobqYV0qdCiVGfsl6qJbda7XUXC2VV9h8hUIm1yGFTxj3IaX07Fln8q my+21rjM0irJQsu85afoR02lox0WxiYQp/sM3+nTPKO2xWTBTGvRB4l8pxceUU3uZ/ 1OZO2db2ivqner9/ZeSe7Ii95H4zCc41Fi7GCg4k= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v1 03/11] ipa: rkisp1: controls: define control block Date: Mon, 24 Nov 2025 19:08:40 -0500 Message-ID: <20251125000848.4103786-4-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" Reserve the next free vendor allocation for rkisp1 and add the dedicated control_ids_rkisp1.yaml. Hook the new YAML into the Meson build so the generated control headers expose the rkisp1 control namespace. Signed-off-by: Rui Wang --- include/libcamera/meson.build | 1 + src/libcamera/control_ids_rkisp1.yaml | 73 +++++++++++++++++++++++++++ src/libcamera/control_ranges.yaml | 4 +- 3 files changed, 77 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_rkisp1.yaml b/src/libcamera/control_ids_rkisp1.yaml new file mode 100644 index 00000000..3e008ee4 --- /dev/null +++ b/src/libcamera/control_ids_rkisp1.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# Copyright (C) 2025, Ideas On Board +# +# RkISP1 specific control definitions +--- +# Unless otherwise stated, all controls are bi-directional, i.e. they can be +# set through Request::controls() and returned out through Request::metadata(). +vendor: rkisp1 +controls: + # --- RkISP1 DPF controls --- + - DenoiseMode: + type: int32_t + direction: inout + description: | + Controls the operating mode of the rkisp1 denoise pipeline. This setting is + consumed by the DPF module and any additional denoise algorithms that honour + the common mode state exposed here. + + In Disabled mode (default) all denoise processing stages are disabled. This + bypasses noise reduction and surfaces raw sensor data. Other denoise-related + controls are ignored in this mode. + + In Auto mode each denoise algorithm selects parameters automatically from the + sensor tuning data and (if provided) the exposure index level table. Changes in + scene brightness (analogue gain / exposure index) may cause algorithms to + re-evaluate and reprogram hardware when an exposure index band boundary is + crossed. + + In Manual mode the automatically selected parameters are frozen at the moment + the mode switch occurs (a snapshot is taken). Subsequent per-frame automatic + updates are disabled until the mode is set back to Auto. While in Manual mode + the application may modify any algorithm-specific override controls (for DPF: + DpfChannelStrengths, DpfGreenSpatialCoefficients, DpfRedBlueSpatialCoefficients, + DpfRbFilterSize, DpfNoiseLevelLookupCoefficients, DpfNoiseLevelLookupScaleMode). + Individual denoise modules apply changes immediately to hardware. + + In Reduction mode the algorithms use predefined noise reduction settings based + on the active NoiseReductionMode control. This provides optimized presets for + different noise reduction levels (e.g., minimal, high-quality, fast) without + manual parameter tuning. + + Transition Rules: + * Auto -> Manual: The current effective (auto-selected) parameters + are captured as the initial manual override values. + * Manual -> Auto: All manual override state is discarded and the + algorithm immediately reverts to automatic tuning selection, + potentially reprogramming hardware that same frame. + * Auto/Manual -> Reduction: Switches to using reduction mode configs + based on the current NoiseReductionMode setting. + * Reduction -> Auto/Manual: Reverts to the specified mode, discarding + reduction-specific state. + + If the application switches to Manual but supplies no overrides, + the previously auto-derived parameters continue to be used unchanged. + enum: + - name: DenoiseModeDisabled + value: 0 + description: | + Disabled mode - DPF processing is completely disabled. + - name: DenoiseModeAuto + value: 1 + description: | + Automatic mode - algorithm selects parameters based on tuning data. + - name: DenoiseModeManual + value: 2 + description: | + Manual mode - parameters are frozen and can be overridden. + - name: DenoiseModeReduction + value: 3 + description: | + Reduction mode - uses predefined noise reduction settings from tuning data. +... diff --git a/src/libcamera/control_ranges.yaml b/src/libcamera/control_ranges.yaml index 6752eb98..fc60de80 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 + # RkISP1 vendor controls + rkisp1: 40000 + # Next range starts at 50000 ...