Sub 16ms render but missing swap

Joe M brainsnacks at yahoo.com
Wed Oct 18 00:00:45 UTC 2023


In a GLES app wired up to Weston/Wayland using EGL, we're calling `eglSwapBuffers` in a render loop that takes about 12-13ms to draw our content, based on CPU timing the run loop. However, the call to swap incurs a duration of around 20ms, meaning we're only hitting 30fps.
I've investigated a little bit into using the presentation callback protocol, but my understanding is that the EGL display (part of drm-wayland in the mesa source IIRC) is itself already plugged in to the necessary Wayland callbacks such that using `eglSwapBuffers` is sufficient to maximize available draw time.
I also tried enabling the profile flag in weston.ini that allows you to collect a trace, viewable in *wesgr*.  And I read Pekka's blog posts about these diagrams, but I still can't understand if our app is doing something suboptimally. I can't decipher what the wesgr diagram is saying.
The other weston.ini knob I've tried is the `repaint` window, setting it to 12 or 13 to match our drawing loop. This seems to help sometimes but not in this case.
A few questions:  1. What other avenues of investigation should I pursue for the swap delay? As in, why when I take 12 ms to render do I not see about 4ms for the swap call to return? My display is running in at 60hz.  2. Has EGL been optimized to use the available wayland callbacks and maximize available client drawing time?  3. Does EGL leverage "weston_direct_display_v1" when available? What's required to take advantage of it in the app code? (ie. run fullscreen?)
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20231018/378f2ab1/attachment.htm>


More information about the wayland-devel mailing list