[10/27] libcamera: software_isp: Start the ISP thread in configure
diff mbox series

Message ID 20250422215920.4297-11-bryan.odonoghue@linaro.org
State RFC
Headers show
Series
  • RFC: Add in a eGL based GPUISP in libcamera
Related show

Commit Message

Bryan O'Donoghue April 22, 2025, 9:59 p.m. UTC
OpenGL is not thread-safe and in fact associates invisible handles with the
threadid of the calling context.

As a result we need to make configure() and process() in SoftISP execute on
the same thread.

Move start thread into configure() as a first step towards this.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 src/libcamera/software_isp/software_isp.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp
index 28e2a360..7bee8f06 100644
--- a/src/libcamera/software_isp/software_isp.cpp
+++ b/src/libcamera/software_isp/software_isp.cpp
@@ -159,8 +159,6 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 					    metadataReady.emit(frame, metadata);
 				    });
 	ipa_->setSensorControls.connect(this, &SoftwareIsp::setSensorCtrls);
-
-	debayer_->moveToThread(&ispWorkerThread_);
 }
 
 SoftwareIsp::~SoftwareIsp()
@@ -262,6 +260,9 @@  int SoftwareIsp::configure(const StreamConfiguration &inputCfg,
 	if (ret < 0)
 		return ret;
 
+	debayer_->moveToThread(&ispWorkerThread_);
+	ispWorkerThread_.start();
+
 	return debayer_->configure(inputCfg, outputCfgs, ccmEnabled_);
 }
 
@@ -343,7 +344,6 @@  int SoftwareIsp::start()
 	if (ret)
 		return ret;
 
-	ispWorkerThread_.start();
 	return 0;
 }