[{"id":37261,"web_url":"https://patchwork.libcamera.org/comment/37261/","msgid":"<85bjk648mc.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-12-10T16:14:19","subject":"Re: [PATCH v7 17/26] 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\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\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> +\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);","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 3A251C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 16:14:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 813AA6149F;\n\tWed, 10 Dec 2025 17:14:25 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4FC3A61480\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 17:14:24 +0100 (CET)","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-65-BU6E_nvzPeqb17CRoXtQtA-1; Wed, 10 Dec 2025 11:14:21 -0500","by mail-wm1-f72.google.com with SMTP id\n\t5b1f17b1804b1-477563a0c75so38130705e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 08:14:21 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb ([213.175.37.14])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47a882f8066sm208955e9.2.2025.12.10.08.14.19\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Dec 2025 08:14:19 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"N4mrI+8Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1765383263;\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=P7cfDYPgbQEL/Dg4yNUgfgeH0uptu+2He/gIxOtUhsU=;\n\tb=N4mrI+8Yj9uIgVAwPi06EwxxPOf9XhpQ45MTXWwywEJACpxLFJdr6IkCrMI/oU2a4kxZ0w\n\taaC4tLdl4y0VGk0BlPamLsk1WA8RZG/3YF6AIPmGgtDg9KrlKKD+diEeVHLFDWhAbMB0zg\n\tk0tv3zhmnhzXxJ/Fde4N30hZ+mTXc9Q=","X-MC-Unique":"BU6E_nvzPeqb17CRoXtQtA-1","X-Mimecast-MFC-AGG-ID":"BU6E_nvzPeqb17CRoXtQtA_1765383261","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765383261; x=1765988061;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=P7cfDYPgbQEL/Dg4yNUgfgeH0uptu+2He/gIxOtUhsU=;\n\tb=tEux0JXDrwgBPtEbs7deJBlMNtCofgs3DxuXoBDX7IkeNxmTxL9jc7MN+yfb+CEGRF\n\tWmLvP+ZR6TXBpsx2Ip1/3qiBSaCr7PG4xKJ4VS/I8SCCEZBYWG6x+XymqSR8nulCBQ+0\n\tGWZe4asIbwiM19B10k4XEfhm+Nx6y5w0PHmId253+3t3gOWJQGyZ/hHB73tpnah7ccbU\n\tfvD7ELmIU8FhAwYVWl7HwspqR40+DhGNIn4el+mQOR3rJxrHnO8kbLuNB9eTfO9DwhY2\n\tV86NgwBZfRNfDqK0GwlGVA2EfDESWOGR81BN6RA5G0zuxvrYVOu8qRSsLUA0kvfypswG\n\tFQQQ==","X-Gm-Message-State":"AOJu0Yxmfh5qgEhgASlRSV6ixDkqh5rm2OjI3j34dUZKgox8gbtvi5zK\n\tG6W/6ZIBcsZFp/vVndheqgPzlDoupxLHFVxKYSsSq2WeCqgXW+mO8IoxSusQcfKy7+Ul6P+AK6d\n\t2dG0ThQTOFbAhBfksvGQ9KQRV54Z2xrfbYcmLwF1M7KaXI8ra+dm/FF535y3Cbq+zF6bT8pNc66\n\tI=","X-Gm-Gg":"ASbGncuB0GJtIBP0iMxkmJx1yWP6Z1hNY9c8EZX4jG42DkEc7xQwHxEUfg+xlyQ6G6g\n\tam9tOxSiKzAXviYZwkBkPC2RV5dXMMTd8GT62za8bMURaQe89bV6GXzwKq1jiOARtPXjt0IXCF8\n\tphnIurY4TSBN83XPf1AKjNECoTO9nubog3p773vFbQLtrc2+wfuizQNHSQxZnnMX6BFS7l2uGGk\n\tkspdh4A33Sb3+Xvmh5U7VjJtp6zLBgY9M62I2bkh3D7Zuem8w3YdnoHuxdJKQGbYvf+5sgktoDj\n\touu34Pxm6QgHOouWGvP7bbGAT0fV2AWMw45nw64nAlk8Bm6llzYXgD320+zLQ0zB3q9WXo0qaUv\n\tqIbb2rzbagjQpliV2OIcFqTEwXQ==","X-Received":["by 2002:a05:600c:4e92:b0:477:9c73:268b with SMTP id\n\t5b1f17b1804b1-47a837de07dmr32302755e9.33.1765383260631; \n\tWed, 10 Dec 2025 08:14:20 -0800 (PST)","by 2002:a05:600c:4e92:b0:477:9c73:268b with SMTP id\n\t5b1f17b1804b1-47a837de07dmr32302465e9.33.1765383260224; \n\tWed, 10 Dec 2025 08:14:20 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IG2yN3MBscDOwg4udR15eqv8ZQ2bD/UPTeBOGkZbYaf5ms57MoI5e1N3GRhTEyerLNN1M+Edg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz","Subject":"Re: [PATCH v7 17/26] libcamera: software_isp: debayer_egl: Make\n\tDebayerEGL an environment option","In-Reply-To":"<20251210005354.44726-18-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 10 Dec 2025 00:53:45 +0000\")","References":"<20251210005354.44726-1-bryan.odonoghue@linaro.org>\n\t<20251210005354.44726-18-bryan.odonoghue@linaro.org>","Date":"Wed, 10 Dec 2025 17:14:19 +0100","Message-ID":"<85bjk648mc.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":"0WXj4oo-JnHU6M0sJ13vodP4BGOH4vV6kcGFh6ujUXI_1765383261","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>"}}]