[{"id":36993,"web_url":"https://patchwork.libcamera.org/comment/36993/","msgid":"<23502614-9a63-460c-b9b6-a02dbc0533da@ideasonboard.com>","date":"2025-11-21T14:03:06","subject":"Re: [PATCH v4 12/23] libcamera: software_isp: debayer_egl: Make\n\tDebayerEGL an environment option","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 11. 21. 0:33 keltezéssel, Bryan O'Donoghue írta:\n> If GPUISP support is available make it so an environment variable can\n> switch it on.\n> \n> Given we don't have full feature parity with CPUISP just yet on pixel\n> format output, we should default to CPUISP mode giving the user the option\n> to switch on GPUISP by setting LIBCAMERA_SOFTISP_MODE=gpu\n> \n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>   src/libcamera/software_isp/software_isp.cpp | 19 ++++++++++++++++++-\n>   1 file changed, 18 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index aa4a40cb6..7d21f191c 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -15,6 +15,7 @@\n> \n>   #include <libcamera/base/log.h>\n>   #include <libcamera/base/thread.h>\n> +#include <libcamera/base/utils.h>\n> \n>   #include <libcamera/controls.h>\n>   #include <libcamera/formats.h>\n> @@ -25,6 +26,9 @@\n>   #include \"libcamera/internal/software_isp/debayer_params.h\"\n> \n>   #include \"debayer_cpu.h\"\n> +#if HAVE_DEBAYER_EGL\n> +#include \"debayer_egl.h\"\n> +#endif\n> \n>   /**\n>    * \\file software_isp.cpp\n> @@ -117,7 +121,20 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n>   \t}\n>   \tstats->statsReady.connect(this, &SoftwareIsp::statsReady);\n> \n> -\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats), configuration);\n> +#if HAVE_DEBAYER_EGL\n> +\tconst char *softISPMode = utils::secure_getenv(\"LIBCAMERA_SOFTISP_MODE\");\n> +\n> +\tif (softISPMode && !strcmp(softISPMode, \"gpu\"))\n> +\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration);\n> +#endif\n> +\tif (!debayer_)\n> +\t\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats), configuration);\n\nIt's a small thing, but I feel like if `LIBCAMERA_SOFTISP_MODE=gpu` and it is not available,\nthen that should be a fatal error.\n\n\nRegards,\nBarnabás Pőcze\n\n\n> +\n> +\tif (!debayer_) {\n> +\t\tLOG(SoftwareIsp, Error) << \"Failed to create Debayer object\";\n> +\t\treturn;\n> +\t}\n> +\n>   \tdebayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady);\n>   \tdebayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady);\n> \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 0F9EDC3333\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 21 Nov 2025 14:03:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0943B60A9D;\n\tFri, 21 Nov 2025 15:03:12 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A845060805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 15:03:09 +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 A8A578E0;\n\tFri, 21 Nov 2025 15:01:03 +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=\"nxO8LSRY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763733663;\n\tbh=QJGiI+ghe+wkgqgi8IVG44ZelcvFV0Rqfhm0DzxXXTU=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=nxO8LSRYLlu+fbnK0BWlNEWdePZdWsmRBF8yqia7xDGY75oFSZw5BJLa5z6jFg0jY\n\tePoDdhsWf8Cj413G1jyhHyUjEEbOWf3ays5xP7avbZR/9pukPFEKDebiyac8HYjbCW\n\tcBeyAO93b3grCgiTVQyGzM0gwEnEyA1TXJPWqwDg=","Message-ID":"<23502614-9a63-460c-b9b6-a02dbc0533da@ideasonboard.com>","Date":"Fri, 21 Nov 2025 15:03:06 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 12/23] libcamera: software_isp: debayer_egl: Make\n\tDebayerEGL an environment option","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<G0pLbM5wsZpmczSmLYvQs7BpG4VG-L7sTCJx6dzqoOIkcpwuRF6E0iM1wj3kZTGkOfyu-EAItOdnMyUNThtrtA==@protonmail.internalid>\n\t<20251120233347.5046-13-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-13-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>"}}]