From patchwork Wed Dec 10 00:53:45 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: 25434 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 00BF5C3257 for ; Wed, 10 Dec 2025 00:55:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B36F061424; Wed, 10 Dec 2025 01:55:00 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xSf2bPqr"; dkim-atps=neutral Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1192961424 for ; Wed, 10 Dec 2025 01:54:59 +0100 (CET) Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-ba599137cf8so136085a12.0 for ; Tue, 09 Dec 2025 16:54:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765328097; x=1765932897; 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=jTYJymtzCsAowl8rGw3I7fYJccogJGKzN/gwiM7FOBQ=; b=xSf2bPqrvTu2CEERzEwM2oyIpIoVEJDhTIwJLytvsB6CGa5tcF2gzCcE7eZfqhSIM5 oPI+rs2mRp8UkJWBZci00Dqh3UxDRzhpZ+hgHuQqf4TgExC9VP7B723+THPpBcnQZTUS KEgFnhShJVLJtIF7aBlTz8IWc9uKnTtpNjMwozTPYHIxBkX33wTG58CioJjpZ6DP5cTl s7IwPhJJMoX2DWkj+1TD9egqzqAfucKMi9sUMOXsuAObhLP2Na92/zuIEMrDt7Vo/P3E XpKtNejr/kXVr/wWjfLru5RJyNTXlYMrVemhQlc4CfKM4r3qQTZJjSgBx4W05axoM6hj f6dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765328097; x=1765932897; 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=jTYJymtzCsAowl8rGw3I7fYJccogJGKzN/gwiM7FOBQ=; b=PBsUKQ/Y9QVcDlYj0ZW/LVVjHt4lZL+40f1d9bRlgZxFDBX3dr3RbfqvE4ZlfoukMs zuXsfkYemVgJIxkoF2atHNYrS/wIG300n9fTxfL0qvebDNBJuRHCyenIEDeDfTBQ7IJI mifNrpFHqJMxNW5b2L8V6RWupzkH+FEyzeQqlytDVD9xILaBguAguLKc88yqnKWkHOKK h53VFe11a/ySWYUXAQwD6/RfPj+HPi2MQAJJggi2BxifhEKnG3tQQ3xFbCAwVWnfiCRd //P9cWwtTdF48hHTqiyp3Shnd34USxE2ZRXkxHUmpxk4fG5U8+ICrHlyzFfGMu6WFyA5 WzhA== X-Gm-Message-State: AOJu0YwdG7w7XfBpIM7puNhrEjav0PTfiEKHGt9oaN2y+i/brNG0A/9D 8TvvZ/kWnnguGRetGkVJD5O65U/VtkFm92qR3YstrBnSCWs9sO0Udeg+DRJDoQ5xYvc4bKsQm2L LB7ft X-Gm-Gg: ASbGnctt28b9jCItflNJkUK87M33B2CVlUFKu7T8aakskC96XIkWCWTaxnE19+EXbUu OKIeRjwOQXjwLTxNXTb3tF8EaSphKGRswbgDhCiWg6US3k90MhIsZqnwUuDoGQp+G8n1dCCs2pe b5y2ZG3rDpqOFlgOfuiLxz49SPv1hPAOpk/l2IqXAV4dmGrb393s8GYy9Q/PWLuTk+h4OmCPpBZ 8ZDCuI2dYr897VFQPITZfrOubOxTEYU/eFcPLNW4ed+RSOsBLi8dBQ5ZwxaHT+vuR4+k/YGpzVy IdUMq04CLWi0pJkGqt9+Vi8Gg0G/uC3p95FkYvD/bSMpu3688aEAV6IajgYHA6LSorU1trwozjZ qr4ctRYgK92HsE9oWv50rQDJ0spAN8w9OQSMhzYW21QajCrimJdVeKSn5ZXKyrV39PBieBpTBvh 2i3JTWrmqMhvm6HhGF++SfbDez+lJED3szZkfVel0bpiJIaMFTBLKW2BPpNF2T2KyM4K/ArU22r wE= X-Google-Smtp-Source: AGHT+IEU3W3HXMVS2I/E0KyX8rep6aN5YVZW/R0NdvJ974rw8rN0CrbabZYu8HYePTsaM+kM7BXlog== X-Received: by 2002:a05:6a20:e293:b0:35f:84c7:4012 with SMTP id adf61e73a8af0-366db3fdc6fmr556527637.29.1765328097408; Tue, 09 Dec 2025 16:54:57 -0800 (PST) Received: from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp. [150.147.107.6]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-bf6875cc8eesm16057762a12.16.2025.12.09.16.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 16:54:57 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v7 17/26] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Wed, 10 Dec 2025 00:53:45 +0000 Message-ID: <20251210005354.44726-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251210005354.44726-1-bryan.odonoghue@linaro.org> References: <20251210005354.44726-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 Reviewed-by: Milan Zamazal --- 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);