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

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 5 14:31:49 PDT 2013


 tools/virtual.c |   33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

New commits:
commit 2263f8f26fb3c4fabceac2e192e95c5d26a4d173
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 5 21:55:49 2013 +0100

    intel-virtual-overlay: Reset damage across modesets
    
    Some versions of the Xserver lose Damage tracking across the modeset,
    causing a loss of damage notifications and repainting to cease on the
    virtual outputs. We can workaround this by reattaching the damage every
    time we receive notification that the local Screen configuration
    changes.
    
    Reported-and-tested-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 257f37f..4da2f3a 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1760,9 +1760,22 @@ static int display_init_damage(struct display *display)
 	if (display->damage == 0)
 		return EACCES;
 
+	display->flush = 1;
 	return 0;
 }
 
+static void display_reset_damage(struct display *display)
+{
+	Damage damage;
+
+	damage = XDamageCreate(display->dpy, display->root, XDamageReportRawRectangles);
+	if (damage) {
+		XDamageDestroy(display->dpy, display->damage);
+		display->damage = damage;
+		display->flush = 1;
+	}
+}
+
 static void display_init_randr_hpd(struct display *display)
 {
 	int major, minor;
@@ -2632,8 +2645,10 @@ int main(int argc, char **argv)
 			ret--;
 		}
 
-		if (reconfigure)
+		if (reconfigure) {
 			context_update(&ctx);
+			display_reset_damage(ctx.display);
+		}
 
 		if (rr_update) {
 			for (i = 0; i < ctx.nclone; i++)
commit 5dea07c31d4d57d8d9aff68f2a9ffd73e828643f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 5 21:25:00 2013 +0100

    intel-virtual-output: Reset the damage just prior to reading it back
    
    Slightly more efficient command packing and reduces a damage race
    slightly...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index b5959e1..257f37f 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2648,15 +2648,15 @@ int main(int argc, char **argv)
 			DBG(("%s timer expired (count=%ld)\n", DisplayString(ctx.display->dpy), (long)count));
 			ret = 0;
 
-			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 (clone = ctx.active; clone; clone = clone->active)
+				ret |= clone_paint(clone);
+
 			for (i = 0; i < ctx.ndisplay; i++)
 				display_flush(&ctx.display[i]);
 
commit bae41624874fa032c407f4888e7db9a07f8f1d0c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 5 21:23:56 2013 +0100

    intel-virtual-output: We don't need to enable the timer for reconfigure
    
    The timer will be enabled if a reconfiguration actually takes place and
    we mark the damaged region to be redrawn.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index 23157d5..b5959e1 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2579,7 +2579,6 @@ int main(int argc, char **argv)
 					DBG(("%s screen changed (reconfigure pending? %d)\n",
 					     DisplayString(ctx.display->dpy), reconfigure));
 					reconfigure = 1;
-					context_enable_timer(&ctx);
 				} else if (e.type == PropertyNotify) {
 					XPropertyEvent *pe = (XPropertyEvent *)&e;
 					if (pe->atom == ctx.singleton) {
commit d9a48bd0a3cd3ca99b29a4038ea16a87771bfe31
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 5 20:52:11 2013 +0100

    intel-virtual-output: Just walk the list of clones attached to the display
    
    Rather searching the entire array of all clones, just walk the presorted
    list from the display.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index e8155b4..23157d5 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2620,12 +2620,11 @@ int main(int argc, char **argv)
 					XRRNotifyEvent *re = (XRRNotifyEvent *)&e;
 					if (re->subtype == RRNotify_OutputChange) {
 						XRROutputPropertyNotifyEvent *ro = (XRROutputPropertyNotifyEvent *)re;
-						int j;
+						struct clone *clone;
 
-						for (j = 0; j < ctx.nclone; j++) {
-							if (ctx.clones[j].dst.display == &ctx.display[i] &&
-							    ctx.clones[j].dst.rr_output == ro->output)
-								rr_update = ctx.clones[j].rr_update = 1;
+						for (clone = ctx.display[i].clone; clone; clone = clone->next) {
+							if (clone->dst.rr_output == ro->output)
+								rr_update = clone->rr_update = 1;
 						}
 					}
 				}


More information about the xorg-commit mailing list