summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-09-02 21:53:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-02 21:54:42 +0100
commitc8dc27e00ef052c585abaa27c09f564c1548c87b (patch)
tree543f421acc254e24d1604ccca91f05eae1ab0cbf
parentd3558251777ab71b2a505d7acb2edd35d05b0d58 (diff)
intel-virtual-overlay: Disable the timer after flushing
As the flush may queue work that causes the timer to be reactivated prior to draining the queue, we need to flush first then turn off the timer if idle. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tools/virtual.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index 67591356..ec83701d 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2527,12 +2527,14 @@ int main(int argc, char **argv)
if (ctx.timer_active && read(ctx.timer, &count, sizeof(count)) > 0 && count > 0) {
DBG(("%s timer expired (count=%ld)\n", DisplayString(ctx.display->dpy), (long)count));
ret = 0;
+
for (i = 0; i < ctx.nclone; i++)
ret |= clone_paint(&ctx.clones[i]);
- ctx.timer_active = ret != 0;
for (i = 0; i < ctx.ndisplay; i++)
display_flush(&ctx.display[i]);
+
+ ctx.timer_active = ret != 0;
}
XPending(ctx.record);