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

Chris Wilson ickle at kemper.freedesktop.org
Tue Nov 8 03:04:46 PST 2011


 src/sna/sna_accel.c |   31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

New commits:
commit aeaadb16093f83c9b830958c5946d4d048ffd26b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Nov 8 11:03:19 2011 +0000

    sna: Handle creation of large Screen pixmap when the GPU is wedged
    
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=42606
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 11ae4d2..7294e3f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -262,15 +262,21 @@ struct sna_pixmap *sna_pixmap_attach(PixmapPtr pixmap)
 	case CREATE_PIXMAP_USAGE_SCRATCH_HEADER:
 #endif
 		return NULL;
-	}
 
-	sna = to_sna_from_drawable(&pixmap->drawable);
-	if (!kgem_can_create_2d(&sna->kgem,
-				pixmap->drawable.width,
-				pixmap->drawable.height,
-				pixmap->drawable.bitsPerPixel,
-				sna_pixmap_choose_tiling(pixmap)))
-		return NULL;
+	case SNA_CREATE_FB:
+		/* We assume that the Screen pixmap will be pre-validated */
+		break;
+
+	default:
+		sna = to_sna_from_drawable(&pixmap->drawable);
+		if (!kgem_can_create_2d(&sna->kgem,
+					pixmap->drawable.width,
+					pixmap->drawable.height,
+					pixmap->drawable.bitsPerPixel,
+					sna_pixmap_choose_tiling(pixmap)))
+			return NULL;
+		break;
+	}
 
 	return _sna_pixmap_attach(pixmap);
 }
@@ -941,13 +947,20 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap)
 
 	if (priv->gpu_bo == NULL) {
 		struct sna *sna = to_sna_from_drawable(&pixmap->drawable);
+		unsigned flags;
+
+		flags = 0;
+		if (priv->cpu_damage)
+			flags |= CREATE_INACTIVE;
+		if (pixmap->usage_hint == SNA_CREATE_FB)
+			flags |= CREATE_EXACT;
 
 		priv->gpu_bo = kgem_create_2d(&sna->kgem,
 					      pixmap->drawable.width,
 					      pixmap->drawable.height,
 					      pixmap->drawable.bitsPerPixel,
 					      sna_pixmap_choose_tiling(pixmap),
-					      priv->cpu_damage ? CREATE_INACTIVE : 0);
+					      flags);
 		if (priv->gpu_bo == NULL)
 			return NULL;
 


More information about the xorg-commit mailing list