! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Add support for DRI3/Present
Status:
RESOLVED: FIXED
Severity:
enhancement

Comments

Description Eric Koegel editbugs 2014-09-01 15:15:04 CEST
Present is a way to get new window content from a pixmap to the screen in a VBLANK-synchronized way. In other words, it can make xfwm4 tear-free.

There's a couple talks on it:
http://www.youtube.com/watch?v=nr02o8yvcr4 Zero-Copy Compositing — Research to Reality [linux.conf.au 2014]

http://www.x.org/videos/XDC2013/keith_packard_dri3.avi

As well as a couple articles/posts:
http://lwn.net/Articles/569701/
https://www.mail-archive.com/xorg-devel@lists.x.org/msg39495.html

The protocols are documented at:
http://cgit.freedesktop.org/xorg/proto/dri3proto/tree/dri3proto.txt
http://cgit.freedesktop.org/xorg/proto/presentproto/tree/presentproto.txt

Finally, there's some example code out there:
http://cgit.freedesktop.org/~ajax/xcm/
git://keithp.com/git/metacity.git
Comment 1 Alistair Buxton 2014-09-01 23:36:02 CEST
Way ahead of you.

https://github.com/ali1234/xfwm4/tree/present

This is based on Keith Packard's metacity patches (linked in previous comment.) Since metacity and Xfwm both use a compositor derived from XCompMgr, porting it over was trivial. It might be out of date now though, since I did it 7 months ago!
Comment 2 Alistair Buxton 2014-09-01 23:57:41 CEST
So the one thing I can't do with this is test if it actually solves tearing. If your X server supports Present but your DDX does not support DRI3 (eg because you use Nvidia) then Present works exactly like XRender, i.e. it tears.
Comment 3 Eric Koegel editbugs 2014-09-02 19:39:31 CEST
Looks like nouveau has DRI3 and initial Present support starting with 1.0.11.
http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/commit/?id=3cd4c8494c296c7583dfa7f0823a272c9e932e03
Comment 4 Eric Koegel editbugs 2014-12-03 17:25:48 CET
Since implementing this may cost money to buy hardware to test with, I've added a bounty on this bug: https://www.bountysource.com/issues/6655651-add-support-for-dri3-present
Comment 5 Yan Pas 2015-03-29 23:18:06 CEST
https://bugzilla.xfce.org/show_bug.cgi?id=11642 seems to be fixed in this issue. One little problem - you have to reactivate compositor after suspend, login and VT switching
Comment 6 Olivier Fourdan editbugs 2015-03-30 09:21:37 CEST
This is not necessarily incompatible with the implementation of bug 11642 so Present is still interesting for what we want - Keith's patches for metacity are of particular interest.
Comment 7 Yan Pas 2015-04-08 19:54:45 CEST
For those who use NVidia there is a solution, that fixes tearing in any compositor:

Generate /etc/X11/xorg.conf via sudo nvidia-xconfig

Write to /etc/X11/xorg.conf
Section "Device"
 Identifier     "Device0"
 Driver         "nvidia"
 Option "Metamodes" "HDMI-0: 1920x1080 { ForceCompositionPipeline = On }"
 VendorName     "NVIDIA Corporation"
EndSection

HDMI-0: 1920x1080 is for my configuration. If you configuration differs - edit this line

https://devtalk.nvidia.com/default/topic/823711/linux/tearing-add-frame-buffer-please/?offset=7#4503217

I'm sure AMD has something similar. Try Option "TrippleBuffer" "True" too.
Comment 8 Olivier Fourdan editbugs 2015-04-24 22:59:47 CEST
Experimental support for Present using double buffering has been added to git master.

Please note is seems some driver may claim Present support but don't actually wait for VSync, in which case tearing remains...
Comment 9 Yan Pas 2015-07-01 17:47:53 CEST
I think Olivier can grab Bounty from boutysource https://www.bountysource.com/issues/6655651-add-support-for-dri3-present/developers
Comment 10 Olivier Fourdan editbugs 2018-01-17 08:43:44 CET
*** Bug 14169 has been marked as a duplicate of this bug. ***

Bug #11126

Reported by:
Eric Koegel
Reported on: 2014-09-01
Last modified on: 2018-01-17
Duplicates (1):
  • 14169 Screen-Tearing when using xserver-Xorg-video-intel

People

Assignee:
Olivier Fourdan
CC List:
5 users

Version

Version:
unspecified

Attachments

Additional information