Screen tearing in Linux could be a major issue with non-compositing window managers.
Even many compositing window manager could show tearing while dragging windows.
Seems like lots of technical jargon, so to simplify the matter let's discus about basics.
You may often notice that a part of the video/graphics/window is torn apart from the main section. It's is glitch related with video or graphics rendering, when the input video is not in sync with the refresh rate of the display. That's called Screen tearing and on LCD displays, horizontal screen tearing is much prominent.
Screen tearing happens mostly when you're playing a video and dragging/moving or maximizing/minimizing a window.
Basically stacking window managers like kWin, Mutter, XFWM, Compiz with the capability of-screen buffering. They've functionalities like window shadow, 3D animation, transparent windows, anti-aliasing, blur background and many more.
They're much more visually appealing than simple window managers, read more here.
Contents
Fix Linux screen tearing with window managers
It's rather easy if you're using KWin, Mutter, Muffin or any other compositing window manager, there should be an option to to enable vsync anywhere in the settings.
If you're using KDE or minimal KWin, use the instruction below.
- Open up the System Settings application.
- Go to the Display and Monitor option under the Hardware section.
- Then on the Tearing prevention option, set it to Full screen repaints. img
XFWM also has an option to enable vsync to prevent tearing, that never works !
You can also use a compositing manager like compton or xcompmgr with Openbox or XFWM window manager. But there's another little tweak to prevent linux screen tearing efficiently on Intel graphics.
Prevent screen tearing on Linux with X11 configuration
It's possible to minimize screen tearing with a little tweak to the X11 configuration. However this option may not work always, specially with Intel Atom or Celeron CPU's inbuilt graphics.
First create a new X11 configuration directory, mkdir -p /etc/X11/xorg.conf.d/
, if already not exists.
Create a configuration file 20-intel.conf
there with your favorite text editor as root. sudo nano /etc/X11/xorg.conf.d/20-intel.conf
Put the configuration below there, and save the file, and exit the test editor.
Section "Device" Identifier "Intel Graphics" Driver "intel" Option "TearFree" "true" EndSection
Finally restart your X11 session by logging out and logging in again, or simply reboot the PC.
However you may need to add other few extra option like Option "AccelMethod" "uxa"
or Option "TripleBuffer" "true"
in the 20-intel.conf file.
Checked with 2nd generation Intel HD3000 graphics and 5 generation HD5500 graphics, both worked without those options.
Conclusion and thoughts
So, that's all about fixing screen tearing in linux with Intel graphics, hope it helped you.
Enabling vsync decreases the graphics benchmark performance, so next I'll experiment with the TripleBuffer and completely disable vsync and compare the difference.
If you've any question or suggestion, just leave a comment. Also don't forget to share if you've found this tutorial worthy to share.
mark says
Thanks.
The /etc/X11/xorg.conf.d/20-intel.conf file with your options sorted the tearing issue.
OS: Fedora Linux 36 (MATE-Compiz) x86_64
Host: 80XF Lenovo MIIX 320-10ICR
Kernel: 5.19.16-200.fc36.x86_64
DE: MATE 1.26.0
WM: Metacity (Marco)
CPU: Intel Atom x5-Z8350 (4) @ 1.920GHz
GPU: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx
Vitaly says
Now I cannot startx: no screens found(EE).
Torsten Bünting says
Hi, thanks for this, specifically Travis solution worked for my old Thinkpad T500 with Intel GM45 graphics
[...]
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "DRI" "2"
Option "AccelMethod" "SNA"
Option "TripleBuffer" "true"
option "TearFree" "true"
EndSection
[...]
Torsten Bünting says
I forgot, the system is Linux Mint 20 Beta...
JRP says
It worked with Linux Lite 4.8, but messed up VLC video playback. I guess I just go to Windows for that task, then.
fhfs says
Thanks, was really looking for this, since wayland is still(10 years later) a pain in my ass
Alex says
YEAH BOY! Thanks guys!
tahirgurz says
Instructions given below KDE section worked well for my manjaro kde intel 4000HD graphics
Alan says
Didn't work for me.
System:
Host: NUC7i7 Kernel: 4.15.0-48-generic x86_64 bits: 64
Desktop: Cinnamon 4.0.10 Distro: Linux Mint 19.1 Tessa
Machine:
Type: N/A System: Intel product: NUC7i7DNKE v: J85069-202
serial:
Mobo: Intel model: NUC7i7DNB v: J83500-202 serial:
UEFI [Legacy]: Intel v: DNKBLi7v.86A.0060.2018.1220.1528 date: 12/20/2018
CPU:
Topology: Quad Core model: Intel Core i7-8650U bits: 64 type: MT MCP
L2 cache: 8192 KiB
Speed: 802 MHz min/max: 400/4200 MHz Core speeds (MHz): 1: 801 2: 800
3: 800 4: 800 5: 800 6: 800 7: 800 8: 800
Graphics:
Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
Display: x11 server: X.Org 1.19.6 driver: intel resolution: 3840x2160~60Hz
OpenGL: renderer: llvmpipe (LLVM 7.0 256 bits) v: 3.3 Mesa 18.2.8
ybb says
i think linux mint fixes screen tearing itself
Travis Fitzgerald says
I am using a Minix Z83-4 which runs the Intel Cherry trail architecture, running Ubuntu. The config that I got to work tearfree is:
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "DRI" "2"
Option "AccelMethod" "SNA"
Option "TripleBuffer" "true"
option "TearFree" "true"
EndSection
This cleared up all screen tearing (with a slight increase in memory and CPU usage) but a fair trade for watchable video content.
ItsAnArse says
Thank you very much for this, exactly what I needed on my Haswell-based laptop running bunsenlabs. Cheers
Allen says
Just thought i would chime in. This works great on Arco Linux!, thanks for the share.
Richi Amaro says
Thanks the config file in /etc/X11/xorg.conf.d/20-intel.conf works great on fedora 28 in a dell inspiron 5000 series.
J says
Thanks!
Rainer Halstenbach says
Thank you VERY MUCH for that superb little help. I had exactly these kind of problems with my new Acer Swift5, where i replaced the pre-installed Windows10 by an Ubuntu Mate. This X setting helped me out (the Option "TearFree" already did the job".