[{"id":34534,"web_url":"https://patchwork.libcamera.org/comment/34534/","msgid":"<85h60dijct.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-06-18T07:45:06","subject":"Re: [PATCH 24/35] libcamera: software_isp: debayer_egl: Make\n\tDebayerEGL an environment option","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\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 e8fa8a17..ff4471c0 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> @@ -114,7 +118,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));\n> +#if HAVE_DEBAYER_EGL\n> +\tconst char *softISPMode = utils::secure_getenv(\"LIBCAMERA_SOFTISP_MODE\");\n\nI think it should be named softIspMode.\n\nLIBCAMERA_SOFTISP_MODE should be documented in\nDocumentation/environment_variables.rst.\n\n> +\n> +\tif (softISPMode && !strcmp(softISPMode, \"gpu\"))\n> +\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats));\n> +#endif\n> +\tif (!debayer_)\n> +\t\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats));\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);","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 A3EA0BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Jun 2025 07:45:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A8F668DCC;\n\tWed, 18 Jun 2025 09:45:14 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3EAC561548\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jun 2025 09:45:13 +0200 (CEST)","from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n\t[209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-50-n99bGmXoNAChU9tA8ThfGg-1; Wed, 18 Jun 2025 03:45:10 -0400","by mail-wm1-f72.google.com with SMTP id\n\t5b1f17b1804b1-452ff9e054eso34270955e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jun 2025 00:45:10 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-3a58a03f059sm3574624f8f.44.2025.06.18.00.45.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Jun 2025 00:45:07 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"baRMYDIa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1750232711;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=Qjz4PiNI1zx8QFHCteCvlQyBPFIVhLE6hjD/WqrGMIc=;\n\tb=baRMYDIafvKbl7mwtCwgGwIBjUxU7md+Z+U3Xyk5UONdBA/scJ1MQ9TL3EKfwTtxD/fDOb\n\tSt2Fr5Ts3X4YK/Te/eH4efNZIiI//PrzWq5dwBgzRNO63XEUJd0Fc/oT90FtvH454zaunA\n\t5wu5X8RE96vnmL5yxHfRbjTsfcsPpGw=","X-MC-Unique":"n99bGmXoNAChU9tA8ThfGg-1","X-Mimecast-MFC-AGG-ID":"n99bGmXoNAChU9tA8ThfGg_1750232709","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1750232708; x=1750837508;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-g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z7WysZbKPNdjfLcQNEY0tqKUq/2X8KLjKcfk/mufW4rXvHkIE1RqTWpRNMswXQxwVA\n\t=","X-Received":["by 2002:a05:600c:35cc:b0:43c:fe90:1282 with SMTP id\n\t5b1f17b1804b1-4533ca43db6mr137232565e9.7.1750232708199; \n\tWed, 18 Jun 2025 00:45:08 -0700 (PDT)","by 2002:a05:600c:35cc:b0:43c:fe90:1282 with SMTP id\n\t5b1f17b1804b1-4533ca43db6mr137232315e9.7.1750232707657; \n\tWed, 18 Jun 2025 00:45:07 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IH7ekPK9/nvmb7f4weYlPLh5ej2e5np6Rwj1uEaP/XMk/5I695q3s9ll5Yxeb7o709o0WwXpQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 24/35] libcamera: software_isp: debayer_egl: Make\n\tDebayerEGL an environment option","In-Reply-To":"<20250611013245.133785-25-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 11 Jun 2025 02:32:34 +0100\")","References":"<20250611013245.133785-1-bryan.odonoghue@linaro.org>\n\t<20250611013245.133785-25-bryan.odonoghue@linaro.org>","Date":"Wed, 18 Jun 2025 09:45:06 +0200","Message-ID":"<85h60dijct.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"yBtTNtGEf1SZX00ORolve7GSQpLk1rqOPfl12VPbk4g_1750232709","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]