xf86-video-intel: 2 commits - src/sna/sna_trapezoids.c src/sna/sna_trapezoids.h src/sna/sna_trapezoids_imprecise.c src/sna/sna_trapezoids_mono.c src/sna/sna_trapezoids_precise.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Oct 1 02:42:21 PDT 2014


 src/sna/sna_trapezoids.c           |   12 ++++++++++--
 src/sna/sna_trapezoids.h           |    6 ++++++
 src/sna/sna_trapezoids_imprecise.c |    6 ------
 src/sna/sna_trapezoids_mono.c      |    6 ------
 src/sna/sna_trapezoids_precise.c   |   21 ++++++++++-----------
 5 files changed, 26 insertions(+), 25 deletions(-)

New commits:
commit de7185bbf48ca2f617466b98328d0fdae4df1b44
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Oct 1 10:28:10 2014 +0100

    sna/trapezoids: Fix comparison on right edge of trapezoids
    
    We need to compare the fixed ceiling rather the floor for accuracy.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 2c1fa65..d9390db 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -75,8 +75,16 @@ bool trapezoids_bounds(int n, const xTrapezoid *t, BoxPtr box)
 	do {
 		xFixed fx1, fx2, v;
 
-		if (!xTrapezoidValid(t))
+		if (!xTrapezoidValid(t)) {
+			__DBG(("%s: skipping invalid trapezoid: top=%d, bottom=%d, left=(%d, %d), (%d, %d), right=(%d, %d), (%d, %d)\n",
+			       __FUNCTION__,
+			       t->top, t->bottom,
+			       t->left.p1.x, t->left.p1.y,
+			       t->left.p2.x, t->left.p2.y,
+			       t->right.p1.x, t->right.p1.y,
+			       t->right.p2.x, t->right.p2.y));
 			continue;
+		}
 
 		if (t->top < y1)
 			y1 = t->top;
@@ -104,7 +112,7 @@ bool trapezoids_bounds(int n, const xTrapezoid *t, BoxPtr box)
 		}
 
 		if (((x2 - t->right.p1.x) | (x2 - t->right.p2.x)) < 0) {
-			if (pixman_fixed_floor(t->right.p1.x) == pixman_fixed_floor(t->right.p2.x)) {
+			if (pixman_fixed_ceil(t->right.p1.x) == pixman_fixed_ceil(t->right.p2.x)) {
 				x2 = pixman_fixed_ceil(t->right.p1.x);
 			} else {
 				if (t->right.p1.y == t->top)
diff --git a/src/sna/sna_trapezoids.h b/src/sna/sna_trapezoids.h
index e8f7f3f..3cddcfe 100644
--- a/src/sna/sna_trapezoids.h
+++ b/src/sna/sna_trapezoids.h
@@ -13,6 +13,12 @@
 #define NO_IMPRECISE 0
 #define NO_PRECISE 0
 
+#if 0
+#define __DBG DBG
+#else
+#define __DBG(x)
+#endif
+
 bool
 composite_aligned_boxes(struct sna *sna,
 			CARD8 op,
diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index 8230665..ea2cb94 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -42,12 +42,6 @@
 #undef SAMPLES_X
 #undef SAMPLES_Y
 
-#if 0
-#define __DBG DBG
-#else
-#define __DBG(x)
-#endif
-
 /* TODO: Emit unantialiased and MSAA triangles. */
 
 #ifndef MAX
diff --git a/src/sna/sna_trapezoids_mono.c b/src/sna/sna_trapezoids_mono.c
index d53e535..7f34829 100644
--- a/src/sna/sna_trapezoids_mono.c
+++ b/src/sna/sna_trapezoids_mono.c
@@ -39,12 +39,6 @@
 
 #include <mipict.h>
 
-#if 0
-#define __DBG(x) LogF x
-#else
-#define __DBG(x)
-#endif
-
 struct quorem {
 	int32_t quo;
 	int32_t rem;
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index 85efb2a..c595bfd 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -42,12 +42,6 @@
 #undef FAST_SAMPLES_X
 #undef FAST_SAMPLES_Y
 
-#if 0
-#define __DBG DBG
-#else
-#define __DBG(x)
-#endif
-
 /* TODO: Emit unantialiased and MSAA triangles. */
 
 #ifndef MAX
commit c6d9303303a5ccb3ec6d072c510c09d6576cb398
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Oct 1 10:25:16 2014 +0100

    sna/trapezoids: Consistently use NO_GPU_THREADS to disable threading for DBG
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index b237666..85efb2a 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -2077,7 +2077,8 @@ precise_trapezoid_mask_converter(CARD8 op, PicturePtr src, PicturePtr dst,
 	     __FUNCTION__, scratch->devPrivate.ptr, scratch->devKind));
 
 	num_threads = 1;
-	if ((flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
+	if (!NO_GPU_THREADS &&
+	    (flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
 		num_threads = sna_use_threads(extents.x2 - extents.x1,
 					      extents.y2 - extents.y1,
 					      4);
@@ -2693,7 +2694,9 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
 	dy = dst->pDrawable->y * SAMPLES_Y;
 
 	num_threads = 1;
-	if ((flags & COMPOSITE_SPANS_RECTILINEAR) == 0 && (lerp || is_solid))
+	if (!NO_GPU_THREADS &&
+	    (flags & COMPOSITE_SPANS_RECTILINEAR) == 0 &&
+	    (lerp || is_solid))
 		num_threads = sna_use_threads(4*(region.extents.x2 - region.extents.x1),
 					      region.extents.y2 - region.extents.y1,
 					      4);
@@ -3048,7 +3051,8 @@ precise_trapezoid_span_inplace(struct sna *sna,
 	inplace.opacity = color >> 24;
 
 	num_threads = 1;
-	if ((flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
+	if (!NO_GPU_THREADS &&
+	    (flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
 		num_threads = sna_use_threads(region.extents.x2 - region.extents.x1,
 					      region.extents.y2 - region.extents.y1,
 					      4);
@@ -3190,7 +3194,8 @@ precise_trapezoid_span_fallback(CARD8 op, PicturePtr src, PicturePtr dst,
 	     __FUNCTION__, scratch->devPrivate.ptr, scratch->devKind));
 
 	num_threads = 1;
-	if ((flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
+	if (!NO_GPU_THREADS &&
+	    (flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
 		num_threads = sna_use_threads(extents.x2 - extents.x1,
 					      extents.y2 - extents.y1,
 					      4);
@@ -3442,7 +3447,7 @@ precise_tristrip_span_converter(struct sna *sna,
 	dy *= SAMPLES_Y;
 
 	num_threads = 1;
-	if (!NO_GPU_THREADS && 0 &&
+	if (!NO_GPU_THREADS &&
 	    tmp.thread_boxes &&
 	    thread_choose_span(&tmp, dst, maskFormat, &clip))
 		num_threads = sna_use_threads(extents.x2 - extents.x1,


More information about the xorg-commit mailing list