xf86-video-intel: Branch 'refs/tags/2.21.5' - 6 commits - configure.ac NEWS src/sna/sna_accel.c src/sna/sna_display.c src/sna/sna_glyphs.c src/sna/sna.h src/sna/sna_io.c src/sna/sna_render.c src/sna/sna_tiling.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Mar 21 02:06:07 PDT 2013


Rebased ref, commits from common ancestor:
commit 4adebfed415cf58599b22e873f32e7ce2eaa6542
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 21 08:53:12 2013 +0000

    2.21.5 release

diff --git a/NEWS b/NEWS
index cb82e52..05a20fa 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,42 @@
+Release 2.21.5 (2013-03-21)
+===========================
+Haswell reintroduces a command to load the scanline window from the
+command stream and so requires its own specialised wait-for-vsync routine
+- failure to do so was then causing hangs when trying to do tearfree video
+or use a compositor.
+
+ * Prevent buffer leak if a non-fullscreen Window is closed with multiple
+   pending swap events.
+
+ * Fix offset transformation for fallback gradient paths.
+   https://bugs.freedesktop.org/show_bug.cgi?id=62198
+
+ * Prevent Glamor from crashing if misconfigured.
+   Thanks to Michel Dänzer.
+
+ * Prevent UXA from crashing if torn down during PreInit.
+   Thanks to Aaron Plattner.
+
+ * Prevent miscompilation with different functional units having different
+   compiler flags. Some functions were expected to be inlined and so
+   recompiled with the current target. However, some compilers were
+   choosing to emit subroutine calls instead without noticing that the
+   ABI was different between the caller and callee - causing corruption.
+   https://bugs.freedesktop.org/show_bug.cgi?id=62198
+
+ * Fix rendering of CompositeTriFan with recent Xorg.
+
+ * Apply the video src-offset fix highlighted in the last release!
+   A typo prevented the fix from working for gen4+.
+   https://bugs.freedesktop.org/show_bug.cgi?id=62343
+
+ * Fix rendering of multiple glyphs to very large destination surfaces
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156387
+
+ * Fix scanline waits for Haswell
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156679
+
+
 Release 2.21.4 (2013-03-11)
 ===========================
 More bugs, more fixes, more releases. A minor new feature being introduced
diff --git a/configure.ac b/configure.ac
index 8fea817..de3990d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.21.4],
+        [2.21.5],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])
commit 1aca872ee51e10908dcc4979596ae69732e9a02a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Mar 19 08:26:01 2013 +0000

    sna: Haswell reintroduces MI_LOAD_SCAN_LINES
    
    Better late than never? Interestingly only available from the BLT ring,
    which makes accurate waiting for XVideo (which must use the render ring)
    impossible in the current form - we need to render to a temporary then
    do a vsynced blit in this case.
    
    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156679
    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 abb340a..9068df9 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2806,12 +2806,46 @@ sna_covering_crtc(ScrnInfoPtr scrn,
 	return best_crtc;
 }
 
+static bool sna_emit_wait_for_scanline_hsw(struct sna *sna,
+					   xf86CrtcPtr crtc,
+					   int pipe, int y1, int y2,
+					   bool full_height)
+{
+	uint32_t event;
+	uint32_t *b;
+
+	if (sna->kgem.mode != KGEM_BLT)
+		return false;
+
+	b = kgem_get_batch(&sna->kgem);
+	sna->kgem.nbatch += 5;
+
+	/* The documentation says that the LOAD_SCAN_LINES command
+	 * always comes in pairs. Don't ask me why. */
+	switch (pipe) {
+	case 0: event = 0; break;
+	case 1: event = 1 << 19; break;
+	case 2: event = 4 << 19; break;
+	}
+	b[2] = b[0] = MI_LOAD_SCAN_LINES_INCL | event;
+	b[3] = b[1] = (y1 << 16) | (y2-1);
+
+	switch (pipe) {
+	case 0: event = 0; break;
+	case 1: event = 1 << 8; break;
+	case 2: event = 1 << 14; break;
+	}
+	b[4] = MI_WAIT_FOR_EVENT | event;
+
+	return true;
+}
+
 #define MI_LOAD_REGISTER_IMM			(0x22<<23)
 
-static bool sna_emit_wait_for_scanline_gen7(struct sna *sna,
-					    xf86CrtcPtr crtc,
-					    int pipe, int y1, int y2,
-					    bool full_height)
+static bool sna_emit_wait_for_scanline_ivb(struct sna *sna,
+					   xf86CrtcPtr crtc,
+					   int pipe, int y1, int y2,
+					   bool full_height)
 {
 	uint32_t *b;
 	uint32_t event;
@@ -3022,10 +3056,12 @@ sna_wait_for_scanline(struct sna *sna,
 
 	if (sna->kgem.gen >= 0100)
 		ret = false;
+	else if (sna->kgem.gen >= 075)
+		ret = sna_emit_wait_for_scanline_hsw(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen == 071)
 		ret =sna_emit_wait_for_scanline_gen6(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen >= 070)
-		ret = sna_emit_wait_for_scanline_gen7(sna, crtc, pipe, y1, y2, full_height);
+		ret = sna_emit_wait_for_scanline_ivb(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen >= 060)
 		ret =sna_emit_wait_for_scanline_gen6(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen >= 040)
commit f132452da14fd09a2a3926cc9c034cb2e8c2f1a9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Mar 19 07:57:30 2013 +0000

    sna: Ignore vsync waits on tiny scanline ranges
    
    If the update is only a couple of lines tall, any tear will not be
    visible - so just ignore programming the wait into the GPU.
    
    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 a80a3c1..abb340a 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3005,7 +3005,7 @@ sna_wait_for_scanline(struct sna *sna,
 	if (y2 > crtc->bounds.y2 - crtc->bounds.y1)
 		y2 = crtc->bounds.y2 - crtc->bounds.y1;
 	DBG(("%s: clipped range = %d, %d\n", __FUNCTION__, y1, y2));
-	if (y2 <= y1)
+	if (y2 <= y1 + 4)
 		return false;
 
 	full_height = y1 == 0 && y2 == crtc->bounds.y2 - crtc->bounds.y1;
commit 308f0208de59620190dd3cb65b3243d2e8a7bd87
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Mar 18 15:04:22 2013 +0000

    sna: Reset operation state between glyphs
    
    We are not resetting sufficient state between operations as we presume
    that all callers of Composite() currently pass in a blank state. In the
    long run, we want to remove that burden and do a minimal initialisation.
    
    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156387
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 2f44113..3e2d79b 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -673,8 +673,6 @@ glyphs_slow(struct sna *sna,
 	if (NO_GLYPHS_SLOW)
 		return false;
 
-	memset(&tmp, 0, sizeof(tmp));
-
 	DBG(("%s(op=%d, src=(%d, %d), nlist=%d,  dst=(%d, %d)+(%d, %d))\n",
 	     __FUNCTION__, op, src_x, src_y, nlist,
 	     list->xOff, list->yOff, dst->pDrawable->x, dst->pDrawable->y));
@@ -740,7 +738,7 @@ glyphs_slow(struct sna *sna,
 						   y - glyph->info.y,
 						   glyph->info.width,
 						   glyph->info.height,
-						   &tmp))
+						   memset(&tmp, 0, sizeof(tmp))))
 				return false;
 
 			rects = REGION_RECTS(dst->pCompositeClip);
commit 4a37d57f9633bbd29f308239c1cd956767b277c0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Mar 18 15:00:01 2013 +0000

    sna: Add a pair of sanity checks before creating the redirection target
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 6a2438f..2e29d95 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1873,6 +1873,8 @@ sna_render_composite_redirect(struct sna *sna,
 	int bpp = op->dst.pixmap->drawable.bitsPerPixel;
 	struct kgem_bo *bo;
 
+	assert(t->real_bo == NULL);
+
 #if NO_REDIRECT
 	return false;
 #endif
@@ -1954,6 +1956,7 @@ sna_render_composite_redirect(struct sna *sna,
 			t->real_bo = op->dst.bo;
 			t->real_damage = op->damage;
 			if (op->damage) {
+				assert(!DAMAGE_IS_ALL(op->damage));
 				t->damage = sna_damage_create();
 				op->damage = &t->damage;
 			}
commit 28371a34fa83f70a7af3c8d3bfd6c7cef9e35073
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Mar 18 14:49:58 2013 +0000

    sna: Skip processing an all-clipped-out glyph
    
    Along the slow path, skip all processing of glyphs that are not visible.
    This is important as the slow path handles the per-glyph redirection
    case, which is much more expensive.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index a244b97..13a5ce3 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -864,6 +864,21 @@ inline static bool is_clipped(const RegionRec *r,
 		r->extents.y2 - r->extents.y1 != d->height);
 }
 
+inline static bool
+box_intersect(BoxPtr a, const BoxRec *b)
+{
+	if (a->x1 < b->x1)
+		a->x1 = b->x1;
+	if (a->x2 > b->x2)
+		a->x2 = b->x2;
+	if (a->y1 < b->y1)
+		a->y1 = b->y1;
+	if (a->y2 > b->y2)
+		a->y2 = b->y2;
+
+	return a->x1 < a->x2 && a->y1 < a->y2;
+}
+
 unsigned sna_cpu_detect(void);
 char *sna_cpu_features_to_string(unsigned features, char *line);
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index f654c1a..a2528f6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4727,21 +4727,6 @@ typedef void (*sna_copy_func)(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			      RegionPtr region, int dx, int dy,
 			      Pixel bitPlane, void *closure);
 
-inline static bool
-box_intersect(BoxPtr a, const BoxRec *b)
-{
-	if (a->x1 < b->x1)
-		a->x1 = b->x1;
-	if (a->x2 > b->x2)
-		a->x2 = b->x2;
-	if (a->y1 < b->y1)
-		a->y1 = b->y1;
-	if (a->y2 > b->y2)
-		a->y2 = b->y2;
-
-	return a->x1 < a->x2 && a->y1 < a->y2;
-}
-
 static RegionPtr
 sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 	    int sx, int sy,
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 3b1cf37..2f44113 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -692,11 +692,21 @@ glyphs_slow(struct sna *sna,
 			GlyphPtr glyph = *glyphs++;
 			struct sna_glyph priv;
 			BoxPtr rects;
+			BoxRec box;
 			int nrect;
 
 			if (!glyph_valid(glyph))
 				goto next_glyph;
 
+			box.x1 = x - glyph->info.x;
+			box.y1 = y - glyph->info.y;
+			box.x2 = bound(box.x1, glyph->info.width);
+			box.y2 = bound(box.y1, glyph->info.height);
+
+			if (!box_intersect(&box,
+					   &dst->pCompositeClip->extents))
+				goto next_glyph;
+
 			priv = *sna_glyph(glyph);
 			if (priv.atlas == NULL) {
 				if (!glyph_cache(screen, &sna->render, glyph)) {
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 41322ad..540f3a6 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -41,21 +41,6 @@
 
 /* XXX Need to avoid using GTT fenced access for I915_TILING_Y on 855GM */
 
-static bool
-box_intersect(BoxPtr a, const BoxRec *b)
-{
-	if (a->x1 < b->x1)
-		a->x1 = b->x1;
-	if (a->x2 > b->x2)
-		a->x2 = b->x2;
-	if (a->y1 < b->y1)
-		a->y1 = b->y1;
-	if (a->y2 > b->y2)
-		a->y2 = b->y2;
-
-	return a->x1 < a->x2 && a->y1 < a->y2;
-}
-
 static inline bool upload_too_large(struct sna *sna, int width, int height)
 {
 	return width * height * 4 > sna->kgem.max_upload_tile_size;
diff --git a/src/sna/sna_tiling.c b/src/sna/sna_tiling.c
index 019b50a..02ab59d 100644
--- a/src/sna/sna_tiling.c
+++ b/src/sna/sna_tiling.c
@@ -795,21 +795,6 @@ done:
 	return ret;
 }
 
-static bool
-box_intersect(BoxPtr a, const BoxRec *b)
-{
-	if (a->x1 < b->x1)
-		a->x1 = b->x1;
-	if (a->x2 > b->x2)
-		a->x2 = b->x2;
-	if (a->y1 < b->y1)
-		a->y1 = b->y1;
-	if (a->y2 > b->y2)
-		a->y2 = b->y2;
-
-	return a->x1 < a->x2 && a->y1 < a->y2;
-}
-
 bool
 sna_tiling_copy_boxes(struct sna *sna, uint8_t alu,
 		      PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,


More information about the xorg-commit mailing list