How do I wait for vertical retrace?

Eirik Byrkjeflot Anonsen eirik at
Tue May 6 04:58:59 PDT 2008

"Johan Walles" <johan.walles at> writes:

> 2008/5/6 Michel Dänzer <michel at>:
>>  I think the standard technique for double buffering is to use a pixmap
>>  as the 'back buffer'.
> How would that help achieving flicker-free animation if it doesn't
> wait for vertical retrace?

As long as you don't imply "without tearing" when you say
"flicker-free", it works perfectly.

At least one way to use these words is that "flicker-free" only refers
to the problem where you draw the content of a window by first drawing
the background, then drawing something on top of it then maybe
something else on top of that.  The "flicker" refers to seeing an
incompletely drawn image for a short while until all the drawing
commands have completed.  Obviously this sort of flicker is eliminated
by drawing everything to an offscreen pixmap and only copying that
pixmap to the window when it is completely drawn.

However, that does not solve tearing problems nor judder problems.
("tearing" being that the window content is changed halfway through
being drawn on screen, thus having the old content in the top half of
the screen and the new content in the bottom half.  "judder" would
refer to the images being displayed on screen at the wrong time for
any number of reasons.  In this case, each frame by itself looks good,
but smooth motions are not smooth anymore.)

I'm sure other people use these words to mean different things, though :)


More information about the xorg mailing list