HOWTO fix screen tearing

From LinuxReviews
Jump to navigationJump to search

Screen tearing is a problem with some combinations of drivers and some window-managers such as Xfce 4.12's xfwm. Luckily, it's easily fixable by adding a minor snipplet to Xorg's configuration file.

Create one of the following configuration files in /etc/X11/xorg.conf.d/ (create that folder if it does not exist, there's no such folder on Ubuntu by default but it does look for it and read files in it) to avoid screen tearing.

Intel iGPUs[edit | edit source]

File: /etc/X11/xorg.conf.d/20-intel-gpu.conf
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree"  "true"
EndSection

Some rare Intel CPUs will additionally need "AccelMethod" "uxa". That is usually not the case but that's what you need to add if the above configuration does not completely eliminate screen tearing on Intel GPUs:

File: /etc/X11/xorg.conf.d/20-intel-gpu.conf
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "uxa"
   Option      "TearFree" "true"
EndSection

AMD GPUs[edit | edit source]

If you are using a not ancient AMD GPU you're using the "amdgpu" driver and you need this:

File: /etc/X11/xorg.conf.d/20-amdgpu.conf
Section "Device"
   Identifier  "AMD Graphics"
   Driver      "amdgpu"
   Option      "TearFree"  "true"
EndSection

If you're using something rather old like a HD7850 you're using the "radeon" driver and you need:

File: /etc/X11/xorg.conf.d/20-radeon.conf
Section "Device"
   Identifier  "AMD Graphics"
   Driver      "radeon"
   Option      "TearFree"  "true"
EndSection

Grep the X log if you are unsure what driver you are using:

grep drivers /var/log/Xorg.0.log

That will produce a line such as:

[    24.285] (II) Loading /usr/lib64/xorg/modules/drivers/amdgpu_drv.so

or

[    21.857] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so
Blond-anime-girl-with-red-questionmark.png
Question: Why do you need to add this to X's configuration?

AMD graphics developers have no good answers and don't want to talk about it. Intel developers won't go near this quesiton with a 10-foot pole.

Now, imagine the setting was reversed and named something like HorribleSceenTearing. Would it be wise to default that to true? That is essentially what the GPU drivers are doing when they default TearFree to false. Exactly why the defaults are what they are is puzzling and nobody's willing to talk about it.

notes[edit | edit source]