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

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

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

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 



X11 SYNC documentation:


More information about the xorg mailing list