Draft: egl/wayland: Use timestamped commits for SwapBuffers
egl/wayland: Use timestamped commits for SwapBuffers
The frame callback mechanism isn't a great way to implement timing for eglSwapBuffers - it stops firing when a surface is occluded, and it can only tell us when to render for the next refresh (thus can't be used to handle swap intervals greater than 1.)
Using the new commit timing protocol, along with the stable presentation feedback protocol, we can submit a frame to display several refresh intervals into the future.
Using the commit queue protocol and adding an extra wl_surface.commit(), we can ensure that we will receive a presentation feedback presented or discarded event even when frame callbacks would stop.
Using the refresh rate information in the presentation feedback events we can calculate frame times into the future, and use this to implement swap intervals.
Setting the environment variable MESA_WAYLAND_DISABLE_TIMESTAMPS will revert to the old frame callback based behaviour.
Signed-off-by: Derek Foreman derek.foreman@collabora.com