xf86-video-intel: 2 commits - tools/virtual.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 5 11:48:19 PDT 2013


 tools/virtual.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit b57dfc53312d9d7f30bfe45af44036b4c3c03790
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 5 19:40:07 2013 +0100

    intel-virtual-output: Defer reenabling damage events until after we draw
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index a5fb36e..e8155b4 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2544,8 +2544,6 @@ int main(int argc, char **argv)
 
 		DBG(("poll reports %d fd awake\n", ret));
 		if (ctx.pfd[1].revents) {
-			int damaged = 0;
-
 			DBG(("%s woken up\n", DisplayString(ctx.display[0].dpy)));
 			do {
 				XNextEvent(ctx.display->dpy, &e);
@@ -2563,8 +2561,6 @@ int main(int argc, char **argv)
 
 					if (ctx.active)
 						context_enable_timer(&ctx);
-
-					damaged++;
 				} else if (e.type == ctx.display->xfixes_event + XFixesCursorNotify) {
 					XFixesCursorImage *cur;
 
@@ -2608,11 +2604,6 @@ int main(int argc, char **argv)
 				}
 			} while (XPending(ctx.display->dpy) || poll(&ctx.pfd[1], 1, 0) > 0);
 
-			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 +2653,12 @@ int main(int argc, char **argv)
 			for (clone = ctx.active; clone; clone = clone->active)
 				ret |= clone_paint(clone);
 
+			if (ctx.active) {
+				DBG(("%s clearing damage\n", DisplayString(ctx.display->dpy)));
+				XDamageSubtract(ctx.display->dpy, ctx.display->damage, None, None);
+				ctx.display->flush = 1;
+			}
+
 			for (i = 0; i < ctx.ndisplay; i++)
 				display_flush(&ctx.display[i]);
 
commit 12de799598ffbbe056bd4455efefa62d4b081d98
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 5 19:36:13 2013 +0100

    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 <fd at severin-strobl.de>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index de4287a..a5fb36e 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;
 		}
 	}


More information about the xorg-commit mailing list