Comment 0 for bug 1211076

Revision history for this message
Axel Davy (davyaxel) wrote :

In native-state-wayland.cpp,
In NativeStateWayland::flip, you call wl_display_dispatch.

In the wayland documentation, it says this function dispatch the event queue and block if there is no event.
With the current Mesa egl implementation eglSwapInterval(0) doesn't work, and everything is as if it was eglSwapInterval(1):
When commiting the buffer, egl put a listener to know when the frame is drawn (when the frame is drawn a event is sent).

I was testing an experimentation implementation of eglSwapInterval(0), and glmark2 was blocked until I press keyboard or other things (ie send events). This is because eglSwapBuffers doesn't put any listener on the frame in this case.

Commiting a buffer is not considered an event but a request, that is why wl_display_dispatch is not adapted.

Instead what you want is wl_display_roundtrip, that will process the pending requests and process the commit of the buffer in egl.