TearFree inadvertently disabled by default in Linux v5.9 onwards
[originally emailed to intel-gfx@ on Dec 6th, but posting here since it has been held in moderation since]
I believe Linux commit 8a25c4be583d8a9e38fbadcc49d4de32b1aa8906 ("drm/i915/params: switch to device specific parameters"), included in Linux v5.9, inadvertedly flipped the default for the TearFree option on xf86-video-intel, causing tears by default on at least my configuration (ThinkPad T450s, with an external monitor; Debian buster), and presumably to other users as well, e.g. the troubles reported in this Manajro Linux forum thread are probably rooted in this issue.
Without any any i915 module parameters or Xorg settings set, the following happens:
Under Linux <= v5.8, sysfs reports:
# cat /sys/module/i915/parameters/enable_fbc 1 # cat /sys/module/i915/parameters/enable_psr 0
On v5.9 (I think because of 8a25c4b), however:
# cat /sys/module/i915/parameters/enable_fbc -1 # cat /sys/module/i915/parameters/enable_psr -1
In both kernel versions:
# cat /sys/kernel/debug/dri/0/i915_fbc_status FBC enabled Compressing: yes
However, in the xf86-video-intel Xorg driver, there is a function,
sna_mode_wants_tear_free(), that enables TearFree by default in certain configurations, namely if FBC or PSR are enabled. To do so, it checks the sysfs entries
/sys/module/i915/parameters/enable_psr and returns true, if either of them has a value > 0. On v5.9+, this is only the case if a kernel module has been passed, while previously it was the case if the chip defaults enabled FBC or PSR.
So what happens here is that the default changed, under the same configuration, with the kernel upgrade. It does not look to be intentional. Effectively,
sna_mode_wants_tear_free() is not working as intended on v5.9 onwards.
The issue is easily fixed by manually setting TearFree to enabled in the Xorg configuration, but it took me a while to track this down. I'm reporting here in case you want to treat this as a regression, and at least in the hopes that others won't have the same experience :)
Issue #2763 may be related.