From patchwork Wed Jun 11 01:32:34 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: 23530 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 29B55C332F for ; Wed, 11 Jun 2025 01:34:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C976868DED; Wed, 11 Jun 2025 03:34:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="lLudW9Dz"; dkim-atps=neutral Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0AE6F68DE6 for ; Wed, 11 Jun 2025 03:34:08 +0200 (CEST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a54690d369so2526618f8f.3 for ; Tue, 10 Jun 2025 18:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749605647; x=1750210447; 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=nN7QQs29c7ZiuR6fFmq8f7fL7inu3gEud9GNwcrxGBU=; b=lLudW9DzfhvKX9v9Bqg7UJ0wg0ekrtzm25FaTy9uTaGS7cTTI9RnFcUTXzwEGgoLzH +NTGAe1vW3mRHf/ffth5Z6mKKxU/qj3OXdRBlzIs40WxATEKQHqkSUyAleOmlqJiGfGr ZChV06ljma7wDrk8IQO9F+y/VO7511Jl/aPMDCelFhzM0KNFxyL6MlLFB3fq6ZaPH5lE erRNzMau8DR3thB6xnILl9QyhSMJLB2fCfYKvf9lWk2oUPyKHQtnelp54GDtLl1pnjUD n6J4MsTRavNpvQckMo2TTZWnOZb1MYhKyyiYxGtOiZecgsw7G6fkZUP7dPmjiCxkI1IB l9Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749605647; x=1750210447; 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=nN7QQs29c7ZiuR6fFmq8f7fL7inu3gEud9GNwcrxGBU=; b=uXC5yU40SiN9EPs5onMedTrT3cVyw6W3rhtoXR3ArFH7Cew1lL+q9vuvrHN77UJVF7 eVLjgklkDgo48zENXXJN8AXNptcSkzlmzkd0GCEaIbaziFsUBI5rkFSzbN55zI1hKjGU XdiYO27ys/UaA0hH+Q0wByAfZG5XmzKGuE/PRLxqEr4KsWR8Qip6U9sMGocCRRa8xydb DDgXOUkpOtYvde5RT5+HBX0/uEUPVZ0fOBBBgl3AR6EAzp7a313SOIdG5Gohz7+cU5oj vV4m7OoCJpLPXd+HvWun87OlXQQ2bP2aum9fOWKX0A1GraGKdrevFvN9nBxm4o6rme3Z R0cA== X-Gm-Message-State: AOJu0YwT2YTQ0c3S6OWtJrNjfCusGND4Ly/+dpGrkYFj9Jc0uTCVPDZF /d7Ci2uZY2TjYYtd8VeXqAyI6Gf/YGNGV1c5LV0cBHIAjKlam9j+S20FGi8Mnz2ebtXbE4smTMj XkDPKQMI= X-Gm-Gg: ASbGnctS4sitFH27HI+f1icRg+BnjyogIhhml6ubMIfX869maGfcAKjpEdBKeXwCrZy WKruGS96YuMoZStVkdIwqt466Glx8Cnzm055I/8vK3Wumn+3imCuMCy7897rVpdBWkxxBfoQnEF nhHLEMfcqBel6oe73Tr+KM8IbrZj+7ElDWsZyolb0vzjycfaXvzzIVf0wuyNv2ulqdNVludjUo3 ZVH+AqUB0QT1qEk6yj2RfJNJdirNbrn23dd0AJk5wCco9ll64MKTuDA6M4/yOxl4wpw47l3iaf2 udYt41+M2IvqFclon4qeDvHOWyLSxfclr3J5ymxi0gdi0tzlS/0QlkhuiIj22fi6SEM22IMlzWs Wbl/Byqsx0GnlumPoJB8c4KJYyHOjkUnf8pbJngTlBykNiV2HK9eu X-Google-Smtp-Source: AGHT+IG7txomHBd4bLRRUyKtkH+QlcXafsKUElr9vUw1lgKNjvJlhLMqfOsLDPbd0zEwq5Dz5UNZnQ== X-Received: by 2002:a05:6000:144f:b0:3a5:1471:d89b with SMTP id ffacd0b85a97d-3a558a426c7mr854224f8f.53.1749605647406; Tue, 10 Jun 2025 18:34:07 -0700 (PDT) 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-4532514138asm5680625e9.3.2025.06.10.18.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jun 2025 18:34:06 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: Bryan O'Donoghue Subject: [PATCH 24/35] libcamera: software_isp: debayer_egl: Make DebayerEGL an environment option Date: Wed, 11 Jun 2025 02:32:34 +0100 Message-ID: <20250611013245.133785-25-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250611013245.133785-1-bryan.odonoghue@linaro.org> References: <20250611013245.133785-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 e8fa8a17..ff4471c0 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 @@ -114,7 +118,20 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, } stats->statsReady.connect(this, &SoftwareIsp::statsReady); - debayer_ = std::make_unique(std::move(stats)); +#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)); +#endif + if (!debayer_) + debayer_ = std::make_unique(std::move(stats)); + + if (!debayer_) { + LOG(SoftwareIsp, Error) << "Failed to create Debayer object"; + return; + } + debayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady); debayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady);