xf86-video-intel: src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 7 07:44:39 PDT 2013


 src/sna/sna_dri.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 79145b70a7bda2941059ce7e630f84e2b24b465a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 7 15:33:51 2013 +0100

    sna/dri: Check rather than assert for a change in back/front sizes
    
    The DRI2 midlayer may, or may not, recreate the back buffer after a
    pixmap change. The result is that the back buffer may or may not be
    flagged as unsuitable for flipping, so be paranoid and double check.
    (This behaviour was first introduced in 1.9.0 and looks to be removed
    again in 1.15.0)
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 9e8a418..e610d52 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -281,12 +281,12 @@ sna_dri_create_buffer(DrawablePtr draw,
 
 		bo = ref(bo);
 		bpp = pixmap->drawable.bitsPerPixel;
-		DBG(("%s: attaching to front buffer %dx%d [%p:%d]\n",
-		     __FUNCTION__,
-		     pixmap->drawable.width, pixmap->drawable.height,
-		     pixmap, pixmap->refcnt));
 		if (pixmap == sna->front)
 			flags |= CREATE_SCANOUT;
+		DBG(("%s: attaching to front buffer %dx%d [%p:%d], scanout? %d\n",
+		     __FUNCTION__,
+		     pixmap->drawable.width, pixmap->drawable.height,
+		     pixmap, pixmap->refcnt, flags & CREATE_SCANOUT));
 		size = (uint32_t)pixmap->drawable.height << 16 | pixmap->drawable.width;
 		break;
 
@@ -299,6 +299,11 @@ sna_dri_create_buffer(DrawablePtr draw,
 		if (draw->width  == sna->front->drawable.width &&
 		    draw->height == sna->front->drawable.height)
 			flags |= CREATE_SCANOUT;
+		DBG(("%s: creating back buffer %dx%d, suitable for scanout? %d\n",
+		     __FUNCTION__,
+		     draw->width, draw->height,
+		     flags & CREATE_SCANOUT));
+
 		bo = kgem_create_2d(&sna->kgem,
 				    draw->width,
 				    draw->height,
@@ -1253,7 +1258,12 @@ can_flip(struct sna * sna,
 		     __FUNCTION__));
 		return false;
 	}
-	assert(get_private(back)->size == get_private(front)->size);
+
+	if (get_private(back)->size != get_private(front)->size) {
+		DBG(("%s: no, DRI2 drawable does not fit into scanout\n",
+		     __FUNCTION__));
+		return false;
+	}
 
 	DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n",
 	     __FUNCTION__,


More information about the xorg-commit mailing list