From patchwork Thu Jan 8 16:05:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 25704 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 DADC0BE08B for ; Thu, 8 Jan 2026 16:07:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8869961FD2; Thu, 8 Jan 2026 17:07:09 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="e3fMUlEM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 365BF61FD2 for ; Thu, 8 Jan 2026 17:07:07 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:90af:8957:b721:10d4]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id B959719D0; Thu, 8 Jan 2026 17:06:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767888404; bh=l2OgRVSM0AY54TpUR6RuzVrXqx/vDN2aZdAVq0yhDzQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=e3fMUlEMCbvSYuDs4k9BPahUYKCZY9OSDjekwddZ2LpZYkwCQzFgwq3ir7bWenrPX h4hB8SZZwaNW4bbD0WPW+K1UfJLCbCnFY4NuNO0U0scTC7MUAb8usZt8XLETq/Z3DV rZ3IEjbJaQV0i77zFTNTHwCl7+SyGRMHMlbSGDX4= From: Stefan Klug Date: Thu, 08 Jan 2026 17:05:57 +0100 Subject: [PATCH v2 14/15] libcamera: control_ids: Introduce LensShadingCorrectionEnable MIME-Version: 1.0 Message-Id: <20260108-sklug-lsc-resampling-v2-dev-v2-14-e682ec4b9893@ideasonboard.com> References: <20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com> In-Reply-To: <20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Jacopo Mondi X-Mailer: b4 0.14.2 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 a control to enable and disable LSC and replace the draft android control. Having a map as in andoid doesn't give a benefit as up to today no values apart from ON/OFF were ever implemented. Signed-off-by: Jacopo Mondi Signed-off-by: Stefan Klug --- Changes in v2: - Renamed LensShadingEnable to LensShadingCorrectionEnable - Fixed android code to properly handle the boolean value - Added "only if tuned" info sentence to the control description --- src/android/camera_capabilities.cpp | 11 ++++------- src/libcamera/control_ids_core.yaml | 9 +++++++++ src/libcamera/control_ids_draft.yaml | 14 -------------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index b161bc6b3ed68b7206e524762f8a941816812e45..9948868d3bd99a9cfb59a5d48a20ccc455a94964 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1223,13 +1223,10 @@ int CameraCapabilities::initializeStaticMetadata() { std::vector data; data.reserve(2); - const auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode); - if (infoMap != controlsInfo.end()) { - for (const auto &value : infoMap->second.values()) - data.push_back(value.get()); - } else { - data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF); - } + data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF); + const auto &infoMap = controlsInfo.find(&controls::LensShadingCorrectionEnable); + if (infoMap != controlsInfo.end()) + data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON); staticMetadata_->addEntry(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, data); } diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml index 8e99bd84825f6060dbc323be3f4b0cd6283e0942..ced98e4625bfba9165be4f93d1fd2756881a2d1b 100644 --- a/src/libcamera/control_ids_core.yaml +++ b/src/libcamera/control_ids_core.yaml @@ -1356,4 +1356,13 @@ controls: Enable or disable lens dewarping. This control is only available if lens dewarp parameters are configured in the tuning file. + - LensShadingCorrectionEnable: + type: bool + direction: inout + description: | + Enable or disable the lens shading algorithm. + + This control is only available when there are valid lens shading + correction parameters available in the tuning file. + ... diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..14026de46ad6de92cfd978e5c68c9944ce9987fa 100644 --- a/src/libcamera/control_ids_draft.yaml +++ b/src/libcamera/control_ids_draft.yaml @@ -110,20 +110,6 @@ controls: row and the start of exposure of the last row. Currently identical to ANDROID_SENSOR_ROLLING_SHUTTER_SKEW - - LensShadingMapMode: - type: int32_t - direction: inout - description: | - Control to report if the lens shading map is available. Currently - identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE. - enum: - - name: LensShadingMapModeOff - value: 0 - description: No lens shading map mode is available. - - name: LensShadingMapModeOn - value: 1 - description: The lens shading map mode is available. - - PipelineDepth: type: int32_t direction: out