From patchwork Tue Nov 17 08:47:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 28939 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 552EEBDE17 for ; Tue, 17 Nov 2026 08:47:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0D3D36A873; Tue, 17 Nov 2026 09:47:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eW0dmOQA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8126D6A861 for ; Tue, 17 Nov 2026 09:47:21 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:27fa:cb4b:1d83:9b64]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1C0F3FBE; Tue, 17 Nov 2026 09:44:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794905094; bh=y8CFENPBZ6RagfwPMWxTaIQRfRiWEwjXf1UZF/LFZuc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eW0dmOQAefkOmKJOCQbykAI+KorvPkNzcppOxUssL2WUeBmiwQO3SHKZNGF9/4ZwA OyTlLSKyiqWWCrYsV58yyxpoH36DoSOg5fINlq3HMhrXFTAj4Wk9ZiCN0dkXVUTG5H Wa1n2ITpLpB+ywPLly9J3jAZ+DAATljgzPz4eVaM= From: Stefan Klug Date: Tue, 17 Nov 2026 09:47:12 +0100 Subject: [PATCH 02/10] libcamera: control_ids_core: Add DigitalGainMode enum MIME-Version: 1.0 Message-Id: <20261117-sklug-digital-gain-support-v1-v1-2-f0aa342ca877@ideasonboard.com> References: <20261117-sklug-digital-gain-support-v1-v1-0-f0aa342ca877@ideasonboard.com> In-Reply-To: <20261117-sklug-digital-gain-support-v1-v1-0-f0aa342ca877@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug X-Mailer: b4 0.14.3 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" Add a DigitalGainMode enum that works the same way for digital gain as the AnalogGainMode works for analogue gain. Signed-off-by: Stefan Klug --- src/libcamera/control_ids_core.yaml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml index 6504f983faa6..394447b31d3e 100644 --- a/src/libcamera/control_ids_core.yaml +++ b/src/libcamera/control_ids_core.yaml @@ -1380,4 +1380,48 @@ controls: The nominal range is [-180, 180], where 0° leaves hues unchanged and the range wraps around continuously, with 180° == -180°. + - DigitalGainMode: + type: int32_t + direction: inout + description: | + Controls the source of the digital gain that is applied during processing. + + When set to Auto, the AEGC algorithm computes the digital gain and + configures the ISP accordingly. When set to Manual, the value + of the DigitalGain control is used. + + When transitioning from Auto to Manual mode and no DigitalGain control + is provided by the application, the last value computed by the AEGC + algorithm when the mode was Auto will be used. If the DigitalGainMode + was never set to Auto (either because the camera started in Manual mode, + or Auto is not supported by the camera), the camera should 1.0 as value. + + If Manual is supported, the DigitalGain control must + also be supported. + + \sa ExposureTimeMode + \sa AnalogueGain + enum: + - name: Auto + value: 0 + description: | + The digital gain will be calculated automatically and set by the + AEGC algorithm. + + If DigitalGain is set while this mode is active, it will be + ignored, and it will also not be retained. + + When transitioning from Manual to Auto mode, the AEGC should start + its adjustments based on the last set manual DigitalGain value. + - name: Manual + value: 1 + description: | + The digital gain will not be updated by the AEGC algorithm. + + When transitioning from Auto to Manual mode, the last computed + gain value is used until a new value is specified through the + DigitalGain control. If an DigitalGain value is specified in the + same request where the DigitalGainMode is changed from Auto to + Manual, the provided DigitalGain is applied immediately. + ...