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

Chris Wilson ickle at kemper.freedesktop.org
Fri Nov 8 15:04:53 CET 2013


 tools/virtual.c |   52 ++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 36 insertions(+), 16 deletions(-)

New commits:
commit b46d0d327140a1b17066e473d6d61798ffb9871a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Nov 8 14:04:32 2013 +0000

    intel-virtual-output: Fix forced synchronisation of clones
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index 8049d2f..beff3d6 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -111,6 +111,8 @@ struct display {
 
 	int flush;
 	int send;
+	int skip_clone;
+	int skip_frame;
 };
 
 struct output {
@@ -1360,21 +1362,14 @@ static int clone_paint(struct clone *c)
 			;
 
 		if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) {
-			if (c->dst.display->send++ == 0)
-				return EAGAIN;
-
-			DBG(("%s-%s forcing sync (last SHM serial: %ld, now %ld)\n",
-			     DisplayString(c->dst.dpy), c->dst.name,
-			     (long)c->dst.serial, (long)LastKnownRequestProcessed(c->dst.dpy)));
-			XSync(c->dst.dpy, False);
-			c->dst.display->flush = 0;
-			c->dst.display->send = 0;
-
-			/* Event tracking proven unreliable, disable */
-			c->dst.display->shm_event = 0;
+			c->dst.display->skip_clone++;
+			return EAGAIN;
 		}
 	}
 
+	c->dst.display->skip_clone = 0;
+	c->dst.display->skip_frame = 0;
+
 	if (FORCE_FULL_REDRAW) {
 		c->damaged.x1 = c->src.x;
 		c->damaged.y1 = c->src.y;
@@ -2361,11 +2356,31 @@ static void display_flush_send(struct display *display)
 	display_mark_flush(display);
 }
 
+static void display_sync(struct display *display)
+{
+	if (display->skip_clone == 0)
+		return;
+
+	if (display->skip_frame++ < 2)
+		return;
+
+	DBG(("%s forcing sync\n", DisplayString(display->dpy)));
+	XSync(display->dpy, False);
+
+	display->flush = 0;
+	display->send = 0;
+
+	/* Event tracking proven unreliable, disable */
+	display->shm_event = 0;
+}
+
 static void display_flush(struct display *display)
 {
 	display_flush_cursor(display);
 	display_flush_send(display);
 
+	display_sync(display);
+
 	if (!display->flush)
 		return;
 
commit fa40286e2f12a4757d1b9bcbe1f1d7c5170bd7da
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Nov 8 13:53:48 2013 +0000

    intel-virtual-output: Tighten bad_visual() checks
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index b03a14d..8049d2f 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1475,24 +1475,29 @@ static int record_mouse(struct context *ctx)
 
 static int bad_visual(Visual *visual, int depth)
 {
-	DBG(("%s? depth=%d, visual: bits_per_rgb=%d, red_mask=%08x, green_mask=%08x, blue_mask=%08\n",
+	DBG(("%s? depth=%d, visual: class=%d, bits_per_rgb=%d, red_mask=%08x, green_mask=%08x, blue_mask=%08x\n",
 	     __func__, depth,
+	     visual->class,
 	     visual->bits_per_rgb,
 	     visual->red_mask,
 	     visual->green_mask,
 	     visual->blue_mask));
+
+	if (!(visual->class == TrueColor || visual->class == DirectColor))
+		return 1;
+
 	switch (depth) {
-	case 16: return (visual->bits_per_rgb != 6          ||
+	case 16: return (/* visual->bits_per_rgb != 6          || */
 			 visual->red_mask     != 0x1f << 11 ||
 			 visual->green_mask   != 0x3f << 5  ||
 			 visual->blue_mask    != 0x1f << 0);
 
-	case 24: return (visual->bits_per_rgb != 8          ||
+	case 24: return (/* visual->bits_per_rgb != 8          || */
 			 visual->red_mask     != 0xff << 16 ||
 			 visual->green_mask   != 0xff << 8  ||
 			 visual->blue_mask    != 0xff << 0);
 
-	default: return 0;
+	default: return 1;
 	}
 }
 


More information about the xorg-commit mailing list