On 2020-03-11 9:09 p.m., Simon Ser wrote:
Hi all,
I've been working on adding VRR support to Sway [1] (a Wayland compositor). The compositor just sets the VRR_ENABLED property.
This works fine for some screens, but causes flcikering for other screens as expected [2]. Fixing the flickering is something we've talked about last XDC [3]. The flickering is caused by physical limitations of the screen: changing the refresh rate too quickly results in brightness issues.
The approach taken by xf86-video-amdgpu is to only enable VRR if an app is fullscreen and not present in a special Mesa blacklist (e.g. Firefox is in the blacklist because it doesn't render at a fixed interval).
For Wayland, I'd prefer to avoid having a blacklist. I'd like to be able to use VRR in the general case (not just for fullscreen apps). A way to fix the flickering would be to implement a slew rate and make it so refresh rate variations are capped by the slew rate.
One potential issue I see with this is the cursor, which can feel awkward if it only moves at 30 Hz. I wonder if a slew rate which can reliably prevent flickering allows the framerate to ramp up quickly enough for this not to be annoying.