[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-intel: Changes to 'upstream-experimental'



 NEWS                         |   30 ++
 configure.ac                 |    2 
 src/i915_render.c            |    8 
 src/intel_driver.h           |   37 +++
 src/intel_memory.c           |    6 
 src/intel_module.c           |   73 +++++
 src/intel_uxa.c              |    3 
 src/intel_video.c            |    2 
 src/legacy/i810/i810_video.c |    4 
 src/sna/brw/brw_disasm.c     |   11 
 src/sna/fb/fbbitmap.c        |   18 +
 src/sna/gen2_render.c        |   16 -
 src/sna/gen3_render.c        |   16 -
 src/sna/gen4_render.c        |   25 +-
 src/sna/gen5_render.c        |   25 +-
 src/sna/gen6_render.c        |  147 +++++++----
 src/sna/gen7_render.c        |  165 ++++++-------
 src/sna/kgem.c               |   20 +
 src/sna/sna.h                |    2 
 src/sna/sna_accel.c          |  268 +++++++++++++++------
 src/sna/sna_blt.c            |  129 ++++++++++
 src/sna/sna_composite.c      |   12 
 src/sna/sna_display.c        |  105 +++++---
 src/sna/sna_dri.c            |    8 
 src/sna/sna_driver.c         |    8 
 src/sna/sna_glyphs.c         |  527 +++++++++++++++++++------------------------
 src/sna/sna_gradient.c       |    3 
 src/sna/sna_render.c         |   44 +++
 src/sna/sna_render.h         |   11 
 src/sna/sna_video_overlay.c  |    2 
 test/dri2.c                  |    4 
 uxa/uxa-accel.c              |  163 +++++++------
 32 files changed, 1201 insertions(+), 693 deletions(-)

New commits:
commit 5ff6198c9346d84717bac28980329b048f4406e8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Aug 18 11:59:56 2012 +0100

    2.20.4 release
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/NEWS b/NEWS
index 5a9c495..1ad769e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,33 @@
+Release 2.20.4 (2012-08-18)
+===========================
+Continuing the small bugfix releases, the only real feature is initial
+enabling for Haswell for the purpose of rendering verification and
+validation - by no means is it complete!
+
+Bugs fixed since 2.20.3:
+
+  * Some potential errors along failure paths found by a static analyser
+  with the help of Zdenek Kablac.
+
+  * Eliminate zero-sized rectangles from PolyFillRectangles as the code
+  assumes that they did not exist and so caused corruption.
+
+  * Remove the UXA warning for failing to tile the front buffer if it is
+  disallowed by hardware, and so expected.
+
+  * Fix the validation of the XV pipe parameter.
+
+  * Fix 8x8 tiled pattern fills
+  https://bugs.freedesktop.org/show_bug.cgi?id=53353
+
+  * Fix compile failure when using --with-builderstring
+
+  * Restore w/a flush for gen4 fill/copy/video, fortunately rare
+  operations as at least for fill/copy we prefer to use the BLT.
+  https://bugs.freedesktop.org/show_bug.cgi?id=53119
+
+  * Restore preferred use of the RENDER ring for SNB+ DRI copies.
+
 Release 2.20.3 (2012-08-04)
 ===========================
 Just a minor bugfix for gen4 chipsets (965gm, gm45 and friends) that
diff --git a/configure.ac b/configure.ac
index 7ffbb75..a9c6336 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.20.3],
+        [2.20.4],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit bc77a466531fdbdd21e9354af567e5215a66edf9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Aug 18 11:09:23 2012 +0100

    sna: Silence a couple of recent compiler warnings
    
    sna_accel.c: In function 'sna_poly_fill_rect_extents':
    sna_accel.c:11438:11: warning: unused variable 'v' [-Wunused-variable]
    
    sna_blt.c: In function 'sna_blt_composite__convert':
    sna_blt.c:1712:3: warning: format '%s' expects a matching 'char *' argument [-Wformat]
    sna_blt.c:1738:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'CARD32' [-Wformat]
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index cf82cc5..31a9d3d 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11435,8 +11435,6 @@ sna_poly_fill_rect_extents(DrawablePtr drawable, GCPtr gc,
 	r++;
 
 	while (--n) {
-		int32_t v;
-
 		if (r->width == 0 || r->height == 0)
 			goto slow;
 
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 2d7a4aa..819d24a 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1709,7 +1709,7 @@ sna_blt_composite__convert(struct sna *sna,
 	}
 
 	if (tmp->src.transform) {
-		DBG(("%s: transforms not handled by the BLT\n"));
+		DBG(("%s: transforms not handled by the BLT\n", __FUNCTION__));
 		return false;
 	}
 
@@ -1738,7 +1738,7 @@ sna_blt_composite__convert(struct sna *sna,
 		DBG(("%s: incompatible src/dst formats src=%08x, dst=%08x\n",
 		     __FUNCTION__,
 		     (unsigned)tmp->src.pict_format,
-		     tmp->dst.format));
+		     (unsigned)tmp->dst.format));
 		return false;
 	}
 

commit d1da2c71461798bb027a260ff8480b71ebffde26
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 21:15:54 2012 +0100

    sna: Correct assertion for StoreColors
    
    Fixing the assertion reveals that it was bogus!
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 31c3c68..cf82cc5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -13899,7 +13899,7 @@ bool sna_accel_init(ScreenPtr screen, struct sna *sna)
 	screen->UninstallColormap = miUninstallColormap;
 	screen->ListInstalledColormaps = miListInstalledColormaps;
 	screen->ResolveColor = miResolveColor;
-	assert(screen->StoreColors == PictureStoreColors);
+	assert(screen->StoreColors == NULL);
 	screen->StoreColors = sna_store_colors;
 	screen->BitmapToRegion = fbBitmapToRegion;
 

commit 31ddaa0cfbde083aef42d9fdb5ed13bb4edc36c8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 21:13:52 2012 +0100

    sna: Fixup DBG after 7f5a9e3
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b403597..31c3c68 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11416,7 +11416,7 @@ sna_poly_fill_rect_extents(DrawablePtr drawable, GCPtr gc,
 		return 0;
 
 	DBG(("%s: [0] = (%d, %d)x(%d, %d)\n",
-	     __FUNCTION__, r->x, r->y, r->width, r->height));
+	     __FUNCTION__, (*_r)->x, (*_r)->y, (*_r)->width, (*_r)->height));
 
 	/* Remove any zero-size rectangles from the array */
 	while (*_n && ((*_r)->width == 0 || (*_r)->height == 0))

commit b8bc56c12c6fdc559354fbbf96b6e043a491aa8f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 21:00:57 2012 +0100

    uxa/gen3: Simply simple fill shader generation
    
    Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/i915_render.c b/src/i915_render.c
index acbd82c..6d3400e 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -779,12 +779,8 @@ i915_composite_emit_shader(intel_screen_private *intel, CARD8 op)
 		else
 			i915_fs_texldp(src_reg, FS_S0, FS_T0);
 
-		if (src_reg != FS_OC) {
-			if (dest_is_alpha)
-				i915_fs_mov(FS_OC, i915_fs_operand(src_reg, W, W, W, W));
-			else
-				i915_fs_mov(FS_OC, i915_fs_operand_reg(src_reg));
-		}
+		if (src_reg != FS_OC)
+			i915_fs_mov(FS_OC, i915_fs_operand(src_reg, W, W, W, W));
 	} else {
 		i915_fs_dcl(FS_T1);
 		i915_fs_dcl(FS_S1);

commit 182581edde356a21a0681de526f83884e1a0de5d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:59:09 2012 +0100

    uxa/glamor: Check for failed prepares
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 4e5bac3..76425fe 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -52,12 +52,13 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
 	int off_x, off_y;
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_fill_spans_nf(pDrawable,
-					  pGC, n, ppt, pwidth, fSorted);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_fill_spans_nf(pDrawable,
+						  pGC, n, ppt, pwidth, fSorted);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (!ok)
 			goto fallback;
@@ -213,14 +214,14 @@ uxa_put_image(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
-
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_put_image_nf(pDrawable,
-					 pGC, depth, x, y, w, h,
-					 leftPad, format, bits);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		int ok = 0;
 
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_put_image_nf(pDrawable,
+						 pGC, depth, x, y, w, h,
+						 leftPad, format, bits);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 		if (!ok)
 			goto fallback;
 
@@ -375,16 +376,18 @@ uxa_copy_n_to_n(DrawablePtr pSrcDrawable,
 	PixmapPtr pSrcPixmap, pDstPixmap;
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
-
-		uxa_prepare_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO);
-		uxa_prepare_access(pDstDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_copy_n_to_n_nf(pSrcDrawable, pDstDrawable,
-					   pGC, pbox, nbox, dx, dy,
-					   reverse, upsidedown, bitplane,
-					   closure);
-		uxa_finish_access(pDstDrawable, UXA_GLAMOR_ACCESS_RW);
-		uxa_finish_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO);
+		int ok = 0;
+
+		if (uxa_prepare_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO)) {
+			if (uxa_prepare_access(pDstDrawable, UXA_GLAMOR_ACCESS_RW)) {
+				ok = glamor_copy_n_to_n_nf(pSrcDrawable, pDstDrawable,
+							   pGC, pbox, nbox, dx, dy,
+							   reverse, upsidedown, bitplane,
+							   closure);
+				uxa_finish_access(pDstDrawable, UXA_GLAMOR_ACCESS_RW);
+			}
+			uxa_finish_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO);
+		}
 
 		if (!ok)
 			goto fallback;
@@ -561,11 +564,12 @@ uxa_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_poly_point_nf(pDrawable, pGC, mode, npt, ppt);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_poly_point_nf(pDrawable, pGC, mode, npt, ppt);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (ok)
 			return;
@@ -611,11 +615,12 @@ uxa_poly_lines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_poly_lines_nf(pDrawable, pGC, mode, npt, ppt);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_poly_lines_nf(pDrawable, pGC, mode, npt, ppt);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (ok)
 			return;
@@ -684,11 +689,12 @@ uxa_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_poly_segment_nf(pDrawable, pGC, nseg, pSeg);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_poly_segment_nf(pDrawable, pGC, nseg, pSeg);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (ok)
 			return;
@@ -758,11 +764,12 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
 	int n;
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_poly_fill_rect_nf(pDrawable, pGC, nrect, prect);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_poly_fill_rect_nf(pDrawable, pGC, nrect, prect);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (!ok)
 			uxa_check_poly_fill_rect(pDrawable, pGC, nrect, prect);
@@ -883,12 +890,13 @@ uxa_get_spans(DrawablePtr pDrawable,
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_get_spans_nf(pDrawable, wMax, ppt,
-					 pwidth, nspans, pdstStart);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_get_spans_nf(pDrawable, wMax, ppt,
+						 pwidth, nspans, pdstStart);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (!ok)
 			goto fallback;
@@ -908,12 +916,13 @@ uxa_set_spans(DrawablePtr pDrawable, GCPtr gc, char *src,
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_set_spans_nf(pDrawable, gc, src,
-					 points, widths, n, sorted);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_set_spans_nf(pDrawable, gc, src,
+						 points, widths, n, sorted);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (!ok)
 			goto fallback;
@@ -934,15 +943,17 @@ uxa_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 		RegionPtr region;
 
-		uxa_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
-		uxa_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO);
-		ok = glamor_copy_plane_nf(pSrc, pDst, pGC, srcx, srcy, w, h,
-					   dstx, dsty, bitPlane, &region);
-		uxa_finish_access(pSrc, UXA_GLAMOR_ACCESS_RO);
-		uxa_finish_access(pDst, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW)) {
+			if (uxa_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO)) {
+				ok = glamor_copy_plane_nf(pSrc, pDst, pGC, srcx, srcy, w, h,
+							  dstx, dsty, bitPlane, &region);
+				uxa_finish_access(pSrc, UXA_GLAMOR_ACCESS_RO);
+			}
+			uxa_finish_access(pDst, UXA_GLAMOR_ACCESS_RW);
+		}
 		if (!ok)
 			goto fallback;
 		return region;
@@ -962,11 +973,12 @@ uxa_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_image_glyph_blt_nf(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_image_glyph_blt_nf(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 		if (!ok)
 			goto fallback;
 		return;
@@ -985,11 +997,12 @@ uxa_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_poly_glyph_blt_nf(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_poly_glyph_blt_nf(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 		if (!ok)
 			goto fallback;
 		return;
@@ -1007,13 +1020,15 @@ uxa_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		int ok;
+		int ok = 0;
 
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		uxa_prepare_access(&pBitmap->drawable, UXA_GLAMOR_ACCESS_RO);
-		ok = glamor_push_pixels_nf(pGC, pBitmap, pDrawable, w, h, x, y);
-		uxa_finish_access(&pBitmap->drawable, UXA_GLAMOR_ACCESS_RO);
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			if (uxa_prepare_access(&pBitmap->drawable, UXA_GLAMOR_ACCESS_RO)) {
+				ok = glamor_push_pixels_nf(pGC, pBitmap, pDrawable, w, h, x, y);
+				uxa_finish_access(&pBitmap->drawable, UXA_GLAMOR_ACCESS_RO);
+			}
+			uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 		if (!ok)
 			goto fallback;
 		return;
@@ -1231,10 +1246,12 @@ uxa_get_image(DrawablePtr pDrawable, int x, int y, int w, int h,
 	Box.y2 = Box.y1 + h;
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
-		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
-		ok = glamor_get_image_nf(pDrawable, x, y, w, h,
-					format, planeMask, d);
-		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		ok = 0;
+		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
+			ok = glamor_get_image_nf(pDrawable, x, y, w, h,
+						 format, planeMask, d);
+			uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		}
 
 		if (!ok)
 			goto fallback;

commit c289b607d1526d8d3625fa84c093552a9f3ea168
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:54:40 2012 +0100

    uxa: Check for failed mmapping of the scanout
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 5aad062..3745ff0 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -1145,7 +1145,8 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
 	if (!uxa_resources_init(screen))
 		return FALSE;
 
-	drm_intel_gem_bo_map_gtt(bo);
+	if (drm_intel_gem_bo_map_gtt(bo))
+		return FALSE;
 
 	pixmap = screen->GetScreenPixmap(screen);
 	intel_set_pixmap_bo(pixmap, bo);

commit 32ec8b979bc8cf7d8ce351ca752b806d42bc1c0f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:53:08 2012 +0100

    test/dri2: Discard error returns from _XReply
    
    This is only test code, so keep the static analyser quiet
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/test/dri2.c b/test/dri2.c
index 86a0a74..0e2003c 100644
--- a/test/dri2.c
+++ b/test/dri2.c
@@ -475,7 +475,7 @@ DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region,
    req->dest = dest;
    req->src = src;
 
-   _XReply(dpy, (xReply *) & rep, 0, xFalse);
+   (void) _XReply(dpy, (xReply *) & rep, 0, xFalse);
 
    UnlockDisplay(dpy);
    SyncHandle();
@@ -517,7 +517,7 @@ uint64_t DRI2SwapBuffers(Display *dpy, XID drawable,
     req->drawable = drawable;
     load_swap_req(req, target_msc, divisor, remainder);
 
-    _XReply(dpy, (xReply *)&rep, 0, xFalse);
+    (void) _XReply(dpy, (xReply *)&rep, 0, xFalse);
 
     count = vals_to_card64(rep.swap_lo, rep.swap_hi);
 

commit 5675c36e0dca92b8d24235d82cd0e87f82fdc7b0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:44:32 2012 +0100

    sna: Check for failure to pin the front buffer
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 431b5de..b35a7cc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -964,6 +964,9 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
 		DBG(("%s: attaching to framebuffer\n", __FUNCTION__));
 		sna_crtc_disable_shadow(sna, sna_crtc);
 		bo = sna_pixmap_pin(sna->front);
+		if (bo == NULL)
+			return NULL;
+
 		if (!get_fb(sna, bo, scrn->virtualX, scrn->virtualY))
 			return NULL;
 

commit c9db2c74ab3b482489bec63b11df80bb35e21aca
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:42:50 2012 +0100

    sna/gen2: Add break rather than fallthrough
    
    The fall-through in this instance is irrelevant, and the static
    analysers complain for not commenting on the fall-through. Silence the
    analyser by removing the fall-through.
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 153c7ae..ecccbbb 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1774,6 +1774,7 @@ gen2_render_composite(struct sna *sna,
 		goto cleanup_dst;
 	case 0:
 		gen2_composite_solid_init(sna, &tmp->src, 0);
+		break;
 	case 1:
 		if (mask == NULL && tmp->src.bo &&
 		    sna_blt_composite__convert(sna,

commit e0abbc3ccafb51d6b2114e1c7d6dc2eda3a8c1f4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:40:17 2012 +0100

    i810: Query PortPriv for the surface properties
    
    Avoid the NULL deferences.
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index 4ebad66..bbaa3ce 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -1283,7 +1283,7 @@ I810GetSurfaceAttribute(
     Atom attribute,
     INT32 *value
 ){
-    return I810GetPortAttribute(pScrn, attribute, value, NULL);
+    return I810GetPortAttribute(pScrn, attribute, value, GET_PORT_PRIVATE(pScrn));
 }
 
 static int
@@ -1292,7 +1292,7 @@ I810SetSurfaceAttribute(
     Atom attribute,
     INT32 value
 ){
-    return I810SetPortAttribute(pScrn, attribute, value, NULL);
+    return I810SetPortAttribute(pScrn, attribute, value, GET_PORT_PRIVATE(pScrn));
 }
 
 

commit c09518f98d5c533860b084506d9ee2c819cca52f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:32:53 2012 +0100

    sna: Fix assignment inside assertion (should be an equality check)
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 661dde0..b403597 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -13899,7 +13899,7 @@ bool sna_accel_init(ScreenPtr screen, struct sna *sna)
 	screen->UninstallColormap = miUninstallColormap;
 	screen->ListInstalledColormaps = miListInstalledColormaps;
 	screen->ResolveColor = miResolveColor;
-	assert(screen->StoreColors = PictureStoreColors);
+	assert(screen->StoreColors == PictureStoreColors);
 	screen->StoreColors = sna_store_colors;
 	screen->BitmapToRegion = fbBitmapToRegion;
 

commit 7d3e4328d4f4421178377933ca98fb80daa85c76
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:32:11 2012 +0100

    sna/glyphs: Fix potential leak of glyph extents (for many lists of many formats)
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index db9af14..8cbe39c 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1173,8 +1173,10 @@ glyphs_format(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
 		extents.x2 = 0;
 		extents.y2 = 0;
 
-		if (format->format != list->format->format)
-			return NULL;
+		if (format->format != list->format->format) {
+			format = NULL;
+			goto out;
+		}
 
 		x += list->xOff;
 		y += list->yOff;

commit 9b00c82df78cb8820c0e32fbecc7c933eed81d52
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 20:30:52 2012 +0100

    sna: Remember alpha-fixup for BLT upload
    
    Still dubious whether this is truly beneficial...
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 77fca3d..2d7a4aa 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1439,9 +1439,6 @@ prepare_blt_put(struct sna *sna,
 	assert(src->devKind);
 	assert(src->devPrivate.ptr);
 
-	if (alpha_fixup)
-		return false; /* XXX */
-
 	if (alpha_fixup) {
 		op->u.blt.pixel = alpha_fixup;
 		op->blt   = blt_put_composite_with_alpha;

commit 94871944a0e1351273d6029df7bf0300f31a8571
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 16 00:07:58 2012 +0100

    sna: Avoid conflating tearfree and randr shadow modes
    
    For ordinary TearFree we do not want to adjust the crtc offsets.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index c36dda9..431b5de 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -64,6 +64,7 @@ struct sna_crtc {
 	uint32_t cursor;
 	bool shadow;
 	bool fallback_shadow;
+	bool transform;
 	uint8_t id;
 	uint8_t pipe;
 	uint8_t plane;
@@ -536,7 +537,8 @@ sna_crtc_apply(xf86CrtcPtr crtc)
 	VG_CLEAR(arg);
 	arg.crtc_id = sna_crtc->id;
 	arg.fb_id = fb_id(sna_crtc->bo);
-	if (sna_crtc->shadow) {
+	if (sna_crtc->transform) {
+		assert(sna_crtc->shadow);
 		arg.x = 0;
 		arg.y = 0;
 	} else {
@@ -548,7 +550,7 @@ sna_crtc_apply(xf86CrtcPtr crtc)
 	arg.mode = sna_crtc->kmode;
 	arg.mode_valid = 1;
 
-	DBG(("%s: applying crtc [%d] mode=%dx%d+%d+%d@%d, fb=%d%s update to %d outputs\n",
+	DBG(("%s: applying crtc [%d] mode=%dx%d+%d+%d@%d, fb=%d%s%s update to %d outputs\n",
 	     __FUNCTION__, sna_crtc->id,
 	     arg.mode.hdisplay,
 	     arg.mode.vdisplay,
@@ -556,6 +558,7 @@ sna_crtc_apply(xf86CrtcPtr crtc)
 	     arg.mode.clock,
 	     arg.fb_id,
 	     sna_crtc->shadow ? " [shadow]" : "",
+	     sna_crtc->transform ? " [transformed]" : "",
 	     output_count));
 
 	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg))
@@ -907,6 +910,7 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
 	struct sna *sna = to_sna(scrn);
 	struct kgem_bo *bo;
 
+	sna_crtc->transform = false;
 	if (use_shadow(sna, crtc)) {
 		if (!sna_crtc_enable_shadow(sna, sna_crtc))
 			return NULL;
@@ -926,6 +930,7 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
 			return NULL;
 		}
 
+		sna_crtc->transform = true;
 		return bo;
 	} else if (sna->flags & SNA_TEAR_FREE) {
 		DBG(("%s: tear-free updates requested\n", __FUNCTION__));
@@ -962,6 +967,7 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
 		if (!get_fb(sna, bo, scrn->virtualX, scrn->virtualY))
 			return NULL;
 
+		assert(!sna_crtc->shadow);
 		return kgem_bo_reference(bo);
 	}
 }
@@ -990,7 +996,7 @@ static void sna_crtc_randr(xf86CrtcPtr crtc)
 	filter = NULL;
 	params = NULL;
 	nparams = 0;
-	if (sna_crtc->shadow) {
+	if (sna_crtc->transform) {
 #ifdef RANDR_12_INTERFACE
 		if (transform) {
 			if (transform->nparams) {
@@ -1076,6 +1082,7 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
 	struct kgem_bo *saved_bo, *bo;
 	struct drm_mode_modeinfo saved_kmode;
+	bool saved_transform;
 
 	xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
 		   "switch to mode %dx%d on crtc %d (pipe %d)\n",
@@ -1097,6 +1104,7 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 
 	saved_kmode = sna_crtc->kmode;
 	saved_bo = sna_crtc->bo;
+	saved_transform = sna_crtc->transform;
 
 	sna_crtc->fallback_shadow = false;
 retry: /* Attach per-crtc pixmap or direct */
@@ -1117,6 +1125,7 @@ retry: /* Attach per-crtc pixmap or direct */
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
 			   "failed to set mode: %s\n", strerror(errno));
 
+		sna_crtc->transform = saved_transform;
 		sna_crtc->bo = saved_bo;
 		sna_crtc->kmode = saved_kmode;
 		return FALSE;

commit 1a389842347bab9d91240444e161589071eb9a47
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Aug 15 23:07:16 2012 +0100

    sna: Avoid queuing a pageflip on a DPMS off pipe
    
    If the pipe is not running, attempting to queue a pageflip will result
    in an error and us disabling the output in retaliation.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 841d841..c36dda9 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -141,6 +141,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 	     __FUNCTION__, width, height, scrn->depth, scrn->bitsPerPixel));
 
 	assert(bo->tiling != I915_TILING_Y);
+	assert((bo->pitch & 63) == 0);
 
 	VG_CLEAR(arg);
 	arg.width = width;
@@ -2943,38 +2944,42 @@ void sna_mode_redisplay(struct sna *sna)
 
 		for (i = 0; i < config->num_crtc; i++) {
 			struct sna_crtc *crtc = config->crtc[i]->driver_private;
-			struct drm_mode_crtc_page_flip arg;
 
-			DBG(("%s: crtc %d active? %d\n",
-			     __FUNCTION__, i, crtc->bo != NULL));
+			DBG(("%s: crtc %d [%d, pipe=%d] active? %d\n",
+			     __FUNCTION__, i, crtc->id, crtc->pipe, crtc->bo != NULL));
 			if (crtc->bo != old)
 				continue;
 
-			arg.crtc_id = crtc->id;
-			arg.fb_id = get_fb(sna, new,
-					   sna->scrn->virtualX,
-					   sna->scrn->virtualY);
-			if (arg.fb_id == 0)
-				goto disable;
-
-			/* Only the reference crtc will finally deliver its page flip
-			 * completion event. All other crtc's events will be discarded.
-			 */
-			arg.user_data = 0;
-			arg.flags = DRM_MODE_PAGE_FLIP_EVENT;
-			arg.reserved = 0;
-
-			if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) {
-				DBG(("%s: flip [fb=%d] on crtc %d [%d] failed - %d\n",
-				     __FUNCTION__, arg.fb_id, i, crtc->id, errno));
+			assert(config->crtc[i]->enabled);
+
+			if (crtc->dpms_mode == DPMSModeOn) {
+				struct drm_mode_crtc_page_flip arg;
+				arg.crtc_id = crtc->id;
+				arg.fb_id = get_fb(sna, new,
+						   sna->scrn->virtualX,
+						   sna->scrn->virtualY);
+				if (arg.fb_id == 0)
+					goto disable;
+
+				/* Only the reference crtc will finally deliver its page flip
+				 * completion event. All other crtc's events will be discarded.
+				 */
+				arg.user_data = 0;
+				arg.flags = DRM_MODE_PAGE_FLIP_EVENT;
+				arg.reserved = 0;
+
+				if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) {
+					DBG(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n",
+					     __FUNCTION__, arg.fb_id, i, crtc->id, crtc->pipe, errno));
 disable:
-				sna_crtc_disable(config->crtc[i]);
-				continue;
+					sna_crtc_disable(config->crtc[i]);
+					continue;
+				}
+				sna->mode.shadow_flip++;
 			}
 
 			kgem_bo_destroy(&sna->kgem, old);
 			crtc->bo = kgem_bo_reference(new);
-			sna->mode.shadow_flip++;
 		}
 
 		if (sna->mode.shadow) {

commit 615739556dd1cc4565eb1c47f93fe8abd697802f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Aug 15 20:10:52 2012 +0100

    sna: Only continue to update the shadow buffer if the flips succeeded
    
    If the flip fail, we disable the crtc and may end up disabling the
    output, removing the shadow (and old scanout bo) in the process.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 7754efa..841d841 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2977,23 +2977,25 @@ disable:
 			sna->mode.shadow_flip++;
 		}
 
-		/* XXX only works if the kernel stalls fwrites to the current
-		 * scanout whilst the flip is pending
-		 */
-		while (sna->mode.shadow_flip)
-			sna_mode_wakeup(sna);
-		(void)sna->render.copy_boxes(sna, GXcopy,
-					     sna->front, new, 0, 0,
-					     sna->front, old, 0, 0,
-					     REGION_RECTS(region),
-					     REGION_NUM_RECTS(region),
-					     COPY_LAST);
-		kgem_submit(&sna->kgem);
-
-		sna_pixmap(sna->front)->gpu_bo = old;
-		sna->mode.shadow = new;
-
-		new->flush = old->flush;
+		if (sna->mode.shadow) {
+			/* XXX only works if the kernel stalls fwrites to the current
+			 * scanout whilst the flip is pending
+			 */
+			while (sna->mode.shadow_flip)
+				sna_mode_wakeup(sna);
+			(void)sna->render.copy_boxes(sna, GXcopy,
+						     sna->front, new, 0, 0,
+						     sna->front, old, 0, 0,
+						     REGION_RECTS(region),
+						     REGION_NUM_RECTS(region),
+						     COPY_LAST);
+			kgem_submit(&sna->kgem);
+
+			sna_pixmap(sna->front)->gpu_bo = old;
+			sna->mode.shadow = new;
+
+			new->flush = old->flush;
+		}
 
 		RegionEmpty(region);
 	}

commit 2554d0d76e0fcae6e324938c28bb50deeb8814dc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Aug 15 18:04:18 2012 +0100

    sna: Submit the batch upon destroying a ShmPixmap
    
    The midlayer has already detached the pixmap from the segment (possibly
    destroying that segment in the process, thanks midlayer!) so we need to
    submit the batch asap before the segment disappears.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6db986f..a3df628 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2186,13 +2186,14 @@ void _kgem_submit(struct kgem *kgem)
 							break;


Reply to: