From patchwork Thu Aug 4 14:12:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Sylvestre X-Patchwork-Id: 16969 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 305E7C3272 for ; Thu, 4 Aug 2022 14:12:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DA15963311; Thu, 4 Aug 2022 16:12:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1659622357; bh=GNwC3zjC1jCNOZKzZo0kO93iDmDcuxMvGGrXpi0gDqE=; 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=V0z3sLekBZzWfr3U3KQqvnyPPaW2wvDjfNSThJiK2QUNJsJe8RFl8XlWs01//Bv9Q IAU2atd4kFNvWrXf3RFaw4eUuX6C++2JDL66HI7Y+JCQShuG98ne8Qg9Y+XZ3Xxpd8 www4dAFrhxqDxYoyUyZjLjHSI1Uo5Uh73s11MavwIPB5RF/cXhuw1jMfuLM4I8y31c WOiu/UnEzZE4Ia8hHZdTAmhzGDVcK4kYzbCJQVPH6PkvfLzi3H7GBoM2WXzTbsMkiU I+LKTvd3q9QFKQ9fQ0mGXmwgVOe9AVRTN+2Vtc0ca75+STfClymdjWTQIQGagGBajt G0gMMU5f/10ww== Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6EF986330D for ; Thu, 4 Aug 2022 16:12:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="lYCzCnWg"; dkim-atps=neutral Received: by mail-wr1-x432.google.com with SMTP id l4so25437739wrm.13 for ; Thu, 04 Aug 2022 07:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m8Kr0OoSI6uJhezdGMoEJR2sU/9PmcsvdeHRShlwbJ0=; b=lYCzCnWgsQFbGEnpEAJR7sWEhnOl+rwwIWH1weLcHwGU6DmQNSBLLLJCqcbwlrSdAW YZx1taCxQv9j80XjAiq8f6S1tN5S2pHevPrN1rjTf5VyGh2vAS9d84EVCMG3iZACTPcS d1FHFtScotlGE6DvdBY8J2NHZ7WevpqdH9vrp8kT89DPNSVNGZnyDnmT0qGS5OSnXVMW S9Q7aYH1ZoZBoH4mEZWnzEzYh0D1mgrxSzYZJod0k1QLvfdNE5shyJPuDI5VQTpvSaUd m2ZdF4noyAFL951x2mgVuvVtLxUelJYrArWjDtxAv7t2oO33SzHpDalMYYIS7XiwGmIf emLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m8Kr0OoSI6uJhezdGMoEJR2sU/9PmcsvdeHRShlwbJ0=; b=D6bDkgtwRRqr3matyPgRXahiXFdpmhDFgo1a1q6HCBFs1QroW3bVzGKTw8zkDxuFZy iwLCpT6+pgnqvhi0si8ZMpDHPiTMI0T1dz8bggt5xhs6AW8TeySKq5t1XhvbFqZ5kVEY 3MmcpKZShhVmIOyysPvHpUMj0XkRNVnIDRJygOZETkk/0MToqeRnyeVP7tii0q0pO40d a8XafGsT5qeSjNCpb3NSRAC5YQCRnLgGYjKfbxwcB8X6gWbOdkB7663+NiyS6T2efbf+ YyG93sRqDdeFuqps8wfrliuOEajBH/rhJIW5c0uQGEzmYuGJqq+wihg6k8lVLsEJnEfK /Dzg== X-Gm-Message-State: ACgBeo3sJwH62mQJ7UyOaJMY5nWzNTBcI9P2IIhMEW3zTe3QemXAv3si 7PbuDkJbVbA+hHxLb+5TuEStq/GEsVFZ6/it X-Google-Smtp-Source: AA6agR4nFcc1M/7r3E9k/xTnXBr52WPwHMYmVRX1uQMxr/+PJoJKYOJdNNTU2yYF/56ljzO5chxMBg== X-Received: by 2002:a5d:6d8f:0:b0:21d:b7d0:a913 with SMTP id l15-20020a5d6d8f000000b0021db7d0a913mr1548327wrs.462.1659622354877; Thu, 04 Aug 2022 07:12:34 -0700 (PDT) Received: from BL087.. ([2a01:e34:eea9:e630:d073:c231:2c43:c9cf]) by smtp.gmail.com with ESMTPSA id i5-20020a05600c2d8500b003a325bd8517sm1616948wmg.5.2022.08.04.07.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:12:34 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Aug 2022 16:12:27 +0200 Message-Id: <20220804141228.417211-3-fsylvestre@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220804141228.417211-1-fsylvestre@baylibre.com> References: <20220804141228.417211-1-fsylvestre@baylibre.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] 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: Florian Sylvestre via libcamera-devel From: Florian Sylvestre Reply-To: Florian Sylvestre Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- src/ipa/rkisp1/algorithms/lsc.cpp | 10 ++++++++++ src/ipa/rkisp1/algorithms/lsc.h | 1 + src/ipa/rkisp1/ipa_context.cpp | 9 +++++++++ src/ipa/rkisp1/ipa_context.h | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index 05c8c0da..da287ac7 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 fdb2ec1d..f68602c0 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 d833b8c7..c90bf992 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -92,6 +92,15 @@ namespace libcamera::ipa::rkisp1 { * \brief Indicates if AWB is enabled */ +/** + * \var IPASessionConfiguration::lsc + * \brief Lens Shading Correction configuration of the IPA + * + * \var IPASessionConfiguration::lsc.enabled + * \brief Indicates if LSC 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 7f7b3e4d..0cd6aadb 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;