From patchwork Thu Nov 27 02:37:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 25250 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A22AFC32DE for ; Thu, 27 Nov 2025 02:38:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B63E60B0F; Thu, 27 Nov 2025 03:38:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="VUy9+i1+"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E4B560AB8 for ; Thu, 27 Nov 2025 03:38:13 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4775ae77516so3297035e9.1 for ; Wed, 26 Nov 2025 18:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764211093; x=1764815893; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+2GcZ5YL21UUK5YHwLU7zkEQf8v6DCPa5f56k85rtTM=; b=VUy9+i1+QwVOT5Fy/vLoNtEK/VcOElbPhb98lp+i12v8E8SkY+z2NVvnvpchn+VIrG HcaAxjJ/LOvFMfam+YApFAAWFL+YmgBbzZfJurMgBDkwXP53xODyvunGcQiPs8O8oO3l oJ4qFVhrcOGGch/t0Js09lyuhwikvnk9RQzwansS29EIfF6GwRf/HoL7aCFRcaylFDrs uI9ORvnR8rEswlBp8hAadr6EoYfDcwVNrwoVNXkZvc/tWZ9Pi8Tl/lhpFqh2czmSU4cD 33V6N84jxsSQ1hfm0yslHmJ9GoBEX/jJhrHzUm+d189y/iZqIxumiB+s9AHBxD832y/S wwzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764211093; x=1764815893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+2GcZ5YL21UUK5YHwLU7zkEQf8v6DCPa5f56k85rtTM=; b=Ch3uN67v+QoKegGSF2HC4z8UDJ37FdiEuto4FoiHBhxsmR7UmSCNvkOkpingCpyJ7w +4XgX0AXdJjNruf7jC83ta1FZPcU9PRQJa/T84+pixhBU6ieBZJnG2o8LW7KejofwAxy ln676C1ISKbSMhQYo6JzRjT+0k+jkoAgMH54qJoHAMIYSyefSHbe0ubMHZH/6690Z5U0 MeUJ6b+abF+A6G11zdBujh74sk21F3fSh4ezgVvMz+2QT89DsZZDpWqTcaMzTOj5jOKl k/f3gT7mUIpSXqbbZrOo2CKHoRH0TKgLdoAqyr7GEQAULqQtxxX1Intiu53cXFZpFQRF PTcw== X-Gm-Message-State: AOJu0YyEZcoJjqEr/1wMW+SnGdJTMfuEv/KcSvlFYOhVBrPhB+No8yUp TR/Uh0JJvd8TPCj2ceUHHD8emsaoE0jTZs/G5mNNvjSXs7Mt/yLw8BMrsOn1SdhDYfeZ8PcooXm DM8r1Nsc= X-Gm-Gg: ASbGnct9BrNgnMkLZog5Sdf+oxoyPMLudft1FmZxgjpSg/YfkyASC3f4LvHpOMSvXxJ BP7TQPQTJ1fHkdvIymgcMzlac4PZj6/bUgGIIi00LgyljLXgecQ7oEWi1iFJ6pEAA8aAvqJ6bJ9 npwpWEi6hKzmiIk2xWrneke6AWexFyN2yeSGuZ4UtgLsb7QBVUOBWWg0NAtmA14b1/76w0tHBu6 JOXXuuo7sYNzdBDLMhIRpB8PQrj/QexT3SBYt6axYPIosn4HuHDtZA9fXzuQREoP/Gc9W/uKCst AmzXAHLaM8TgnG3vXFmn5JXUoPqnMBzBUhGMKGrSPyEsX4ibLz5Un5d20/LhvAfqorCAZ/pAuBz GRemx7baTaE3wq2fif6bVi4k8la9URbVI9FUbWeuKK5c1TAvhg/+3m4dN3juiNEAvZwKmDiT27e msvijuYVDEfA9eVGuUsfdxUxxVOSah3fkFtbBRJe406BVn/R3DwTtpN0iEnBci+oVfmeg= X-Google-Smtp-Source: AGHT+IEhTfCvKyTW0GwCobwbCDuHVZ4FQjtXb5BxqV0kc/rf16ZpPOnGed4TPK058QJ9YizHiCjWqg== X-Received: by 2002:a05:600c:1f85:b0:477:7b30:a6fe with SMTP id 5b1f17b1804b1-477c1116013mr197235665e9.18.1764211092864; Wed, 26 Nov 2025 18:38:12 -0800 (PST) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4790552c3c9sm58186345e9.0.2025.11.26.18.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 18:38:12 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v5 13/24] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Thu, 27 Nov 2025 02:37:28 +0000 Message-ID: <20251127023739.179652-14-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251127023739.179652-1-bryan.odonoghue@linaro.org> References: <20251127023739.179652-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If GPUISP support is available make it so an environment variable can switch it on. Given we don't have full feature parity with CPUISP just yet on pixel format output, we should default to CPUISP mode giving the user the option to switch on GPUISP by setting LIBCAMERA_SOFTISP_MODE=gpu Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/software_isp.cpp | 24 ++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index aa4a40cb6..223c1d4be 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -25,6 +26,9 @@ #include "libcamera/internal/software_isp/debayer_params.h" #include "debayer_cpu.h" +#if HAVE_DEBAYER_EGL +#include "debayer_egl.h" +#endif /** * \file software_isp.cpp @@ -117,7 +121,25 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, } stats->statsReady.connect(this, &SoftwareIsp::statsReady); - debayer_ = std::make_unique(std::move(stats), configuration); +#if HAVE_DEBAYER_EGL + const char *softISPMode = utils::secure_getenv("LIBCAMERA_SOFTISP_MODE"); + + if (softISPMode && !strcmp(softISPMode, "gpu")) { + debayer_ = std::make_unique(std::move(stats), configuration); + if (!debayer_) { + LOG(SoftwareIsp, Error) << "Failed to instantiate GPUISP"; + return; + } + } +#endif + if (!debayer_) + debayer_ = std::make_unique(std::move(stats), configuration); + + if (!debayer_) { + LOG(SoftwareIsp, Error) << "Failed to create Debayer object"; + return; + } + debayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady); debayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady);