Bug
1640779 - [X11][EGL] Implement xrandr-based software vsync, r=stransky,gfx-reviewers,jrmuizel
Current drivers, both Mesa and prop. Nvidia, miss features on X11/EGL
to implement a proper hardware feedback based vsync. Given the focus
on Wayland by everyone involved, it's unlikely that we'll ever get
everything into a decent shape.
As a best effort alternative, subclass the `SoftwareVsyncSource`
to run at the highest refresh rate reported by xrandr. This should
allow us to render at the right refresh rate in most cases.
We recalculate the refresh rate whenever GDK emits the
`monitors-changed` signal - unfortunately there's no exact signal for
refresh rate changes.
Always use this new vsync source on Xwayland or non-Mesa EGL - i.e. only
use the GLX vsync source on Xorg+GLX or Xorg+EGL+Mesa.
Note: tearing prevention on Linux is always left to the system
compositor, also when using the GLX-based `GtkVsyncSource`.
Differential Revision: https://phabricator.services.mozilla.com/
D128607