| Message ID | 20260503114002.139255-4-robert.mader@collabora.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
2026. 05. 03. 13:40 keltezéssel, Robert Mader írta: > Instead of waiting for the GPU to finish the output buffer *before* > computing stats, do so afterwards. This allows work to happen in > parallel on the GPU and CPU, potentially improving throughput and > reducing latency. > > This, however, requires us to include stats computation into the > debayer benchmark data. > > Signed-off-by: Robert Mader <robert.mader@collabora.com> > --- The slight change in the timing results seems more than acceptable to me. Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > src/libcamera/software_isp/debayer_egl.cpp | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp > index 624469947..7dae52648 100644 > --- a/src/libcamera/software_isp/debayer_egl.cpp > +++ b/src/libcamera/software_isp/debayer_egl.cpp > @@ -525,8 +525,6 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector< > if (err != GL_NO_ERROR) { > LOG(eGL, Error) << "Drawing scene fail " << err; > return -ENODEV; > - } else { > - egl_.syncOutput(); > } > > return 0; > @@ -549,8 +547,6 @@ 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 */ > @@ -559,6 +555,9 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output > stats_->processFrame(frame, 0, input); > dmaSyncers.clear(); > > + egl_.syncOutput(); > + bench_.finishFrame(); > + > outputBufferReady.emit(output); > inputBufferReady.emit(input); >
diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 624469947..7dae52648 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -525,8 +525,6 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector< if (err != GL_NO_ERROR) { LOG(eGL, Error) << "Drawing scene fail " << err; return -ENODEV; - } else { - egl_.syncOutput(); } return 0; @@ -549,8 +547,6 @@ 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 */ @@ -559,6 +555,9 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output stats_->processFrame(frame, 0, input); dmaSyncers.clear(); + egl_.syncOutput(); + bench_.finishFrame(); + outputBufferReady.emit(output); inputBufferReady.emit(input);
Instead of waiting for the GPU to finish the output buffer *before* computing stats, do so afterwards. This allows work to happen in parallel on the GPU and CPU, potentially improving throughput and reducing latency. This, however, requires us to include stats computation into the debayer benchmark data. Signed-off-by: Robert Mader <robert.mader@collabora.com> --- src/libcamera/software_isp/debayer_egl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)