#18316 closed enhancement (fixed)
Backporting TearFree option in Xorg-server-21.1.8
Reported by: | Rahul Chandra | Owned by: | Douglas R. Reno |
---|---|---|---|
Priority: | normal | Milestone: | 12.0 |
Component: | BOOK | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by ) ¶
With the removal of the xf86-video-* the TearFree option no longer works for any graphics driver. This has been solved in Xorg master with the addition of a TearFree option in the modesetting driver.
Relevant Commits:
I have backported a patch that builds and works in runtime. Both the patch for the book and the patch to xorg server are attached.
Change History (17)
by , 21 months ago
Attachment: | xorg-tearfree.patch added |
---|
by , 21 months ago
Attachment: | xorg-server-21.1.8-tearfree-backport.patch added |
---|
comment:1 by , 21 months ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 21 months ago
comment:3 by , 21 months ago
Replying to Bruce Dubbs:
Checking https://www.x.org/archive//individual/xserver/?C=M;O=D, the most recent release was March 29 and the one before that was February 7. I wonder how long it will be before the next release.
The "problem" is even if they release a 21.1.9 there will be still no tearfree. I guess tearfree will only show up in 21.2 or 22.0.
comment:4 by , 21 months ago
Description: | modified (diff) |
---|
Yeah, Gitlab master for xwayland is still very active, but xorg-server has had barely any activity. Let's hope for a release before the package freeze for 12.0. I saw a bunch of new functions and a lot of reorganization when I went to backport the patch, so hopefully they'll release 21.2/22.0 soon...
comment:5 by , 21 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 21 months ago
I tried the patch and it applied fine, but the build failed:
../present/present.c:160:43: error: ‘PresentAllAsyncOptions’ undeclared (first use in this function); did you mean ‘PresentAllOptions’? 160 | const Bool synced_flip = !(options & PresentAllAsyncOptions); | ^~~~~~~~~~~~~~~~~~~~~~ | PresentAllOptions
comment:7 by , 21 months ago
Weird, I can't seem to reproduce on any of my systems. But at first glance, it seems like nothing in the patch would affect 'PresentAllAsyncOptions' as it's defined in xorgproto, not xorg-server. And PresentAllAsyncOptions is still in present/present.c even before the patch is applied. Upon further inspection, it seems like that function was first introduced in xorgproto 2023.2. And in the current release (11.3) we are using xorgproto 2022.2, but on the development branch we are using 2023.2 which does have the function. Could you try updating/recompiling xorgproto?
comment:8 by , 21 months ago
Yes, that was it. I was building on a system that was not quite up-to date.
Do you have any suggestions for testing?
comment:9 by , 21 months ago
To test the TearFree option you have to edit the device-specific configuration within xorg. I could only reproduce the tearing on bare-metal though cause it seems like QEMU has an in built sync with the cirrus vga adapter
First build a non-composited Desktop Environment or Window Manager (twm, icewm, openbox, or Xfce4 with the display compositor turned off in settings. Then log in and open a window, then move it around, if the system has problems with tearing you will see that the border of the window will not be a straight line while in motion. Alternatively use this test, https://www.youtube.com/watch?v=MfL_JkcEFbE Once you have confirmed that the system is tearing you can move on to trying to modify the config file
On Intel GPU's,
cat > /usr/share/X11/xorg.conf.d/20-amdgpu.conf << "EOF" Section "Device" Identifier "Intel Graphics" Driver "modesetting" Option "TearFree" "true" EndSection EOF
On AMD Graphics Cards
cat > /usr/share/X11/xorg.conf.d/20-intel.conf << "EOF" Section "OutputClass" Identifier "AMD" MatchDriver "modesetting" Option "TearFree" "true" Driver "modesetting" EndSection EOF
Restart Xorg and confirm that the tearing problem has been resolved either using the test or moving around the window
comment:10 by , 21 months ago
I had already rebuilt xorg-server with the patch. My video card is Radeon RX 550 and I'm already using the modesetting driver.
I tested with both twm and openbox with Option "TearFree" both true and false, but could not tell the difference. As a note, I don't think twm is a good choice for the testing because dragging a window just drags the outline.
comment:11 by , 21 months ago
Sorry, I accidentally read out the wrong files. The modesetting driver doesn't want the Identifier line to be the name of a GPU.
This should work for any GPU,
cat > /usr/share/X11/xorg.conf.d/20-amdgpu.conf << "EOF" Section "Device" Identifier "Graphics Adapter" Driver "modesetting" Option "TearFree" "true" EndSection EOF
comment:12 by , 21 months ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thank you for the patch! Fixed at a1ea6d4e942bc3f2b98e361e16b05494ae4e0737
comment:13 by , 21 months ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Reopening because we'd better add a Xorg configuration example to enable TearFree.
comment:14 by , 21 months ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Added a section on configuring Tearfree in 810935e2b5ecc28d2d64cf13745ad884e490811f
Checking https://www.x.org/archive//individual/xserver/?C=M;O=D, the most recent release was March 29 and the one before that was February 7. I wonder how long it will be before the next release.