From patchwork Wed Oct 15 01:22:46 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: 24679 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 B8DACC3337 for ; Wed, 15 Oct 2025 01:23:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 56DB260673; Wed, 15 Oct 2025 03:23:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z+bb/sCS"; dkim-atps=neutral Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EA476065F for ; Wed, 15 Oct 2025 03:23:30 +0200 (CEST) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-b4c89df6145so1000294766b.3 for ; Tue, 14 Oct 2025 18:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1760491409; x=1761096209; 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=2hWNmonLsbnIURkJ1OnH3mTtHEsLYl31d2EH9MrI6dA=; b=Z+bb/sCSIMz+ACH0RBF4Ce48FS5Lm2dLMbnIZMkRyIu79ZwJMnmy8yryD9tKH/O5Y0 edBJtM/64aIentj+enXBoAmF7Js0EpF74anGtqeEyLGugVarulIFd/g0nE6ACgWJp33/ 4DOT9imuczuLN1jcmt5lyTLl+SfjgEcOR42kMonrIwb9JAeqA1c28zm9/ZpjLjCRZ+zQ hBmBOiukWdbThlpf1Kiv2Ez2TddIEglwxkzwS3v/LqHwlWSI8JoEI670jf4JhMwModob 34iYDKxd/MUFK83f/tsxm+7ZtRhr4vThdSctiz+4xeSuQ7FY5VsMf8xOKjuvcZ/f39UB +1jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760491409; x=1761096209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2hWNmonLsbnIURkJ1OnH3mTtHEsLYl31d2EH9MrI6dA=; b=IQrMIsxkeurF7Ore1c3wsdxoAXHr+O1UOfvQuxmjqZsgZA6cG3zytYifRvFGM4TlG0 M5NosrBAoOHYZXLLfJcpnx/whcZ7ntmKUzExq1fcs/vlXWOytjdDADJ2xt66XfJSF6rk aF7kNx0H8IithH3mvC8xmd1tfg9ZRItCE1DzpaBmLMrk0QfLNTaMC6iw00g/R3wy9WeZ pySgL3SwwG5hY+JZrx3mwGhYIqF/RRdu03ErIaEDBa9Gx0QXYP67AF+N1uLYmXU+c2oM y7n2awTG89W5ZnqJ0Q+dWiqxI6Bca9ktA9qbSizf//B4tUj42dW8dvHnJU8a6iz8woUe XRHw== X-Gm-Message-State: AOJu0YzPTocrgkXOV5GxAc4IStN4k68TiVliPqTgpvg7J2FZ0iHSV6w9 jIHoCY84GqgzazPulHm46+h/GP8qjyIhFCMVSJaIvTVnjMv4m2zQmaFP9cOXyG44t2PIVLVt/Sm F0Sa8 X-Gm-Gg: ASbGnctNPimlK8kBMlvG3fbY8NOeDnWXAt/MCATv2m40b5RLxwPArTiSEUolhsAP213 RP/pTX2+pm+OeFS8JcpZO16q/2+eL1SXa+Z1HkFDC3D8HOHSEAafWGxaOWAJcfs4Ttk5JtWOIba eu9+vK+MVnL0O4Sys2mXgh7QC4tyIJCsKTvMl/1DCrGuNB6K37HhdP5w9DbdOPceunt6EepzxSo 47Yj477Iew16imiLlcof1aga8GX6vg5Fl13lpp1RQSPsSh3bWus3e9fUkxyRtHbKd3X078Y5c2c P4cyQyQjo82AYR7FAOi/nvF+MaiKqzQaR1ek/BocTmXl2EZa3qlrcCrF4PtKw4LOPlwm1r08nTb 656LPgwXc3vzS0Wm1LkVV2K5Epi7C8UklR4HG2gn1Dc7tJOid5Z4G21PzHqo/QeqfoWRUcvlEMz Y94UEmsH+FWh5uXaaGocAHbFW8YFrzjQ== X-Google-Smtp-Source: AGHT+IHM+Q4nN2PMqJLg61wbdtIRkJDVYEEsQszxnCuCtmHf0j70BnSCovsHkpblOm4AONa6TcSTkg== X-Received: by 2002:a17:907:3daa:b0:b3f:b7ca:26c5 with SMTP id a640c23a62f3a-b50acc201a5mr2942307166b.59.1760491409532; Tue, 14 Oct 2025 18:23:29 -0700 (PDT) Received: from inspiron14p-linux.nxsw.local (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b5ccd7b202dsm98348466b.82.2025.10.14.18.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 18:23:29 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org, bod.linux@nxsw.ie Subject: [PATCH v3 34/39] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Wed, 15 Oct 2025 02:22:46 +0100 Message-ID: <20251015012251.17508-35-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015012251.17508-1-bryan.odonoghue@linaro.org> References: <20251015012251.17508-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 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 1f984a52..869f7320 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 @@ -116,7 +120,20 @@ 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); +#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);