[{"id":36989,"web_url":"https://patchwork.libcamera.org/comment/36989/","msgid":"<2dc375dc-8c5c-4b88-84c5-799c622737bf@ideasonboard.com>","date":"2025-11-21T13:45:40","subject":"Re: [PATCH v4 20/23] ipa: simple: Add a flag to indicate\n\tgpuIspEnabled","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 11. 21. 0:33 keltezéssel, Bryan O'Donoghue írta:\n> Flag gpuIspEnabled in the simple IPA context. This flag will allow to\n> selectively avoid some calculations or to generate a default CCM.\n> \n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>   include/libcamera/ipa/soft.mojom            |  2 +-\n>   src/ipa/simple/ipa_context.h                |  1 +\n>   src/ipa/simple/soft_simple.cpp              |  7 +++++--\n>   src/libcamera/software_isp/software_isp.cpp | 13 ++++++++++---\n>   4 files changed, 17 insertions(+), 6 deletions(-)\n> \n> diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\n> index 77328c5fd..ab7eeb5d5 100644\n> --- a/include/libcamera/ipa/soft.mojom\n> +++ b/include/libcamera/ipa/soft.mojom\n> @@ -18,7 +18,7 @@ interface IPASoftInterface {\n>   \t     libcamera.SharedFD fdParams,\n>   \t     libcamera.IPACameraSensorInfo sensorInfo,\n>   \t     libcamera.ControlInfoMap sensorControls)\n> -\t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled);\n> +\t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled, bool gpuIspEnabled);\n\nI think something is not right here. Shouldn't this be a parameter? And not a return value?\nI believe this should be after `sensorControls` above.\n\n\nRegards,\nBarnabás Pőcze\n\n\n>   \tstart() => (int32 ret);\n>   \tstop();\n>   \tconfigure(IPAConfigInfo configInfo)\n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index c3081e306..ee8fb6b03 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -103,6 +103,7 @@ struct IPAContext {\n>   \tFCQueue<IPAFrameContext> frameContexts;\n>   \tControlInfoMap::Map ctrlMap;\n>   \tbool ccmEnabled = false;\n> +\tbool gpuIspEnabled = false;\n>   };\n> \n>   } /* namespace ipa::soft */\n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index b147aca2e..523ff07b3 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -56,7 +56,8 @@ public:\n>   \t\t const IPACameraSensorInfo &sensorInfo,\n>   \t\t const ControlInfoMap &sensorControls,\n>   \t\t ControlInfoMap *ipaControls,\n> -\t\t bool *ccmEnabled) override;\n> +\t\t bool *ccmEnabled,\n> +\t\t bool *gpuIspEnabled) override;\n>   \tint configure(const IPAConfigInfo &configInfo) override;\n> \n>   \tint start() override;\n> @@ -96,7 +97,8 @@ int IPASoftSimple::init(const IPASettings &settings,\n>   \t\t\tconst IPACameraSensorInfo &sensorInfo,\n>   \t\t\tconst ControlInfoMap &sensorControls,\n>   \t\t\tControlInfoMap *ipaControls,\n> -\t\t\tbool *ccmEnabled)\n> +\t\t\tbool *ccmEnabled,\n> +\t\t\tbool *gpuIspEnabled)\n>   {\n>   \tcamHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n>   \tif (!camHelper_) {\n> @@ -106,6 +108,7 @@ int IPASoftSimple::init(const IPASettings &settings,\n>   \t}\n> \n>   \tcontext_.sensorInfo = sensorInfo;\n> +\tcontext_.gpuIspEnabled = *gpuIspEnabled;\n> \n>   \t/* Load the tuning data file */\n>   \tFile file(settings.configurationFile);\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index 9944ca573..7f3f7b0bc 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -130,12 +130,18 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n>   \t\t}\n>   \t}\n> \n> +\tbool gpuIspEnabled;\n> +\n>   #if HAVE_DEBAYER_EGL\n> -\tif (!softISPMode || !strcmp(softISPMode, \"gpu\"))\n> +\tif (!softISPMode || !strcmp(softISPMode, \"gpu\")) {\n>   \t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration);\n> +\t\tgpuIspEnabled = true;\n> +\t}\n>   #endif\n> -\tif (!debayer_)\n> +\tif (!debayer_) {\n>   \t\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats), configuration);\n> +\t\tgpuIspEnabled = false;\n> +\t}\n> \n>   \tif (!debayer_) {\n>   \t\tLOG(SoftwareIsp, Error) << \"Failed to create Debayer object\";\n> @@ -173,7 +179,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n>   \t\t\t sensorInfo,\n>   \t\t\t sensor->controls(),\n>   \t\t\t ipaControls,\n> -\t\t\t &ccmEnabled_);\n> +\t\t\t &ccmEnabled_,\n> +\t\t\t &gpuIspEnabled);\n>   \tif (ret) {\n>   \t\tLOG(SoftwareIsp, Error) << \"IPA init failed\";\n>   \t\tdebayer_.reset();\n> --\n> 2.51.2\n>","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 6A0AAC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 21 Nov 2025 13:45:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 89300609D8;\n\tFri, 21 Nov 2025 14:45:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C43960805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 14:45:45 +0100 (CET)","from [192.168.33.39] (185.221.143.100.nat.pool.zt.hu\n\t[185.221.143.100])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0C14266B;\n\tFri, 21 Nov 2025 14:43:38 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"V3lnxvWx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763732619;\n\tbh=h0WdNpTkuaVT0yOWyjF3kwQSPhNYObFRQJcGg2PRcUA=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=V3lnxvWxBna0pB7AiHJjw3Js40nxCjm7bJkVFkYEVTe2opjJzbV3uQlq6uKssD0M5\n\tHzjq9zQMeHPYfsP4Bbal4Wo91V5q/09pF2V6v16Mv6WmCCKQbLHHbPuoCww++2AZkL\n\tJi7vfN9lL3CEcO2WcSZk9Vx17TVrZBPYiAXNb1wo=","Message-ID":"<2dc375dc-8c5c-4b88-84c5-799c622737bf@ideasonboard.com>","Date":"Fri, 21 Nov 2025 14:45:40 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 20/23] ipa: simple: Add a flag to indicate\n\tgpuIspEnabled","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz","References":"<20251120233347.5046-1-bryan.odonoghue@linaro.org>\n\t<bP_qTKCFga7-uSnL6XFaLRdFF0NdlC67pJUHTQ8betKp1ws8MqS4nl7LxGIQyFR0MqTkZcTApMw_pgYqNRLnMA==@protonmail.internalid>\n\t<20251120233347.5046-21-bryan.odonoghue@linaro.org>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251120233347.5046-21-bryan.odonoghue@linaro.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]