xf86-video-intel: 2 commits - src/sna/sna_display.c src/sna/sna_display_fake.c tools/virtual.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Nov 26 00:54:03 PST 2013


 src/sna/sna_display.c      |    2 -
 src/sna/sna_display_fake.c |    2 -
 tools/virtual.c            |   81 ++++++++++++++++++++++++---------------------
 3 files changed, 46 insertions(+), 39 deletions(-)

New commits:
commit 63a964d6d0cb0e4ffce70d8e1b672dd65fae6703
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Nov 26 08:52:39 2013 +0000

    intel-virtual-output: Correct clip region of rotated outputs in source framebuffer
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index 4e1eca4..f3259fd 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -736,6 +736,34 @@ static void init_image(struct clone *clone)
 	assert(ret);
 }
 
+static int mode_height(const XRRModeInfo *mode, Rotation rotation)
+{
+	switch (rotation & 0xf) {
+	case RR_Rotate_0:
+	case RR_Rotate_180:
+		return mode->height;
+	case RR_Rotate_90:
+	case RR_Rotate_270:
+		return mode->width;
+	default:
+		return 0;
+	}
+}
+
+static int mode_width(const XRRModeInfo *mode, Rotation rotation)
+{
+	switch (rotation & 0xf) {
+	case RR_Rotate_0:
+	case RR_Rotate_180:
+		return mode->width;
+	case RR_Rotate_90:
+	case RR_Rotate_270:
+		return mode->height;
+	default:
+		return 0;
+	}
+}
+
 static void output_init_xfer(struct clone *clone, struct output *output)
 {
 	if (output->use_shm_pixmap) {
@@ -775,6 +803,8 @@ static void output_init_xfer(struct clone *clone, struct output *output)
 
 static int clone_init_xfer(struct clone *clone)
 {
+	int width, height;
+
 	if (clone->src.mode.id == 0) {
 		if (clone->width == 0 && clone->height == 0)
 			return 0;
@@ -792,24 +822,29 @@ static int clone_init_xfer(struct clone *clone)
 			clone->shm.shmaddr = 0;
 		}
 
+		clone->damaged.x2 = clone->damaged.y2 = INT_MIN;
+		clone->damaged.x1 = clone->damaged.y1 = INT_MAX;
 		return 0;
 	}
 
-	if (clone->src.mode.width == clone->width &&
-	    clone->src.mode.height == clone->height)
+	width = mode_width(&clone->src.mode, clone->src.rotation);
+	height = mode_height(&clone->src.mode, clone->src.rotation);
+
+	if (width == clone->width && height == clone->height)
 		return 0;
 
-	DBG(("%s-%s create xfer\n",
-	     DisplayString(clone->dst.dpy), clone->dst.name));
+	DBG(("%s-%s create xfer, %dx%d\n",
+	     DisplayString(clone->dst.dpy), clone->dst.name,
+	     width, height));
 
-	clone->width = clone->src.mode.width;
-	clone->height = clone->src.mode.height;
+	clone->width = width;
+	clone->height = height;
 
 	if (clone->shm.shmaddr)
 		shmdt(clone->shm.shmaddr);
 
 	clone->shm.shmid = shmget(IPC_PRIVATE,
-				  clone->height * stride_for_depth(clone->width, clone->depth),
+				  height * stride_for_depth(width, clone->depth),
 				  IPC_CREAT | 0666);
 	if (clone->shm.shmid == -1)
 		return errno;
@@ -841,9 +876,9 @@ static int clone_init_xfer(struct clone *clone)
 	output_init_xfer(clone, &clone->dst);
 
 	clone->damaged.x1 = clone->src.x;
-	clone->damaged.x2 = clone->src.x + clone->width;
+	clone->damaged.x2 = clone->src.x + width;
 	clone->damaged.y1 = clone->src.y;
-	clone->damaged.y2 = clone->src.y + clone->height;
+	clone->damaged.y2 = clone->src.y + height;
 
 	display_mark_flush(clone->dst.display);
 	return 0;
@@ -861,34 +896,6 @@ static void clone_update(struct clone *clone)
 	clone->rr_update = 0;
 }
 
-static int mode_height(const XRRModeInfo *mode, Rotation rotation)
-{
-	switch (rotation & 0xf) {
-	case RR_Rotate_0:
-	case RR_Rotate_180:
-		return mode->height;
-	case RR_Rotate_90:
-	case RR_Rotate_270:
-		return mode->width;
-	default:
-		return 0;
-	}
-}
-
-static int mode_width(const XRRModeInfo *mode, Rotation rotation)
-{
-	switch (rotation & 0xf) {
-	case RR_Rotate_0:
-	case RR_Rotate_180:
-		return mode->width;
-	case RR_Rotate_90:
-	case RR_Rotate_270:
-		return mode->height;
-	default:
-		return 0;
-	}
-}
-
 static int context_update(struct context *ctx)
 {
 	Display *dpy = ctx->display->dpy;
commit 13f3b24babba61e4d8b10661accc032169f04645
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 25 18:56:49 2013 +0000

    sna: Correct plurization of axis for modesetting log message
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 165b9e9..7a92fb8 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1490,7 +1490,7 @@ static const char *reflection_to_str(Rotation rotation)
 	case 0: return "none";
 	case RR_Reflect_X: return "X axis";
 	case RR_Reflect_Y: return "Y axis";
-	case RR_Reflect_X | RR_Reflect_Y: return "X and Y axis";
+	case RR_Reflect_X | RR_Reflect_Y: return "X and Y axes";
 	default: return "invalid";
 	}
 }
diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c
index cecedaa..c709d99 100644
--- a/src/sna/sna_display_fake.c
+++ b/src/sna/sna_display_fake.c
@@ -75,7 +75,7 @@ static const char *reflection_to_str(Rotation rotation)
 	case 0: return "none";
 	case RR_Reflect_X: return "X axis";
 	case RR_Reflect_Y: return "Y axis";
-	case RR_Reflect_X | RR_Reflect_Y: return "X and Y axis";
+	case RR_Reflect_X | RR_Reflect_Y: return "X and Y axes";
 	default: return "invalid";
 	}
 }


More information about the xorg-commit mailing list