[v7,22/26] ipa: simple: Add a flag to indicate gpuIspEnabled
diff mbox series

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

Commit Message

Bryan O'Donoghue Dec. 10, 2025, 12:53 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.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
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 03d8007ea..20c75de4e 100644
--- a/src/ipa/simple/ipa_context.h
+++ b/src/ipa/simple/ipa_context.h
@@ -104,6 +104,7 @@  struct IPAContext {
 	ControlInfoMap::Map ctrlMap;
 	bool ccmEnabled = false;
 	bool selfInitialising = 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 06f93ee0f..1aa4357ad 100644
--- a/src/libcamera/software_isp/software_isp.cpp
+++ b/src/libcamera/software_isp/software_isp.cpp
@@ -121,6 +121,8 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 	}
 	stats->statsReady.connect(this, &SoftwareIsp::statsReady);
 
+	bool gpuIspEnabled;
+
 #if HAVE_DEBAYER_EGL
 	std::optional<std::string> softISPMode = configuration.envOption("LIBCAMERA_SOFTISP_MODE", { "software_isp", "mode" });
 	if (softISPMode) {
@@ -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) {