[modeset] xrandr transformations cause significant visible tearing in Xorg sessions

Bug #1846398 reported by Dean Henrichsmeyer
110
This bug affects 18 people
Affects Status Importance Assigned to Milestone
X.Org X server
New
Unknown
xorg-server (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

On my laptop, fractional scaling seems fine, including watching a YouTube video. It has a quad HD display.

Enabling fractional scaling on my desktop which is attached to a single 4k display, fractional scaling isn't usable. The video appears to be constantly refreshing and not using the same acceleration as if I just run at 100% or 200%.

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: gnome-shell 3.34.0-1ubuntu1
ProcVersionSignature: Ubuntu 5.3.0-13.14-generic 5.3.0
Uname: Linux 5.3.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Oct 2 14:23:33 2019
DisplayManager: gdm3
InstallationDate: Installed on 2018-07-24 (435 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180724)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
RelatedPackageVersions: mutter-common 3.34.0-3ubuntu1
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to eoan on 2019-07-19 (74 days ago)

Revision history for this message
Dean Henrichsmeyer (dean) wrote :
tags: added: xrandr-scaling
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I can't yet tell which issue this is, but it sounds likely to be one of
https://discourse.ubuntu.com/t/x11-hidpi-scaling-available-for-testing-on-disco/10293/3

If you need a fractional scale value then you should find the implementation for Wayland sessions performs better and is more complete. Because it doesn't have to deal with legacy Xorg.

If you need Xorg then using whole scale values (n * 100%) works better as you mentioned, because it avoids the Xorg fractional scaling path.

tags: added: performance
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

At least I *hope* that Wayland would perform better. If you're using Wayland with multiple monitors then for some people it might not, due to bug 1730460: https://gitlab.gnome.org/GNOME/mutter/issues/3

My goal is to have a fix for that landed in GNOME next year. Which was on one of the slides I missed in my performance talk :)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We're probably not going to rewrite the Xorg fractional scaling to work around shortcomings in the Xorg feature we rely on. It maybe isn't even possible. More likely we're just waiting on fixes to Xorg itself:

https://gitlab.freedesktop.org/xorg/xserver/merge_requests/24

Or similarly likely Wayland will become the default where fractional scaling works better already.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Changed in xorg-server:
status: Unknown → New
summary: - Fractional scaling has significant visible refreshes on a 4k display
+ Fractional scaling has significant visible tearing on a 4k display
Revision history for this message
Dean Henrichsmeyer (dean) wrote : Re: Fractional scaling has significant visible tearing on a 4k display

Just to provide more information - my initial report was incorrect. I did in fact see the tearing on the laptop display. It seems whenever you're using non-integer scaling with Xorg, that's what happens.

summary: - Fractional scaling has significant visible tearing on a 4k display
+ Fractional scaling has significant visible tearing on a 4k display in
+ Xorg sessions
no longer affects: gnome-shell (Ubuntu)
no longer affects: mutter (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Fractional scaling has significant visible tearing on a 4k display in Xorg sessions
summary: - Fractional scaling has significant visible tearing on a 4k display in
- Xorg sessions
+ Fractional scaling has significant visible tearing in Xorg sessions
Revision history for this message
Matt Austin (mattaustin) wrote : Re: Fractional scaling has significant visible tearing in Xorg sessions

Thanks for the feedback, but I don't believe I am using fractional scaling. My scaling is set to 100%, but I have changed the font scaling to 1.25.

If I set font scaling to 1.0, then I see the same tearing.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sorry Matt, I have now reopened bug 1853094 for you.

Changed in xorg-server (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
tags: added: tearing
Revision history for this message
Mert Can Demir (validatedev) wrote :

Well, Wayland won’t be usable with fractional scaling until fixing the blur with XWayland applications. Many apps are doesn’t support native Wayland, unfortunately.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Maybe upstream bug https://gitlab.freedesktop.org/xorg/xserver/-/issues/996 is more appropriate here, but still refer to bug https://gitlab.freedesktop.org/xorg/xserver/issues/244 for the general problem.

summary: - Fractional scaling has significant visible tearing in Xorg sessions
+ [modeset] Fractional scaling has significant visible tearing in Xorg
+ sessions
summary: - [modeset] Fractional scaling has significant visible tearing in Xorg
+ [modeset] xrandr scaling has significant visible tearing in Xorg
sessions
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Retitled again because this includes screen rotation, not just scaling.

summary: - [modeset] xrandr scaling has significant visible tearing in Xorg
- sessions
+ [modeset] xrandr transformations cause significant visible tearing in
+ Xorg sessions
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Jeffrey Knockel (jeff250) wrote :

The proposed fix has been merged to the xserver master branch.

The author of the fix also has a patch set against a recent xserver stable release here:

https://github.com/kerneltoast/xserver/tree/new-tearfree-21.1.5

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"fixed-in-xorg-22" is probably wrong because the last release was 21.x and the year is already 2023. Fixed in the next major release anyway. I don't yet see it in the 21.x series.

tags: added: fixed-in-xorg-22 fixed-upstream
tags: removed: fixed-in-xorg-22
Revision history for this message
Jeffrey Knockel (jeff250) wrote :

For testing I've created a PPA with the patches applied to 21.1.6:

https://launchpad.net/%7Ejeff250/+archive/ubuntu/xserver-xorg-with-tearfree-modesetting

Since using it I haven't seen any tearing, and I haven't seen any new issues (yet!) either.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Just a reminder that most Ubuntu users can ignore this bug now because most are getting Wayland by default instead.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.