From patchwork Wed Dec 17 10:01:29 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: 25590 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 45729C32EF for ; Wed, 17 Dec 2025 10:02:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9BB6B61F58; Wed, 17 Dec 2025 11:02:19 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DbRcZJ3v"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2138B61A4B for ; Wed, 17 Dec 2025 11:02:04 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-47774d3536dso3950785e9.0 for ; Wed, 17 Dec 2025 02:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765965723; x=1766570523; 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=qveDztGD+z1bcvRVfeWU9FTU1qkHWCGGVTIxAh2VXQw=; b=DbRcZJ3vQ+KDfW17o2Y2Jurn7GKo2iQl1vtOqNeC8SBw/5RB9+LJh+hmtpOCcXnhZI n7SzTXrhQHbOHeFIQ4M91wEAXVtnh2W+5tph/yh+MAtZaEUrRXaY1WkcjMCp79EnyRMx HAGmx/BZ8a5/aJBJ8OhbUBie1zZdYbJryzZZADzDrP2JQVaEMqrzMzdANZ2+iwppM8gM JWi0/8SHCPvu7FmWNndGhWs6XJSlghQBCfRKEJnfEFEIv/c7ChNZTICCvQTGycjX+4kz fvSqJefZa7gSW/Af7ojVtalnaBTxoY94GmXKlUNZY/4W+8+oz8ag7M3ULRrREFmE+z52 uVgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765965723; x=1766570523; 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=qveDztGD+z1bcvRVfeWU9FTU1qkHWCGGVTIxAh2VXQw=; b=q/PvIf2Km1SqLEtp+RYHRmqQq33p97F7BA08aM+w5yCJYDq1FhP8tX/8s4qPnK01SX qhm5kiHxwmJLqy1XvzoPhnd5C06bKRiCwntUXolGeswhJGyH1PdUEpnFOK0fJ5NCyJL6 hf2oWacWTCPDrS5pRWft5T1V4wjARfOrxJGETKQWnzYYXN0LPFWWzJcWfOH7FAS1Dpb7 J0Ab8RJw+vkCzPrSJIl/qhe6gK3GMY+gqaA3mlrEIE7tGCw19BEqSDUkBgmbfpdBtUqz 2M8365yVqy/I/1Aq/rP18FoyujTITFczKodOvIGWxLVRPCPIIwU42wjgL51Y4LMBE77t DGYw== X-Gm-Message-State: AOJu0Yz8XdRyapu2t4/fOY2EsmSRndpzWCs3tniXxiG6dqjbX5YW38q8 UYewGkK2aGQ66mUxE2MeQqIx6ajx/5WTU5R5JiPD1cCMpLzzyNrbaVYxsUDtv7lTnAlFz4UG0h1 eq2GK X-Gm-Gg: AY/fxX5y/9XoIuP0lpFPmZV+FwtxtLvo7oPwUSuuFrE4GytPRPATFI72RlkY8vtSxpB QOYzvtLnpsPA89bmiw4BNx5xFZEw/zYeiw/LCMmV3tgGhd0eLyWFsx5S+v5bFwORVLWCs2UVn9X XXrvcNvjywzkOE7VTksWhfxmALmFBU9z1f9VlI5cwrf8YcFZMMSE2yD5bqUdhRDSnx0kd+689fZ NtZKJTdlFFTLKbE08GNEwxI/rbvEqo5hvZXDLAh7w9ISBkNICncJoNt/Huw5z0i/R95z9QwQf4h O0dtCAdhwrfU0Htg6bVOfqUQbr7lxp7i3RmVhCyt0hLSeTzt399+zBQkuDZu3+7IwylBTB/wrMy MekhAgf5x+YLxJKFqK6keESSXMekwNJ34YwrYZanCRq3q5RBcizPgmBA0UOYSqYBS3s7A9zqLWF OGCuKL/rdGgvIqLsJnB+iDgomrIwa7ZYcZyk/VJaRCqToTR3bozIovwvnlNaixcmaEdQI= X-Google-Smtp-Source: AGHT+IEUBa+i2kNjTRIKWAJTv5314mgvVfudrWtUIH+OvUhYIbJwT+NoP6DLUlLjphEXBSarAPqaKw== X-Received: by 2002:a05:600c:3ba3:b0:477:a219:cdc3 with SMTP id 5b1f17b1804b1-47a8f1c33c5mr212046055e9.12.1765965723387; Wed, 17 Dec 2025 02:02:03 -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-47bdc1583fbsm32292585e9.0.2025.12.17.02.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 02:02:02 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Milan Zamazal Subject: [PATCH v9 17/26] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Wed, 17 Dec 2025 10:01:29 +0000 Message-ID: <20251217100138.82525-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251217100138.82525-1-bryan.odonoghue@linaro.org> References: <20251217100138.82525-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 Reviewed-by: Milan Zamazal 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 b31a374d8..efe44e393 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 + std::optional softISPMode = configuration.envOption("LIBCAMERA_SOFTISP_MODE", { "software_isp", "mode" }); + + if (softISPMode && 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);