[25/30] libcamera: software_isp: gpu_pipeline_shader_pass: Add shader DEBUG time logging
diff mbox series

Message ID 20260618122245.946138-26-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • RFC/RFT: gpuisp: Multipass with speed optimisations on top
Related show

Commit Message

Bryan O'Donoghue June 18, 2026, 12:22 p.m. UTC
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 .../software_isp/gpu_pipeline_shader_pass.cpp          | 10 ++++++++++
 src/libcamera/software_isp/gpu_pipeline_shader_pass.h  |  4 ++++
 2 files changed, 14 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/gpu_pipeline_shader_pass.cpp b/src/libcamera/software_isp/gpu_pipeline_shader_pass.cpp
index d0d13eef9..57d60f50e 100644
--- a/src/libcamera/software_isp/gpu_pipeline_shader_pass.cpp
+++ b/src/libcamera/software_isp/gpu_pipeline_shader_pass.cpp
@@ -57,6 +57,8 @@  int GpuIspShaderPass::process(eGLImage &eglImageIn, eGLImage &eglImageOut, uint3
 	glViewport(0, 0, width, height);
 	glClear(GL_COLOR_BUFFER_BIT);
 
+	eglBenchMark_.begin(egl_);
+
 	glDrawArrays(GL_TRIANGLE_FAN, 0, DEBAYER_OPENGL_COORDS);
 	err = glGetError();
 	if (err != GL_NO_ERROR) {
@@ -64,9 +66,17 @@  int GpuIspShaderPass::process(eGLImage &eglImageIn, eGLImage &eglImageOut, uint3
 		return -ENODEV;
 	}
 
+	eglBenchMark_.end(egl_);
+
 	return 0;
 }
 
+void GpuIspShaderPass::printShaderBenchMark(void)
+{
+	LOG(GpuShaderPass, Debug) <<
+	    "ShaderPass = " << this->name() << " took " << eglBenchMark_.getTimeElapsedSync(egl_) / 1000 << " us";
+}
+
 int GpuIspShaderPass::start()
 {
 	return 0;
diff --git a/src/libcamera/software_isp/gpu_pipeline_shader_pass.h b/src/libcamera/software_isp/gpu_pipeline_shader_pass.h
index a329845ee..0cff531e9 100644
--- a/src/libcamera/software_isp/gpu_pipeline_shader_pass.h
+++ b/src/libcamera/software_isp/gpu_pipeline_shader_pass.h
@@ -74,8 +74,12 @@  public:
 	 */
 	GLint glFormat_;
 
+	void initShaderBenchMark(void) { eglBenchMark_.init(); }
+	void printShaderBenchMark(void);
+
 protected:
 	eGL& egl_;
+	eGLBenchMark eglBenchMark_;
 
 	/* Shader calculates this getter provides ability to interrogate if needed */
 	unsigned int bytesPerPixel_;