RFC Proposal an X11 SYNC counter for each RANDR CRTC

Antony Lesuisse al-lists at udev.org
Sat Mar 31 09:20:25 PDT 2007


Currently, there is now way for clients to know when the vertical retrace 
occurs. All video intensive applications such as games and video players 
suffer from awful tearing artefacts. It's amazing to imagine that simple 
graphical applications that could be done on a C64, such as blinking the 
screen at vsync rate, cannot be done under X11 in 2007 :).

RANDR 1.2 brings the concept of differents CRTC displaying parts of the root 
window. I think each CRTC should define an SYNC SystemCounters named 
CRTC0_VSYNC, CRTC1_VSYNC. That counter would be incremented twice a frame:

1 start of drawing frame 1
2 end of drawing frame 1, start of vblank
3 start of drawing frame 2
4 end of drawing frame 2, start of vblank
etc...

or just once a frame by 2:

2 end of drawing frame 1, start of vblank
4 end of drawing frame 2, start of vblank
etc...

Jim Gettys explained that SYNC extension had been designed for that.

The update of those counter could be enabled optionally (to save power when 
they are not needed) using an other system counter CRTC0_VSYNC_ENABLE that 
would be incremented by client when they need the counter and decremented when 
they don't need it anymore.

I made a simple test using the SYNC extention
http://antony.lesuisse.org/xorgsync/

xsync-clock: increment a counter at 60Hz (using usleep not very precise).
xsync-flip: fill a window alternatively in black and white waiting on that 
counter.

References:

http://wiki.x.org/wiki/Development/Documentation/Performance#head-82fa6acdc11d372b6a09f15d382a9ba74263245d
http://lists.freedesktop.org/archives/xorg/2005-July/008491.html
http://lists.x.org/archives/xorg-arch/2006-February/000438.html

X11 SYNC documentation:

http://lesstif.sourceforge.net/doc/super-ux/g1ae04e/chap9.html



More information about the xorg mailing list