Toggling VRR (Adaptive Sync) corrupts the display.
Description
Upon toggling VRR from off to on, there is a high chance the display gets corrupted.
System information
Software: Arch Linux (kernel 6.5.5-arch1-1 on x86_64)
Device model: Thinkpad X1 Carbon Gen11 (21HMCTO1WW) with integrated graphics (i7-1370P)
Display: eDP (Laptop screen)
Steps to reproduce (Under Plasma Wayland)
- Start KDE Plasma Wayland session.
- Check that the VRR policy of the screen (KDE system settings > Display > Adaptive Sync) is set to Automatic. This should enable VRR only under fullscreen.
- Start Firefox and press F11 to toggle fullscreen.
- With a high chance (~9 out of 10), the screen tears and then goes dark.
- After glitching, the system almost always remains responsive. Part of the screen might flash with screen content when the screen is updated.
In rare occasions, the screen recovers to normal operation after a while or some input. After recovery, it may or may not to induce the corruption again without rebooting. The conditions for these are unclear.
Additional Information
The glitch can also be triggered by changing the VRR policy option from Automatic/Never to Always, which enables VRR when the settings are applied. This method is less consistent.
It appears to me that the consistency of the issue varies depending on the window used. It seems that more complicated windows (e.g. Firefox, Stellarium, Thunderbird) triggers the problem more frequently than, say, a console emulator or emacs. Other Wayland compositors implementing a similar VRR policy also suffer from the problem.
The following error is produced by i915 in the kernel log on every occurrence. You may use it to locate the issue in the kernel logs.
i915 0000:00:02.0: [drm] *ERROR* Timed out waiting PSR idle state
Other error messages may appear in company. In particular, the following appears on the first occurrence after booting.
i915 0000:00:02.0: [drm] *ERROR* CPU pipe A FIFO underrun: port,transcoder,
Kernel debug logs
kernel-log-drm-debug-2 The log produced with KDE + Firefox.
kernel-log-drm-debug-1 Accidentally reproduced when toggling the VRR settings in KDE System Settings.