From patchwork Tue Aug 16 01:54:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17135 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 2D76DC3275 for ; Tue, 16 Aug 2022 01:54:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DF7FC61FD0; Tue, 16 Aug 2022 03:54:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660614882; bh=sDaSbu1INieInB7Qjnm73vNt08k2g+vxXl857Mh5A0M=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dJFpEEx5rEgJM9Q4H3IUjGZaswc4oYX7Xk/jVd8xZiWGBJKOJF4LnNQg/GuM7oLKy 2sDCfli7VwHvVlTSoLuoutBSZdRQqXSAhymhBqfsqzJ25kTOoPUNA17riSu8DyHi1X YO3qU4CoWKqmDPpZuCft8cIiZ8UFC7Itzq97McJ6xDPB8IepbpUA8iHQHvP+8aMpkv I1UKs1UkVlQ0EHOrQkzut70fA1ro2RL3LljxmzOHatDJSjDm01sfmxnFX9MQIfiBIE hIxSdqhyUPS1B3Fq/FJpwZOnQ2lYxPVObLNHxA6kaWo08Q1VpOiwIMQQOy6u5cScA9 mzeSI+Uw5fzDA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7783661FC7 for ; Tue, 16 Aug 2022 03:54:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Da9HOl7R"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 12A4D496; Tue, 16 Aug 2022 03:54:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1660614879; bh=sDaSbu1INieInB7Qjnm73vNt08k2g+vxXl857Mh5A0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Da9HOl7RgSoYsXg4Xf8p1A9I9fuurruzRtDxqaFDGW2q4V+zqgX//WNXacCz4XUrp dUrorjagz531x56A6I2jS2QAE8h0D+ZwEfaSMDBm4TaGKK9ZASer65tLxO5qVC6mfn W8T6oxJaLtCFeUBNZTBNwemhNfkr4F1N4ZJp10Dw= To: libcamera-devel@lists.libcamera.org Date: Tue, 16 Aug 2022 04:54:13 +0300 Message-Id: <20220816015414.7462-9-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220816015414.7462-1-laurent.pinchart@ideasonboard.com> References: <20220816015414.7462-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 8/9] ipa: rkisp1: Add enable field for LSC algorithm in IPA context 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Florian Sylvestre Add an enable variable in the lsc struct in IPASessionConfiguration which indicates if the lsc algorithm has been configured. This will allow other algorithms to retrieve this information. Signed-off-by: Florian Sylvestre Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- Changes since v1: - Improve documentation --- src/ipa/rkisp1/algorithms/lsc.cpp | 10 ++++++++++ src/ipa/rkisp1/algorithms/lsc.h | 1 + src/ipa/rkisp1/ipa_context.cpp | 8 ++++++++ src/ipa/rkisp1/ipa_context.h | 4 ++++ 4 files changed, 23 insertions(+) diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index 05c8c0dab5c8..da287ac7af75 100644 --- a/src/ipa/rkisp1/algorithms/lsc.cpp +++ b/src/ipa/rkisp1/algorithms/lsc.cpp @@ -119,6 +119,16 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context, return 0; } +/** + * \copydoc libcamera::ipa::Algorithm::configure + */ +int LensShadingCorrection::configure(IPAContext &context, + [[maybe_unused]] const IPACameraSensorInfo &configInfo) +{ + context.configuration.lsc.enabled = initialized_; + return 0; +} + /** * \copydoc libcamera::ipa::Algorithm::prepare */ diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h index fdb2ec1dd27d..f68602c005c4 100644 --- a/src/ipa/rkisp1/algorithms/lsc.h +++ b/src/ipa/rkisp1/algorithms/lsc.h @@ -20,6 +20,7 @@ public: ~LensShadingCorrection() = default; int init(IPAContext &context, const YamlObject &tuningData) override; + int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override; void prepare(IPAContext &context, rkisp1_params_cfg *params) override; private: diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 23a63f8c6e25..1a549c092d73 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -92,6 +92,14 @@ namespace libcamera::ipa::rkisp1 { * \brief Indicates if the AWB hardware is enabled to apply colour gains */ +/** + * \var IPASessionConfiguration::lsc + * \brief Lens Shading Correction configuration of the IPA + * + * \var IPASessionConfiguration::lsc.enabled + * \brief Indicates if the LSC hardware is enabled + */ + /** * \var IPASessionConfiguration::sensor * \brief Sensor-specific configuration of the IPA diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 7f7b3e4d88fa..0cd6aadb83ed 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -32,6 +32,10 @@ struct IPASessionConfiguration { bool enabled; } awb; + struct { + bool enabled; + } lsc; + struct { utils::Duration lineDuration; Size size;