How do I wait for vertical retrace?

Glynn Clements glynn at
Tue May 6 18:59:25 PDT 2008

Carsten Haitzler (The Rasterman) wrote:

> so this is how to do it. as such we really could do with a standard 2d vsync
> signal from x that is reliable and works the vast majority of the time and
> doesn't involve anyone sitting and polling/spinning. :) i can dream... :)

A "signal" implies a reverse round-trip (i.e. the server notifies the
client at the start of the vertical blank, and the client has to get
the response back to the server before the blanking period is over),
which is undesirable, particularly for non-local clients.

In most cases, it would be better to have a mechanism to tell the
server to delay execution until the beginning of the next blanking
interval. Actually, delaying execution until the refresh passes a
certain scan line (i.e. the bottom of the modified region) would be
better, as that allows more time.

Glynn Clements <glynn at>

More information about the xorg mailing list