[{"id":24389,"web_url":"https://patchwork.libcamera.org/comment/24389/","msgid":"<Yu16CX5JwNfz5Ndq@pendragon.ideasonboard.com>","date":"2022-08-05T20:14:01","subject":"Re: [libcamera-devel] [PATCH v2 2/3] ipa: rkisp1: Add enable field\n\tfor LSC algorithm in IPA context","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Florian,\n\nThank you for the patch.\n\nOn Fri, Aug 05, 2022 at 02:40:26PM +0200, Florian Sylvestre wrote:\n> Add an enable variable in the lsc struct in IPASessionConfiguration which\n> indicates if the lsc algorithm has been configured. This will allow other\n> algorithms to retrieve this information.\n> \n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/algorithms/lsc.cpp | 10 ++++++++++\n>  src/ipa/rkisp1/algorithms/lsc.h   |  1 +\n>  src/ipa/rkisp1/ipa_context.cpp    |  8 ++++++++\n>  src/ipa/rkisp1/ipa_context.h      |  4 ++++\n>  4 files changed, 23 insertions(+)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index 05c8c0da..da287ac7 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -119,6 +119,16 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n>  \treturn 0;\n>  }\n>  \n> +/**\n> + * \\copydoc libcamera::ipa::Algorithm::configure\n> + */\n> +int LensShadingCorrection::configure(IPAContext &context,\n> +\t\t\t\t     [[maybe_unused]] const IPACameraSensorInfo &configInfo)\n> +{\n> +\tcontext.configuration.lsc.enabled = initialized_;\n> +\treturn 0;\n> +}\n> +\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\n> index fdb2ec1d..f68602c0 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.h\n> +++ b/src/ipa/rkisp1/algorithms/lsc.h\n> @@ -20,6 +20,7 @@ public:\n>  \t~LensShadingCorrection() = default;\n>  \n>  \tint init(IPAContext &context, const YamlObject &tuningData) override;\n> +\tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n>  \n>  private:\n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 23a63f8c..1338ae40 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -92,6 +92,14 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\brief Indicates if the AWB hardware is enabled to apply colour gains\n>   */\n>  \n> +/**\n> + * \\var IPASessionConfiguration::lsc\n> + * \\brief Lens Shading Correction configuration of the IPA\n> + *\n> + * \\var IPASessionConfiguration::lsc.enabled\n> + * \\brief Indicates if the LSC hardware is enabled to apply LSC algorithm\n\nFor AWB things were a bit unclear as the AWB modules handles both the\ncolour gains and the statistics calculation, and the term \"AWB enabled\"\nusually means that the colour gains are computed automatically. Here we\ncan express things in a more simple way:\n\n * \\var IPASessionConfiguration::lsc.enabled\n * \\brief Indicates if the LSC hardware is enabled\n\nI'll fix when applying.\n\n> + */\n> +\n>  /**\n>   * \\var IPASessionConfiguration::sensor\n>   * \\brief Sensor-specific configuration of the IPA\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index 7f7b3e4d..0cd6aadb 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -32,6 +32,10 @@ struct IPASessionConfiguration {\n>  \t\tbool enabled;\n>  \t} awb;\n>  \n> +\tstruct {\n> +\t\tbool enabled;\n> +\t} lsc;\n> +\n>  \tstruct {\n>  \t\tutils::Duration lineDuration;\n>  \t\tSize size;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5908DC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  5 Aug 2022 20:14:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C9C6B6332B;\n\tFri,  5 Aug 2022 22:14:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 10B25603E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  5 Aug 2022 22:14:10 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6E2E6480;\n\tFri,  5 Aug 2022 22:14:09 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659730450;\n\tbh=QAduF1j5VCqpwZFIqB4b0tZxXGaBvCuQqhMi9qbO6rQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=JIvryR4RwOVoAWqi3bHWdmmPvzSYW+ogqoVC5FzppXiC2tt0tPAtMdR7M4ZK0tMLq\n\toX/5dX4RMVOp/+F9KPGiJiGb4T/mFdODrNk471rZFEcrB2bBCEkFW/1MWu9cwSKk8g\n\tOAtS0Vu7oiD9/4NFqcza20Kj/s48ww8obnUCYT8bxaJDR2uI/serM7YSEGdCqSPAQb\n\th8xVZ/bO55fT4R0AEE563tl9VKAw9S844PJfbqqlzSfl14AaoY2fMUxUQTz9lJ1ctI\n\tZjHeBdOPIfx5UOPty5SNFwwztEER0RS01cEgclRfjcyKp4KjsZrfMlBL67YUw/wyjA\n\tL1OJi2b/Bgkgw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659730449;\n\tbh=QAduF1j5VCqpwZFIqB4b0tZxXGaBvCuQqhMi9qbO6rQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=r0h/DdGMO6Sc3J5IDOQsVFVQsoPkXSgd98yjUkmEIuNFTGlDNBYifEK5PuboZIOq2\n\tPAFFHR+HwVf0tOFCTCEU0dY10D7dYHetb+oTEiZcgXtYtzyorJCDc/FS/bRBgGOMvs\n\tIEBY409qVeNHsxHa8feKksnP9yuhoLMOQOQ9Yo84="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"r0h/DdGM\"; dkim-atps=neutral","Date":"Fri, 5 Aug 2022 23:14:01 +0300","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<Yu16CX5JwNfz5Ndq@pendragon.ideasonboard.com>","References":"<20220805124027.530212-1-fsylvestre@baylibre.com>\n\t<20220805124027.530212-3-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220805124027.530212-3-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/3] ipa: rkisp1: Add enable field\n\tfor LSC algorithm in IPA context","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]