From patchwork Thu Nov 20 23:33:44 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: 25144 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 68B76BD80A for ; Thu, 20 Nov 2025 23:34:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1D55360B2C; Fri, 21 Nov 2025 00:34:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hIVrk7IG"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C609160B0F for ; Fri, 21 Nov 2025 00:34:29 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-477aa218f20so9456615e9.0 for ; Thu, 20 Nov 2025 15:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763681669; x=1764286469; 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=iNwDqYtrwFynDjTjOkZDZulmG3M2dsjYpQnAK/LBTzY=; b=hIVrk7IGumWN1kaHw7Pa+N4PbPveAcnZrTxYWIpR1bUYU3mv1qwrNg2D3wr5RxzFZz kgI5FXcFGgj/l8fbNFUVV8aIB+4tHDjeGlZZkzR3G7z6N+aiPMIF8javq+VsLRD0Y6IZ tMcMm3IBwRobubHyLskDUrU3ca9lgE8TjQ5raUAa3tN2jUA58qoBUIbtfei2M7dhDOTD sebtSj8M9K072wZ3DjYwOmiFhLDrZ1z3YtcOXotSOzO00P7X9SHIvvq7dKPVWZYdLPGp xEcJHB6AQ5jGtof9fNhoOT7VqawxZngDI+U9QpO/mkBU/OHPrK5w6mGWGmI5XqjIKFL4 RGpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763681669; x=1764286469; 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=iNwDqYtrwFynDjTjOkZDZulmG3M2dsjYpQnAK/LBTzY=; b=qYFm7dq0A5viFADhqsBYk4npMivcIiIAmvLBuF6ba3f3nNq2mXFPMfJUn5/jsrSXIu nRBMs95u21/0QxYnB7cHOCyiY58FYIlN7f3sIPV8wj5QGqsVZW8Au/n+BstBdpn+4B1M Gxsz7bLauR467EPbaZ1Sottg7+JMQhNeBciZmrb+bYNv7DwwmFVYc6N0Ijwg/xqDNUTd 1z6EN3OUhe9Bsc6Fukr8U2UFw1EA9UeGXz9c3YpgsHuS4Ny6EgvLQy4cIzkrTaWTrTJ2 u4nob4HGE5oOKtXDsRRZ+P2sPwN8XeHdgtSHFwH37fCVIWiV6N1VdMLDGYbfZQcEKUNX yFAg== X-Gm-Message-State: AOJu0YxDNboiXJsCeGR31q1eQk+SQtkEqiaLzrEDL0R1msoG97rqkz6K yf4EJYJ32IAVmxGx6T+b4ukNJ4geFzq3FR/7v0Y3Nho3NY2tczsMI1CeHQduAyN5eifcfDlDyqT PUkCfVyI= X-Gm-Gg: ASbGnctfklBRcNbcqG/LlPa/eMM87ffk9TQm+BsPPJSUONcydhgQPs0rtJO3Jq5gtZm puRzAesFxlvKlvk99v2SON4bFlwBIK8M2SPro2CEFEoezcpdMIqiOjOuVMvcOLsmGEuRjyXcuEj INg96fOU/PscuOuTTprDnnXkL4lRwPpv03WgVRoeakHoWOfAr3l8LoC4usJiI90pdHOTCmczbeT TkWjVsHK0bgHdk6H9X1iyLJ0rQ/1DWGxpq33bL/FtyeSpDuzq07T83FcHCmWUS5BIFbzJSoqi+6 mfJhBcQQIU1Mq0RkgWBbo2Fd89usUbbxSiXeYY/+cJenpFvX48yEzIjQpnUvd7kjJrv/Iya7TXU moKrcQ1vghtSqinJwgI/BjitFgA8fetidPZ4cTy5tTzvphYYICMldpzEM5w7Sw500O7Wq5RQjn7 enlVHKbFQc+lk36A7GXXZUTTLSQSDpy8yIx6jZoA4Sg55PzbS1iFS5SgBVVRoGMsRtXwSP5RVAX oPBGg== X-Google-Smtp-Source: AGHT+IEr4H/IWiEHFlIVyWI5PyR0HKNEGfOBV9nuxkrror6iFpjv7btoXKRNMQHSMrg8E0icV9mvyQ== X-Received: by 2002:a05:600c:4694:b0:477:7a1a:4b81 with SMTP id 5b1f17b1804b1-477c0170599mr3060255e9.9.1763681669131; Thu, 20 Nov 2025 15:34:29 -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 ffacd0b85a97d-42cb7fa3a81sm7984139f8f.26.2025.11.20.15.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 15:34:28 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v4 20/23] ipa: simple: Add a flag to indicate gpuIspEnabled Date: Thu, 20 Nov 2025 23:33:44 +0000 Message-ID: <20251120233347.5046-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251120233347.5046-1-bryan.odonoghue@linaro.org> References: <20251120233347.5046-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" Flag gpuIspEnabled in the simple IPA context. This flag will allow to selectively avoid some calculations or to generate a default CCM. Signed-off-by: Bryan O'Donoghue --- include/libcamera/ipa/soft.mojom | 2 +- src/ipa/simple/ipa_context.h | 1 + src/ipa/simple/soft_simple.cpp | 7 +++++-- src/libcamera/software_isp/software_isp.cpp | 13 ++++++++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom index 77328c5fd..ab7eeb5d5 100644 --- a/include/libcamera/ipa/soft.mojom +++ b/include/libcamera/ipa/soft.mojom @@ -18,7 +18,7 @@ interface IPASoftInterface { libcamera.SharedFD fdParams, libcamera.IPACameraSensorInfo sensorInfo, libcamera.ControlInfoMap sensorControls) - => (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled); + => (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled, bool gpuIspEnabled); start() => (int32 ret); stop(); configure(IPAConfigInfo configInfo) diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h index c3081e306..ee8fb6b03 100644 --- a/src/ipa/simple/ipa_context.h +++ b/src/ipa/simple/ipa_context.h @@ -103,6 +103,7 @@ struct IPAContext { FCQueue frameContexts; ControlInfoMap::Map ctrlMap; bool ccmEnabled = false; + bool gpuIspEnabled = false; }; } /* namespace ipa::soft */ diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp index b147aca2e..523ff07b3 100644 --- a/src/ipa/simple/soft_simple.cpp +++ b/src/ipa/simple/soft_simple.cpp @@ -56,7 +56,8 @@ public: const IPACameraSensorInfo &sensorInfo, const ControlInfoMap &sensorControls, ControlInfoMap *ipaControls, - bool *ccmEnabled) override; + bool *ccmEnabled, + bool *gpuIspEnabled) override; int configure(const IPAConfigInfo &configInfo) override; int start() override; @@ -96,7 +97,8 @@ int IPASoftSimple::init(const IPASettings &settings, const IPACameraSensorInfo &sensorInfo, const ControlInfoMap &sensorControls, ControlInfoMap *ipaControls, - bool *ccmEnabled) + bool *ccmEnabled, + bool *gpuIspEnabled) { camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel); if (!camHelper_) { @@ -106,6 +108,7 @@ int IPASoftSimple::init(const IPASettings &settings, } context_.sensorInfo = sensorInfo; + context_.gpuIspEnabled = *gpuIspEnabled; /* Load the tuning data file */ File file(settings.configurationFile); diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 9944ca573..7f3f7b0bc 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -130,12 +130,18 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, } } + bool gpuIspEnabled; + #if HAVE_DEBAYER_EGL - if (!softISPMode || !strcmp(softISPMode, "gpu")) + if (!softISPMode || !strcmp(softISPMode, "gpu")) { debayer_ = std::make_unique(std::move(stats), configuration); + gpuIspEnabled = true; + } #endif - if (!debayer_) + if (!debayer_) { debayer_ = std::make_unique(std::move(stats), configuration); + gpuIspEnabled = false; + } if (!debayer_) { LOG(SoftwareIsp, Error) << "Failed to create Debayer object"; @@ -173,7 +179,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, sensorInfo, sensor->controls(), ipaControls, - &ccmEnabled_); + &ccmEnabled_, + &gpuIspEnabled); if (ret) { LOG(SoftwareIsp, Error) << "IPA init failed"; debayer_.reset();