From patchwork Fri Dec 12 00:29: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: 25532 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 8B6B2BD1F1 for ; Fri, 12 Dec 2025 00:34:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 547A9618BF; Fri, 12 Dec 2025 01:34:20 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ujRA0ddU"; dkim-atps=neutral Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A5BC61636 for ; Fri, 12 Dec 2025 01:34:18 +0100 (CET) Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-340a5c58bf1so448198a91.2 for ; Thu, 11 Dec 2025 16:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765499657; x=1766104457; 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=ujRA0ddUeT0adfRfxY/sZN2ZFfAZY4M0ufgfA2VWfZyczhWBU3YqRTNLrYhktB0PUv CJmeWO1aHpL5L5M2Wddrog43R59B4TSVRkjMZE8jE4GY/OmpIK6riNx7nrNoNqmpQLXY Z6XnKHx9DEsBoqOxN6EtX3+a3tu6g2JdE8SAx6mQM3Rjb/fZcMIEiv2S/own2iHe/wkp acifRras90WIzOt+kfcCc1XB1swMypT7RKCdFsTheUxKEuV2TMlX3v+wSXZ/ws3zdhyI Et3+4ar2+weYHnjUhIv3NnfeMvQ+46WrNIaxB/FMWRQQyjJhYAaRwc1RSKVeGdfbG5vI GXaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765499657; x=1766104457; 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=nVijrKqCT958oS7DeqOKSEbYJO8cen+gH9lN2B7Vc/udL/sWeVmibDpK2QDY2IpGBH 0xTle0/eB7BwMYUaepPBMfqTF1ZxYXD5A3wuZCnTEVLWg9NuK3u3br/PoVXOtSBwKWIj Z+9VavPCn9RvSL/+lJCBx4OawFlxhhMD5SylRxq1Z10p1sYQscKegNJXAguFKbHds4So c87Cvbxrs1Nxg5gOBF7DVTgEn6XESRhYUDkGG4v3po+01MOdw8qjgM/rqaDbZ/v15YLY kemEJ8n2m2+f/kndBVONHDy0x9xTWiO67BHmn3sIqjKg+j8IEv6X6crg0uJjo/cqrdaZ ZEhw== X-Gm-Message-State: AOJu0YyAmBFt6wbI9a58/VsLvVecepnisBSi5XhcVte8MP471v3X7A62 sCIFSKvU3bJ+c5eyvoBKcVBUltR2mzPNB9olbOGcixunAcTxtEO0B511L1H9I0bz5IlnRemDtmi cHfdb X-Gm-Gg: AY/fxX7fBYdRvV5PrtUK6uXFkVw3/EI0MXEApAcWREG975OCAgtz3IXuQsLe9Tf+At+ Tq8N7RW/mRnPVjtatrDXokMS4dO2Jq77fqZlBZc0XrqMyETGu4MQFCyFB0snogBGtXCClgQn8wy UKVpRfpyIRjuTF7/QBHYcCvb887+qG2A4TZclf35qHdazqiEP/9miBRT0IllG6+2/PG3fmduRsr ATAKnsVr51rFKqJP+gxWNNx13yBHmVWhfA3B7ows23AYuuaL3qRXm9supdPvusocAm1p0fCnIIf Dmx4GHZ9iOhZ18eWOr273RnY5vjcMs6y+2kL54jz42nd9b0ly0vDLeLJiWkIF2lYV4Lr/tbftyb kLpY7ywjsVXSf39ADudwn/+UiJsWRXAKny7Fb6Xa37AYd1SAqlkm0M3QaP1EE6FDtLd/5S+KGqk /ID4zEoGN21b1vKdsYef1fVFi2OZL62t+nKm0fiBD4pDf2eUo08YS4IQ9DaTQ= X-Google-Smtp-Source: AGHT+IHXC9GjiM25nk9JU9k8vtsKsk2M7GHr8WRUwyeexPXBOUZkl8jUIjZ+BhCmaaJbw63hSh6knQ== X-Received: by 2002:a17:90a:d2cf:b0:349:30b4:6365 with SMTP id 98e67ed59e1d1-34abd858908mr342348a91.27.1765499656544; Thu, 11 Dec 2025 16:34:16 -0800 (PST) Received: from inspiron14p-linux (p99250-ipoefx.ipoe.ocn.ne.jp. [153.246.134.249]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c0c26eb0f6bsm3317282a12.14.2025.12.11.16.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 16:34:16 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Milan Zamazal Subject: [PATCH v8 17/26] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Fri, 12 Dec 2025 00:29:28 +0000 Message-ID: <20251212002937.3118-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251212002937.3118-1-bryan.odonoghue@linaro.org> References: <20251212002937.3118-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);