[v1,2/3] egl: Call glFlush before glFinish
diff mbox series

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

Commit Message

Robert Mader May 21, 2026, 2:10 p.m. UTC
Apparently it is not guaranteed that drivers will do so implicitly,
which may or may not be a driver bug. The impact on performance has been
observed to be significant and it's easy enough, so let's do it
explicitly.

Below are some benchmark results. All where done using postmarketOS edge
with updates from 21th May 2026 (Mesa 26.1.1). The mentioned pipelines
where run five times each, with the mean value included here, which should
be quite representive as the variance was rather small. All devices
where using the powersave governor.

cam -c /base/soc@0/cci@ac4a000/i2c-bus@0/camera@1a -s width=1920,height=1080 --capture=60
Before: 47986 us/frame
After: 33596 us/frame !

cam -c /base/soc@0/cci@ac4a000/i2c-bus@1/camera@1a -s width=1920,height=1080 --capture=60
Before: 30294 us/frame
After: 14922 us/frame !

cam -c /base/soc@0/cci@ac4b000/i2c-bus@1/camera@10 -s width=1920,height=1080 --capture=60
Before: 27373 us/frame
After: 26106 us/frame

cam -c /base/soc@0/cci@ac4a000/i2c-bus@1/camera@29 -s width=1920,height=1080 --capture=60
Before: 16339 us/frame
After: 15897 us/frame

cam -c /base/soc@0/cci@ac4a000/i2c-bus@1/camera@10 -s width=1920,height=1080 --capture=60
Before: 26206 us/frame
After: 25721 us/frame

cam -c /base/soc@0/cci@ac4a000/i2c-bus@0/camera@10 -s width=1920,height=1080 --capture=60
Before: 43723 us/frame
After: 34124 us/frame !

cam -c /base/soc@0/cci@ac4a000/i2c-bus@0/camera@1a -s width=1920,height=1080 --capture=60
Before: 23597 us/frame
After: 23707 us/frame

cam -c /base/soc@0/bus@30800000/i2c@30a40000/camera@20 -s width=1280,height=720 --capture=60
Before: 91200 us/frame
After: 91649 us/frame

cam -c /base/soc@0/bus@30800000/i2c@30a50000/camera@2d -s width=1280,height=720 --capture=60
Before: 76577 us/frame
After: 76956 us/frame

cam -c /base/i2c-csi/front-camera@3c -s width=1280,height=720 --capture=60
Before: 188122 us/frame
After: 188500 us/frame

cam -c /base/i2c-csi/rear-camera@4c -s width=1280,height=720 --capture=60
Before: 193712 us/frame
After: 190222 us/frame

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 src/libcamera/egl.cpp | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp
index 357918711..d9bc4f555 100644
--- a/src/libcamera/egl.cpp
+++ b/src/libcamera/egl.cpp
@@ -94,6 +94,7 @@  void eGL::syncOutput()
 {
 	ASSERT(tid_ == Thread::currentId());
 
+	glFlush();
 	glFinish();
 }