xf86-video-intel: 2 commits - src/sna/gen2_render.c src/sna/gen3_render.c src/sna/gen4_render.c src/sna/gen5_render.c src/sna/gen6_render.c src/sna/gen7_render.c src/sna/gen8_render.c src/sna/sna_composite.c src/sna/sna.h src/sna/sna_render_inline.h src/sna/sna_trapezoids_boxes.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Sep 2 11:16:58 PDT 2014


 src/sna/gen2_render.c          |    4 +--
 src/sna/gen3_render.c          |    4 +--
 src/sna/gen4_render.c          |    4 +--
 src/sna/gen5_render.c          |    4 +--
 src/sna/gen6_render.c          |    4 +--
 src/sna/gen7_render.c          |    4 +--
 src/sna/gen8_render.c          |    4 +--
 src/sna/sna.h                  |    2 -
 src/sna/sna_composite.c        |    9 ++++----
 src/sna/sna_render_inline.h    |    5 ++++
 src/sna/sna_trapezoids_boxes.c |   42 ++++++++++++++++++++++++++++-------------
 11 files changed, 54 insertions(+), 32 deletions(-)

New commits:
commit 48a33fc379b17eed195875222ad773c911d9dff1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 2 19:08:36 2014 +0100

    sna/trapezoids: Use the corrected trapezoid origin for aligned boxes
    
    The rule for the origin of the CompositeTrapezoids routine is the
    upper-left corner of the first trapezoid. Care must be taken in case the
    trapezoid edge is upside down to consider the upper vertex.
    
    Reported-by: "Jasper St. Pierre" <jstpierre at mecheye.net>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids_boxes.c b/src/sna/sna_trapezoids_boxes.c
index 2f7028f..a2045dc 100644
--- a/src/sna/sna_trapezoids_boxes.c
+++ b/src/sna/sna_trapezoids_boxes.c
@@ -120,13 +120,16 @@ composite_aligned_boxes(struct sna *sna,
 	BoxRec stack_boxes[64], *boxes;
 	pixman_region16_t region, clip;
 	struct sna_composite_op tmp;
+	int16_t dst_x, dst_y;
 	bool ret = true;
 	int dx, dy, n, num_boxes;
 
 	if (NO_ALIGNED_BOXES)
 		return false;
 
-	DBG(("%s\n", __FUNCTION__));
+	DBG(("%s: pixmap=%ld, nboxes=%d, dx=(%d, %d)\n", __FUNCTION__,
+	    get_drawable_pixmap(dst->pDrawable)->drawable.serialNumber,
+	    ntrap, dst->pDrawable->x, dst->pDrawable->y));
 
 	boxes = stack_boxes;
 	if (ntrap > (int)ARRAY_SIZE(stack_boxes)) {
@@ -168,19 +171,20 @@ composite_aligned_boxes(struct sna *sna,
 	if (num_boxes == 0)
 		goto free_boxes;
 
-	DBG(("%s: extents (%d, %d), (%d, %d) offset of (%d, %d)\n",
+	trapezoid_origin(&traps[0].left, &dst_x, &dst_y);
+
+	DBG(("%s: extents (%d, %d), (%d, %d) offset of (%d, %d), origin (%d, %d)\n",
 	     __FUNCTION__,
 	     region.extents.x1, region.extents.y1,
 	     region.extents.x2, region.extents.y2,
 	     region.extents.x1 - boxes[0].x1,
-	     region.extents.y1 - boxes[0].y1));
-
-	src_x += region.extents.x1 - boxes[0].x1;
-	src_y += region.extents.y1 - boxes[0].y1;
+	     region.extents.y1 - boxes[0].y1,
+	     dst_x, dst_y));
 
 	if (!sna_compute_composite_region(&clip,
 					  src, NULL, dst,
-					  src_x,  src_y,
+					  src_x + region.extents.x1 - dst_x - dx,
+					  src_y + region.extents.y1 - dst_y - dy,
 					  0, 0,
 					  region.extents.x1 - dx, region.extents.y1 - dy,
 					  region.extents.x2 - region.extents.x1,
@@ -193,14 +197,24 @@ composite_aligned_boxes(struct sna *sna,
 	if (op == PictOpClear && sna->clear)
 		src = sna->clear;
 
+	DBG(("%s: clipped extents (%d, %d), (%d, %d);  now offset by (%d, %d), orgin (%d, %d)\n",
+	     __FUNCTION__,
+	     clip.extents.x1, clip.extents.y1,
+	     clip.extents.x2, clip.extents.y2,
+	     clip.extents.x1 - boxes[0].x1,
+	     clip.extents.y1 - boxes[0].y1,
+	     dst_x, dst_y));
+
 	if (force_fallback ||
 	    !sna->render.composite(sna, op, src, NULL, dst,
-				   src_x,  src_y,
+				   src_x + clip.extents.x1 - dst_x,
+				   src_y + clip.extents.y1 - dst_y,
 				   0, 0,
 				   clip.extents.x1,  clip.extents.y1,
 				   clip.extents.x2 - clip.extents.x1,
 				   clip.extents.y2 - clip.extents.y1,
-				   COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp)))) {
+				   (clip.data || num_boxes > 1) ?  COMPOSITE_PARTIAL : 0,
+				   memset(&tmp, 0, sizeof(tmp)))) {
 		unsigned int flags;
 		const pixman_box16_t *b;
 		int i, count;
@@ -232,6 +246,8 @@ composite_aligned_boxes(struct sna *sna,
 		}
 
 		DBG(("%s: fbComposite()\n", __FUNCTION__));
+		src_x -= dst_x - dx;
+		src_y -= dst_y - dy;
 		if (maskFormat) {
 			pixman_region_init_rects(&region, boxes, num_boxes);
 			RegionIntersect(&region, &region, &clip);
@@ -241,8 +257,8 @@ composite_aligned_boxes(struct sna *sna,
 				count = region_num_rects(&region);
 				for (i = 0; i < count; i++) {
 					fbComposite(op, src, NULL, dst,
-						    src_x + b[i].x1 - boxes[0].x1,
-						    src_y + b[i].y1 - boxes[0].y1,
+						    src_x + b[i].x1,
+						    src_y + b[i].y1,
 						    0, 0,
 						    b[i].x1, b[i].y1,
 						    b[i].x2 - b[i].x1, b[i].y2 - b[i].y1);
@@ -259,8 +275,8 @@ composite_aligned_boxes(struct sna *sna,
 				if (sigtrap_get() == 0) {
 					for (i = 0; i < count; i++) {
 						fbComposite(op, src, NULL, dst,
-							    src_x + b[i].x1 - boxes[0].x1,
-							    src_y + b[i].y1 - boxes[0].y1,
+							    src_x + b[i].x1,
+							    src_y + b[i].y1,
 							    0, 0,
 							    b[i].x1, b[i].y1,
 							    b[i].x2 - b[i].x1, b[i].y2 - b[i].y1);
commit 84333f6213abb28838656d8352fd537ad68e4189
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 2 19:13:16 2014 +0100

    sna: Leave more Pixmap breadcrumbs in DBG
    
    Add the Pixmap id to various DBG messages to make it easier to track
    rendering.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 379079d..1104f46 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1640,9 +1640,9 @@ gen2_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index bb18dd1..78289f0 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3211,9 +3211,9 @@ gen3_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 32ad868..9a6761f 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1683,9 +1683,9 @@ gen4_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 93bc0d2..1ebaef9 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -1637,9 +1637,9 @@ gen5_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 4ee786b..86ea146 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1907,9 +1907,9 @@ gen6_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 59b954d..571de6e 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2159,9 +2159,9 @@ gen7_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index 22df53d..1eb54aa 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -1977,9 +1977,9 @@ gen8_composite_set_target(struct sna *sna,
 	get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
 			    &op->dst.x, &op->dst.y);
 
-	DBG(("%s: pixmap=%p, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
+	DBG(("%s: pixmap=%ld, format=%08x, size=%dx%d, pitch=%d, delta=(%d,%d),damage=%p\n",
 	     __FUNCTION__,
-	     op->dst.pixmap, (int)op->dst.format,
+	     op->dst.pixmap->drawable.serialNumber, (int)op->dst.format,
 	     op->dst.width, op->dst.height,
 	     op->dst.bo->pitch,
 	     op->dst.x, op->dst.y,
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 24f96bb..bb0cbb2 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -715,7 +715,7 @@ static inline struct sna_pixmap *
 sna_pixmap_force_to_gpu(PixmapPtr pixmap, unsigned flags)
 {
 	/* Unlike move-to-gpu, we ignore wedged and always create the GPU bo */
-	DBG(("%s(pixmap=%p, flags=%x)\n", __FUNCTION__, pixmap, flags));
+	DBG(("%s(pixmap=%ld, flags=%x)\n", __FUNCTION__, pixmap->drawable.serialNumber, flags));
 	return sna_pixmap_move_to_gpu(pixmap, flags | __MOVE_FORCE);
 }
 bool must_check _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags);
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index e65bce0..c76258c 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -643,11 +643,12 @@ sna_composite(CARD8 op,
 	RegionRec region;
 	int dx, dy;
 
-	DBG(("%s(%d src=(%d, %d), mask=(%d, %d), dst=(%d, %d)+(%d, %d), size=(%d, %d)\n",
+	DBG(("%s(%d src=%ld+(%d, %d), mask=%ld+(%d, %d), dst=%ld+(%d, %d)+(%d, %d), size=(%d, %d)\n",
 	     __FUNCTION__, op,
-	     src_x, src_y,
-	     mask_x, mask_y,
-	     dst_x, dst_y, dst->pDrawable->x, dst->pDrawable->y,
+	     get_picture_id(src), src_x, src_y,
+	     get_picture_id(mask), mask_x, mask_y,
+	     get_picture_id(dst), dst_x, dst_y,
+	     dst->pDrawable->x, dst->pDrawable->y,
 	     width, height));
 
 	if (region_is_empty(dst->pCompositeClip)) {
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index 40a9ac4..3d24c5c 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -358,4 +358,9 @@ overlaps(struct sna *sna,
 		extents->y1 + src_dy < extents->y2 + dst_dy);
 }
 
+static inline long get_picture_id(PicturePtr picture)
+{
+	return picture && picture->pDrawable ? get_drawable_pixmap(picture->pDrawable)->drawable.serialNumber : 0;
+}
+
 #endif /* SNA_RENDER_INLINE_H */


More information about the xorg-commit mailing list