[cogl/cogl-1.18] glx: Precisely wait for the next vblank
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.18] glx: Precisely wait for the next vblank
- Date: Wed, 4 Feb 2015 19:39:25 +0000 (UTC)
commit 5ccd2825c724267d066c4e93190a4bec1ae0ced0
Author: Chris Wilson <chris chris-wilson co uk>
Date: Fri Jan 30 00:16:16 2015 +0000
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>
cogl/winsys/cogl-winsys-glx.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 0487b79..34fb071 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]