[RFC,v2,15/26] libcamera: software_isp: egl: Add Ping/Pong buffers with start/stop bindings only
diff mbox series

Message ID 20261118095735.170587-16-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • gpuisp multipass + fixes
Related show

Commit Message

Bryan O'Donoghue Nov. 18, 2026, 9:57 a.m. UTC
Add in the Ping/Pong texture buffers, don't bind them to anything yet.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 src/libcamera/software_isp/software_isp_instance_gpu.cpp | 6 ++++++
 src/libcamera/software_isp/software_isp_instance_gpu.h   | 2 ++
 2 files changed, 8 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/software_isp_instance_gpu.cpp b/src/libcamera/software_isp/software_isp_instance_gpu.cpp
index 31b57d2a0..85820b267 100644
--- a/src/libcamera/software_isp/software_isp_instance_gpu.cpp
+++ b/src/libcamera/software_isp/software_isp_instance_gpu.cpp
@@ -389,6 +389,10 @@  int SoftwareIspInstanceGpu::start()
 	if (initBayerShaders(inputPixelFormat_, outputPixelFormat_))
 		return -EINVAL;
 
+	/* Intermediary ping/pong textures */
+	eglImagePingPong_[0] = std::make_unique<eGLImage>(gpuIspShaderPassDemosiac_.glFormat_, outputSize_.width, outputSize_.height, outputConfig_.stride, GL_TEXTURE1, 1);
+	eglImagePingPong_[1] = std::make_unique<eGLImage>(gpuIspShaderPassDemosiac_.glFormat_, outputSize_.width, outputSize_.height, outputConfig_.stride, GL_TEXTURE2, 2);
+
 	return 0;
 }
 
@@ -396,6 +400,8 @@  void SoftwareIspInstanceGpu::stop()
 {
 	eglImageOutCache_.clear();
 	eglImageInCache_.clear();
+	eglImagePingPong_[1].reset();
+	eglImagePingPong_[0].reset();
 
 	gpuIspShaderPassDemosiac_.stop();
 
diff --git a/src/libcamera/software_isp/software_isp_instance_gpu.h b/src/libcamera/software_isp/software_isp_instance_gpu.h
index 695fbd8d5..9da9e717b 100644
--- a/src/libcamera/software_isp/software_isp_instance_gpu.h
+++ b/src/libcamera/software_isp/software_isp_instance_gpu.h
@@ -71,6 +71,8 @@  private:
 
 	eGLImage *getCachedInputFrameBuffer(FrameBuffer *input, std::optional<MappedFrameBuffer> *inMapped, std::optional<DmaSyncer> *inDmaSyncer);
 	eGLImage *getCachedOutputFrameBuffer(FrameBuffer *output);
+	/* Pointer to object representing input texture */
+	std::unique_ptr<eGLImage> eglImagePingPong_[2];
 
 	/* Pointer to object representing input texture */
 	std::deque<std::pair<SharedFD, std::unique_ptr<eGLImage>>> eglImageInCache_;