[v5,21/24] ipa: simple: Add a flag to indicate gpuIspEnabled
diff mbox series

Message ID 20251127023739.179652-22-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • Add GLES 2.0 GPUISP to libcamera
Related show

Commit Message

Bryan O'Donoghue Nov. 27, 2025, 2:37 a.m. UTC
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 <bryan.odonoghue@linaro.org>
---
 include/libcamera/ipa/soft.mojom            | 3 ++-
 src/ipa/simple/ipa_context.h                | 1 +
 src/ipa/simple/soft_simple.cpp              | 3 +++
 src/libcamera/software_isp/software_isp.cpp | 8 +++++++-
 4 files changed, 13 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom
index 77328c5fd..aff8fcbd3 100644
--- a/include/libcamera/ipa/soft.mojom
+++ b/include/libcamera/ipa/soft.mojom
@@ -17,7 +17,8 @@  interface IPASoftInterface {
 	     libcamera.SharedFD fdStats,
 	     libcamera.SharedFD fdParams,
 	     libcamera.IPACameraSensorInfo sensorInfo,
-	     libcamera.ControlInfoMap sensorControls)
+	     libcamera.ControlInfoMap sensorControls,
+	     bool gpuIspEnabled)
 		=> (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled);
 	start() => (int32 ret);
 	stop();
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<IPAFrameContext> 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..2bbe271d9 100644
--- a/src/ipa/simple/soft_simple.cpp
+++ b/src/ipa/simple/soft_simple.cpp
@@ -55,6 +55,7 @@  public:
 		 const SharedFD &fdParams,
 		 const IPACameraSensorInfo &sensorInfo,
 		 const ControlInfoMap &sensorControls,
+		 bool gpuIspEnabled,
 		 ControlInfoMap *ipaControls,
 		 bool *ccmEnabled) override;
 	int configure(const IPAConfigInfo &configInfo) override;
@@ -95,6 +96,7 @@  int IPASoftSimple::init(const IPASettings &settings,
 			const SharedFD &fdParams,
 			const IPACameraSensorInfo &sensorInfo,
 			const ControlInfoMap &sensorControls,
+			bool gpuIspEnabled,
 			ControlInfoMap *ipaControls,
 			bool *ccmEnabled)
 {
@@ -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 a54dcbaf5..8479760fc 100644
--- a/src/libcamera/software_isp/software_isp.cpp
+++ b/src/libcamera/software_isp/software_isp.cpp
@@ -130,6 +130,8 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 		}
 	}
 
+	bool gpuIspEnabled;
+
 #if HAVE_DEBAYER_EGL
 	if (!softISPMode || !strcmp(softISPMode, "gpu")) {
 		debayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration);
@@ -137,10 +139,13 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 			LOG(SoftwareIsp, Error) << "Failed to instantiate GPUISP";
 			return;
 		}
+		gpuIspEnabled = true;
 	}
 #endif
-	if (!debayer_)
+	if (!debayer_) {
 		debayer_ = std::make_unique<DebayerCpu>(std::move(stats), configuration);
+		gpuIspEnabled = false;
+	}
 
 	if (!debayer_) {
 		LOG(SoftwareIsp, Error) << "Failed to create Debayer object";
@@ -177,6 +182,7 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 			 sharedParams_.fd(),
 			 sensorInfo,
 			 sensor->controls(),
+			 gpuIspEnabled,
 			 ipaControls,
 			 &ccmEnabled_);
 	if (ret) {