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

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 28 23:30:33 PDT 2014


 src/sna/sna_accel.c |   32 ++++++++++++++++++--------------
 tools/virtual.c     |    6 ++----
 2 files changed, 20 insertions(+), 18 deletions(-)

New commits:
commit 69d584c6acdcd645ee4cc4892e56940d2d4074f6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 29 07:26:32 2014 +0100

    sna: Prepare fr changes in dirty tracking api (Prime)
    
    Future commit "pixmap: fix reverse optimus support with multiple heads"
    will allow for tracking within pixmaps (i.e. break the presumption that
    everything starts at offset 0,0 in the target pixmap).
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9282210..68e2de6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -17225,6 +17225,7 @@ static void sna_accel_post_damage(struct sna *sna)
 		RegionRec region, *damage;
 		PixmapPtr src, dst;
 		const BoxRec *box;
+		int16_t dx, dy;
 		int n;
 
 		assert(dirty->src == sna->front);
@@ -17254,7 +17255,13 @@ static void sna_accel_post_damage(struct sna *sna)
 		if (RegionNil(&region))
 			goto skip;
 
-		RegionTranslate(&region, -dirty->x, -dirty->y);
+		dx = -dirty->x;
+		dy = -dirty->y;
+#if HAS_DIRTYTRACKING2
+		dx += dirty->dst_x;
+		dy += dirty->dst_y;
+#endif
+		RegionTranslate(&region, dx, dy);
 		DamageRegionAppend(&dirty->slave_dst->drawable, &region);
 
 		DBG(("%s: slave:  ((%d, %d), (%d, %d))x%d\n", __FUNCTION__,
@@ -17277,17 +17284,17 @@ fallback:
 				do {
 					DBG(("%s: copy box (%d, %d)->(%d, %d)x(%d, %d)\n",
 					     __FUNCTION__,
-					     box->x1 + dirty->x, box->y1 + dirty->y,
+					     box->x1 - dx, box->y1 - dy,
 					     box->x1, box->y1,
 					     box->x2 - box->x1, box->y2 - box->y1));
 
 					assert(box->x2 > box->x1);
 					assert(box->y2 > box->y1);
 
-					assert(box->x1 + dirty->x >= 0);
-					assert(box->y1 + dirty->y >= 0);
-					assert(box->x2 + dirty->x <= src->drawable.width);
-					assert(box->y2 + dirty->y <= src->drawable.height);
+					assert(box->x1 - dx >= 0);
+					assert(box->y1 - dy >= 0);
+					assert(box->x2 - dx <= src->drawable.width);
+					assert(box->y2 - dy <= src->drawable.height);
 
 					assert(box->x1 >= 0);
 					assert(box->y1 >= 0);
@@ -17302,12 +17309,9 @@ fallback:
 						   dst->devPrivate.ptr,
 						   src->drawable.bitsPerPixel,
 						   src->devKind, dst->devKind,
-						   box->x1 + dirty->x,
-						   box->y1 + dirty->y,
-						   box->x1,
-						   box->y1,
-						   box->x2 - box->x1,
-						   box->y2 - box->y1);
+						   box->x1 - dx,      box->y1 - dy,
+						   box->x1,           box->y1,
+						   box->x2 - box->x1, box->y2 - box->y1);
 					box++;
 				} while (--n);
 				sigtrap_put();
@@ -17320,8 +17324,8 @@ fallback:
 				goto fallback;
 
 			if (!sna->render.copy_boxes(sna, GXcopy,
-						    &src->drawable, __sna_pixmap_get_bo(src), dirty->x, dirty->y,
-						    &dst->drawable, __sna_pixmap_get_bo(dst),0, 0,
+						    &src->drawable, __sna_pixmap_get_bo(src), -dx, -dy,
+						    &dst->drawable, __sna_pixmap_get_bo(dst),   0,   0,
 						    box, n, COPY_LAST))
 				goto fallback;
 
commit f95d04b75b71ad523eb3e0e3fc9ad711c58ab43b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Aug 27 10:05:07 2014 +0100

    intel-virtual-output: Use snprintf() for simplicity
    
    Third one-line patch to fix copying from the tainted user argument into
    the socket's path buffer. This time, give in and just use snprintf() as
    it guarrantees that it will not write more than 'n' characters and that
    the last is a NUL byte.
    
    Suggested-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index b51c81a..d16a55f 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2387,10 +2387,8 @@ static int bumblebee_open(struct context *ctx)
 	}
 
 	addr.sun_family = AF_UNIX;
-	strncpy(addr.sun_path,
-		optarg && *optarg ? optarg : "/var/run/bumblebee.socket",
-		sizeof(addr.sun_path)-1);
-	addr.sun_path[sizeof(addr.sun_path)-1] = '\0';
+	snprintf(addr.sun_path, sizeof(addr.sun_path), "%s",
+		 optarg && *optarg ? optarg : "/var/run/bumblebee.socket");
 	if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
 		DBG(X11, ("%s unable to create a socket: %d\n", __func__, errno));
 		goto err;


More information about the xorg-commit mailing list