summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-01-30 00:16:16 +0000
committerRobert Bragg <robert.bragg@intel.com>2015-02-04 19:31:40 +0000
commit5ccd2825c724267d066c4e93190a4bec1ae0ced0 (patch)
tree37563ddacd5bdd50c117f03b67bb1a6ba8720ddd
parentb9640c091f96cef0ad991785297a9290435464ca (diff)
glx: Precisely wait for the next vblank
Currently the code queries the current msc then tries to approximate the value of the next msc satisfing the modulus 2 for when to wait. This introduces some instability as the msc may tick over during the roundtrip leading to a 32ms wait instead of a 16ms wait. This happens often enough to cause jerky animations, and affect gnome-shell-perf-tool. A simpler solution is just use a single roundtrip by using WaitForMsc to ask the driver to compute the next vblank itself. Cc: Owen W. Taylor <otaylor@fishsoup.net> Cc: Robert Bragg <robert@linux.intel.com> Reviewed-by: Robert Bragg <robert@sixbynine.org>
-rw-r--r--cogl/winsys/cogl-winsys-glx.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 0487b79f..34fb0711 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -1626,10 +1626,8 @@ _cogl_winsys_wait_for_vblank (CoglOnscreen *onscreen)
int64_t msc;
int64_t sbc;
- glx_renderer->glXGetSyncValues (xlib_renderer->xdpy, drawable,
- &ust, &msc, &sbc);
glx_renderer->glXWaitForMsc (xlib_renderer->xdpy, drawable,
- 0, 2, (msc + 1) % 2,
+ 0, 1, 0,
&ust, &msc, &sbc);
info->presentation_time = ust_to_nanoseconds (ctx->display->renderer,
drawable,