From 969b064f74e0058a49afa17287184005d1e11402 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 8 Nov 2013 12:54:01 +0000 Subject: [PATCH] intel-virtual-output: Perform an explicit sync If we fail to track rendering using ShmCompletionEvents and begin to drop frames, insert an explicit XSync. Signed-off-by: Chris Wilson --- tools/virtual.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/virtual.c b/tools/virtual.c index 71d18f5..74a03e8 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -1359,8 +1359,14 @@ static int clone_paint(struct clone *c) while (XPending(c->dst.dpy)) ; - if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) - return EAGAIN; + if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) { + if (c->dst.display->send++ == 0) + return EAGAIN; + + XSync(c->dst.dpy, False); + c->dst.display->flush = 0; + c->dst.display->send = 0; + } } if (FORCE_FULL_REDRAW) { -- 2.7.4