RFC Proposal an X11 SYNC counter for each RANDR CRTC
Jesse Barnes
jbarnes at virtuousgeek.org
Sat Mar 31 11:02:50 PDT 2007
On Saturday, March 31, 2007, Antony Lesuisse wrote:
> 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-82fa6a
>cdc11d372b6a09f15d382a9ba74263245d
> 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
I posted this patch awhile back to tie the DRM vblank interrupt support
into the X server's xsync code:
http://lists.freedesktop.org/archives/xorg/2006-March/013717.html
The main open question was how to deal with multiple screens. I ran out of
time to work on it, otherwise it might be upstream by now. I might have
time to pick it up again soon, but feel free to beat me to it.
Jesse
More information about the xorg
mailing list