dri3: Fix dri3_wait_for_sbc to wait for completion of requested SBC
authorKeith Packard <keithp@keithp.com>
Tue, 26 Nov 2013 05:21:40 +0000 (21:21 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 31 Jan 2014 00:38:36 +0000 (16:38 -0800)
commit1525474eadf5ca000162e05b99d591998d1ed3f6
tree8fe4b4584acc50e078184a96983c4f5cc7d22673
parent71d614250ed1f83d8da3adb8e855ee00201c70da
dri3: Fix dri3_wait_for_sbc to wait for completion of requested SBC

Eric figured out that glXWaitForSbcOML wanted to block until the requested
SBC had been completed, which means to wait until the
PresentCompleteNotify event for that SBC had been received.

This replaces the simple sleep(1) loop (which was bogus) with a loop that
just checks to see if we've seen the specified SBC value come back in a
PresentCompleteNotify event yet.

The change is a bit larger than that as I've broken out a piece of common
code to wait for and process a single Present event for the target
drawable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glx/dri3_glx.c