intel-virtual-output: Avoid the infinite loop around XPending
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Nov 2013 10:47:24 +0000 (10:47 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Nov 2013 10:49:10 +0000 (10:49 +0000)
XPending() reports if there are any events pending and does not perform
any dequeuing itself - ergo for a remote display while (XPending()) ;
becomes an infinite loop should there be an event pending.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71345
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
tools/virtual.c

index 48fe347..4da8309 100644 (file)
@@ -1357,9 +1357,7 @@ static int clone_paint(struct clone *c)
             DisplayString(c->dst.dpy), c->dst.name,
             (long)c->dst.serial, (long)LastKnownRequestProcessed(c->dst.dpy)));
        if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) {
-               while (XPending(c->dst.dpy))
-                       ;
-
+               XPending(c->dst.dpy);
                if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) {
                        c->dst.display->skip_clone++;
                        return EAGAIN;