[{"id":37432,"web_url":"https://patchwork.libcamera.org/comment/37432/","msgid":"<8bb94af0-300b-4a69-80ca-94dc0d28ce5d@ideasonboard.com>","date":"2025-12-18T09:56:18","subject":"Re: [PATCH v9 17/26] 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. 12. 17. 11:01 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> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>   src/libcamera/software_isp/software_isp.cpp | 24 ++++++++++++++++++++-\n>   1 file changed, 23 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 b31a374d8..efe44e393 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,25 @@ 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> +\tstd::optional<std::string> softISPMode = configuration.envOption(\"LIBCAMERA_SOFTISP_MODE\", { \"software_isp\", \"mode\" });\n> +\n> +\tif (softISPMode && softISPMode == \"gpu\") {\n> +\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration);\n> +\t\tif (!debayer_) {\n\nOops, I replied to the wrong email. So here it is again:\n`std::make_unique()` never returns `nullptr`, so this condition is never true.\n\n\n> +\t\t\tLOG(SoftwareIsp, Error) << \"Failed to instantiate GPUISP\";\n> +\t\t\treturn;\n> +\t\t}\n> +\t}\n> +#endif\n> +\tif (!debayer_)\n> +\t\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats), configuration);\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>","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 91448BD7D8\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Dec 2025 09:56:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5877A61AA8;\n\tThu, 18 Dec 2025 10:56:24 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AC2061A61\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Dec 2025 10:56:23 +0100 (CET)","from [192.168.33.31] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CCE28122A;\n\tThu, 18 Dec 2025 10:56:15 +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=\"en9pRQgD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1766051776;\n\tbh=E7Tvd0RPQfM97ffObBis+4THFtT91DL8plxb9CKs25o=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=en9pRQgDQhR0vPr/vKRMu40/u6IFwQ5PFTEzvltFtmZnl4THxkCUw3uxnroryBKSi\n\t/c6nK+5ylVGMANlb+EP5SFkIK9MkkNPOWPDo0ZYOGyDoXJI30dAKJ/A9qeACk1dTf6\n\tmqkMBL7OXy5tUZH0VtYbGUlQrJJYi/qAFn5FZ9xc=","Message-ID":"<8bb94af0-300b-4a69-80ca-94dc0d28ce5d@ideasonboard.com>","Date":"Thu, 18 Dec 2025 10:56:18 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v9 17/26] 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, Milan Zamazal <mzamazal@redhat.com>","References":"<20251217100138.82525-1-bryan.odonoghue@linaro.org>\n\t<20251217100138.82525-18-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":"<20251217100138.82525-18-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>"}}]