[v2,1/2] debayer_egl: Include stats computation into benchmark
diff mbox series

Message ID 20260526080639.70173-2-robert.mader@collabora.com
State New
Headers show
Series
  • debayer_egl: Sync output buffers after processing stats
Related show

Commit Message

Robert Mader May 26, 2026, 8:06 a.m. UTC
The following commit will allow debayering on the GPU and stats
computation on the CPU to happen in parallel, requiring this change in
order to keep the benchmark meaningful.

Do the change first in order to make before/after comparisons simpler.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 src/libcamera/software_isp/debayer_egl.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kieran Bingham May 26, 2026, 8:15 a.m. UTC | #1
Quoting Robert Mader (2026-05-26 09:06:38)
> The following commit will allow debayering on the GPU and stats
> computation on the CPU to happen in parallel, requiring this change in
> order to keep the benchmark meaningful.
> 
> Do the change first in order to make before/after comparisons simpler.

Stefan has a plan for a new extensible 'debug metadata' type, which I
think we will be able to use to add more metrics like this and report
them on the metadata, so then we might want to measure the image
operations and the cache operations as two separate measurements even?

But that's future ware


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Robert Mader <robert.mader@collabora.com>
> ---
>  src/libcamera/software_isp/debayer_egl.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
> index eae4c57f4..ed9a68013 100644
> --- a/src/libcamera/software_isp/debayer_egl.cpp
> +++ b/src/libcamera/software_isp/debayer_egl.cpp
> @@ -552,14 +552,14 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output
>                 goto error;
>         }
>  
> -       bench_.finishFrame();
> -
>         metadata.planes()[0].bytesused = output->planes()[0].length;
>  
>         /* Calculate stats for the whole frame */
>         stats_->processFrame(frame, 0, input);
>         dmaSyncers.clear();
>  
> +       bench_.finishFrame();
> +
>         outputBufferReady.emit(output);
>         inputBufferReady.emit(input);
>  
> -- 
> 2.54.0
>
Bryan O'Donoghue May 26, 2026, 5:23 p.m. UTC | #2
On 26/05/2026 09:06, Robert Mader wrote:
> The following commit will allow debayering on the GPU and stats
> computation on the CPU to happen in parallel, requiring this change in
> order to keep the benchmark meaningful.
> 
> Do the change first in order to make before/after comparisons simpler.
> 
> Signed-off-by: Robert Mader <robert.mader@collabora.com>
> ---
>   src/libcamera/software_isp/debayer_egl.cpp | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
> index eae4c57f4..ed9a68013 100644
> --- a/src/libcamera/software_isp/debayer_egl.cpp
> +++ b/src/libcamera/software_isp/debayer_egl.cpp
> @@ -552,14 +552,14 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output
>   		goto error;
>   	}
> 
> -	bench_.finishFrame();
> -
>   	metadata.planes()[0].bytesused = output->planes()[0].length;
> 
>   	/* Calculate stats for the whole frame */
>   	stats_->processFrame(frame, 0, input);
>   	dmaSyncers.clear();
> 
> +	bench_.finishFrame();
> +
>   	outputBufferReady.emit(output);
>   	inputBufferReady.emit(input);
> 
> --
> 2.54.0
> 


Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

---
bod

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index eae4c57f4..ed9a68013 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -552,14 +552,14 @@  void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output
 		goto error;
 	}
 
-	bench_.finishFrame();
-
 	metadata.planes()[0].bytesused = output->planes()[0].length;
 
 	/* Calculate stats for the whole frame */
 	stats_->processFrame(frame, 0, input);
 	dmaSyncers.clear();
 
+	bench_.finishFrame();
+
 	outputBufferReady.emit(output);
 	inputBufferReady.emit(input);