summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-08 12:46:08 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-08 12:46:58 +0000
commite0075ccee2e7bbe46ecbf717817d468cc9248cc4 (patch)
tree1e45ed6d5fd488ea9322e11ea2f0dcbb9e567755 /tools
parentea4f99c333b181eb21012b5bee60251695e93c8b (diff)
intel-virtual-output: Check for pending events before skipping draw
Make sure we check if the destination display has caught up before skipping a frame. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtual.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index 226f86d4..71d18f5a 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -260,6 +260,8 @@ can_use_shm(Display *dpy,
if (codes) {
XShmCompletionEvent e;
+ memset(&e, 0, sizeof(e));
+
e.type = codes->first_event;
e.send_event = 1;
e.serial = 1;
@@ -1353,8 +1355,13 @@ static int clone_paint(struct clone *c)
DBG(("%s-%s is damaged, last SHM serial: %ld, now %ld\n",
DisplayString(c->dst.dpy), c->dst.name,
(long)c->dst.serial, (long)LastKnownRequestProcessed(c->dst.dpy)));
- if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy))
- return EAGAIN;
+ if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) {
+ while (XPending(c->dst.dpy))
+ ;
+
+ if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy))
+ return EAGAIN;
+ }
if (FORCE_FULL_REDRAW) {
c->damaged.x1 = c->src.x;
@@ -2326,14 +2333,12 @@ static void display_flush_send(struct display *display)
return;
}
+ memset(&e, 0, sizeof(e));
e.type = display->shm_event;
e.send_event = 1;
- e.serial = 0;
e.drawable = display->root;
e.major_code = display->shm_opcode;
e.minor_code = X_ShmPutImage;
- e.shmseg = 0;
- e.offset = 0;
XSendEvent(display->dpy, display->root, False, 0, (XEvent *)&e);
display_mark_flush(display);