From 12de799598ffbbe056bd4455efefa62d4b081d98 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Sep 2013 19:36:13 +0100 Subject: [PATCH] intel-virtual-output: Flush the damage received message back to the local display After processing the Damage notification, we need to send a message back to the Xserver to clear the pending damage before we will be sent more events. To make sure that message is sent we need to flush the output, as we may never flush the output queue otherwise. Reported-by: Severin Strobl Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987 Signed-off-by: Chris Wilson --- tools/virtual.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/virtual.c b/tools/virtual.c index de4287a0..a5fb36eb 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -2608,8 +2608,11 @@ int main(int argc, char **argv) } } while (XPending(ctx.display->dpy) || poll(&ctx.pfd[1], 1, 0) > 0); - if (damaged) + if (damaged) { + DBG(("%s clearing damage (after %d events)\n", DisplayString(ctx.display->dpy), damaged)); XDamageSubtract(ctx.display->dpy, ctx.display->damage, None, None); + ctx.display->flush = 1; + } ret--; } @@ -2662,6 +2665,7 @@ int main(int argc, char **argv) for (i = 0; i < ctx.ndisplay; i++) display_flush(&ctx.display[i]); + DBG(("%s timer still active? %d\n", DisplayString(ctx.display->dpy), ret != 0)); ctx.timer_active = ret != 0; } }