From patchwork Tue Dec 2 13:45:35 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: 25324 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 9CFC6C326B for ; Tue, 2 Dec 2025 13:46:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1FD0960F2E; Tue, 2 Dec 2025 14:46:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="a0WUG/Cg"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 312B160D1F for ; Tue, 2 Dec 2025 14:46:15 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-47798ded6fcso32431435e9.1 for ; Tue, 02 Dec 2025 05:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764683174; x=1765287974; 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=YP6iClNl5iXvt4wCmpyJtVGzkYrv7XW1L69Mp5vdnxM=; b=a0WUG/Cg+E3CXGikBSqQl6KQZDzmUYIss08AcMLEGNLKNz30KcqP15rvjAbEEuB4ta jTVpVDoJhznhjUA4TcFhoGJ2xZOCAjLDUWg0DTJYtwyglwDhXVYZDPOw4+jXmDMqhrJ6 CC5RFHTQDSoLe3LrwW9BrkJfShKQf5rVMDEuT0w4y84lC3oask4k66yn1kqThgA8U7uh OHp+C5Ds7P4X1HNdB+1+nnLb2669yONUKi1cI55YahZHdvk7N5ZAeDfpb1wO5gQLnPz5 /82fMkA48lhAeEZB/6rvVTxIz5h1sR8xJ3Kxx8hThWVwsF0lMOnMx2XbMt22o2zXOfpC QI1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764683174; x=1765287974; 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=YP6iClNl5iXvt4wCmpyJtVGzkYrv7XW1L69Mp5vdnxM=; b=EjEaR0/NVtp3huULdh9MOJPa98ZgWRyaywT1IAC2gjRVqeNPDbOB9w5bIBUYygbkOA CPBw6RxnSrA4YwiIuOzX0PbGnDh6bdtLjSYJkeMKJq7OaI+cgNBmFWCuzZ0P7T7dm2HW 8lYOsdhwYBsvLNG3aiitd4CAQw6M7TTqIX4rI5XZZ4V4OBYE/GV/Cdni795pcW/Z0oDR G8GSD9+zl/lD32mHGYpChkgapzH4r6N9ihJAK/EAnimDe8XJVhrV5ZOpT6zZvAwkWaEY 4uQxKyY4y8w0GCcG5P1kMgP6Sy4iA9xO+mZbKaEAvll84DqKTCb7R5+LGinRAZebCwXb JQCQ== X-Gm-Message-State: AOJu0YxUormCmVtcCLcllaCZZh/+bJSdegKOCBFJAHD5tn6le907pB2z lViQ820U6BEAxkawwmU1XhMIonNXfIvlA+5jMaD5g1FMKiNd2PzXbAjk55moIw9XWGVhftNd8gl /PUs7 X-Gm-Gg: ASbGncsVA5cQlHhe3pUzZIWiFC0DtNU5neNR510ITlSM4N8PGpNLcsT+RdYzMv/HazP OV7NtpV3s2lxJsy0a5SgfP3hzOrArpEF+JGQGiipqXOqKz6DPAut6KOwToDge/dxboU6VobZ5pL kn/unPpovzpFoZrWWaihEFqWYntJjRC3dV51oqnka+XmetX9N/SI5xle009zzReVisBLs97a8AU uJ7RReF6KciBBDyWy5LF18AZDFpnjTUB7yX5pKmjTC6GeeVyORcAiqgfKQADzmtXTA6LkdeqqeO PsHCwkWPV58TuC7wQJpZhQIfafoiw6MsczzO3y0i7ZbB8KlN41Aot25/Q0A3e6aroW6EY+KNUN6 t03pH/nXapm5uMVjQ9V+d0VCq9tT7cvndC2PXa8crIt93WSeSx2aoFHXNGC0nb2QQ8Qm+ZBO4TX +z16RUPcH2ssRaSwMNysbrNM6nr9OUU0uDMet0eIYj3hxqZc1g3JLzOi/ZuLgwa4X4kcDBvhyA5 vYFsQ== X-Google-Smtp-Source: AGHT+IEa/Tok+E6Hdu62wimAnqj3ly8uWAsB1pbP+d/yyqOR9kAqzRtQ7Pqga3q5vQb8iJwKihp30Q== X-Received: by 2002:a05:600c:310f:b0:475:de14:db1e with SMTP id 5b1f17b1804b1-477c1125568mr465508925e9.24.1764683174390; Tue, 02 Dec 2025 05:46:14 -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-47926f0ec69sm19383375e9.1.2025.12.02.05.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:46:13 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v6 15/24] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Tue, 2 Dec 2025 13:45:35 +0000 Message-ID: <20251202134544.662446-16-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202134544.662446-1-bryan.odonoghue@linaro.org> References: <20251202134544.662446-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 638d9a6e6..125a5dd81 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);