Comment 102 for bug 755841

Revision history for this message
In , Da-fox (da-fox) wrote :

(In reply to comment #58)
> (In reply to comment #55)
> > With compositing enabled, I guess there is not much to do - the problem happens
> > due to the nature of compositing itself. When it is used, the windows do not
> > render directly to screen, but to an off-screen area. So the vsync is not
> > helpful in any case - the off-screen does not synchronizes itself with it. Such
> > tearing is not Intel-specific, it also happens on nvidia
> > (http://www.nvnews.net/vbulletin/showthread.php?t=149276,
> > http://nvnews.net/vbulletin/showthread.php?t=149776), and there is a nice
> > description at https://bugzilla.gnome.org/show_bug.cgi?id=562669 as well.
>
> In such cirumstances,the compositor uses CopySubBuffer which is meant to be
> vsync'ed.The caveat is that it is implemented inside an Xserver using a
> function that is not specified to be either synchronous or asynchronous
> (DRI2CopyRegion), and that same function is also used in a performance
> sensitive path (vblank_mode=0!). For UXA, we actually do enable vsync so that
> the compositor does not tear. I proposed
> http://cgit.freedesktop.org/~ickle/xserver/commit/?id=9e92c256853fa29bddd27e41fdd24e0b140e7fd4
> to disambiguate that case and to permit even faster vblank_mode=0 swapping.

I heard about that for full-screen opengl something called 'page flipping' is used, which is able to provide vsync on sandybridge (this is the work around with "mplayer -vo gl" discussed above).

Q:
Is there a way to modify the xrender compositor(s) so that it ensures that
1) rendering to the offscreen area is complete before calling CopySubBuffer (or equivalent), e.g. by using double buffering,
2) calling some equivalent of CopySubBuffer which can do page flipping for 2d xrender calls. I.e. the goal is to get the 2d xrender case to also use page flipping.

I don't know to what extend this is the same as the idea that was proposed a few months back (which I also tried to discuss with the xfce developers, see http://mail.xfce.org/pipermail/xfce4-dev/2011-September/029051.html), and if it is now possible to implement any of this yet? (I think the idea there was to implement a vsync-wait call to xrender?)