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

Chris Wilson ickle at kemper.freedesktop.org
Wed Jan 4 05:55:57 PST 2012


 src/sna/sna_accel.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 28a222a66bb450c7f6d61aef16fe73332854c8ce
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 4 12:48:25 2012 +0000

    sna: Always prefer to use cacheable operations after the GPU is wedged
    
    As rasterisation will be performed upon the CPU we need to avoid the
    readbacks form uncached memory and so we should restrict ourselves to
    only create further damage within the CPU pixmap.
    
    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 ff02849..43d7aa1 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -662,6 +662,9 @@ static inline bool pixmap_inplace(struct sna *sna,
 	if (FORCE_INPLACE)
 		return FORCE_INPLACE > 0;
 
+	if (wedged(sna))
+		return false;
+
 	if (priv->mapped)
 		return true;
 
@@ -838,6 +841,9 @@ static inline bool region_inplace(struct sna *sna,
 	if (FORCE_INPLACE)
 		return FORCE_INPLACE > 0;
 
+	if (wedged(sna))
+		return false;
+
 	if (priv->mapped)
 		return true;
 
commit 99ff83a3bebf1aa25c44a87f2c344307d20bc062
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 4 12:35:12 2012 +0000

    sna: Prevent creation of bo purely for GTT mapping when wedged
    
    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 c9f4add..ff02849 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -853,6 +853,9 @@ sna_pixmap_create_mappable_gpu(PixmapPtr pixmap)
 	struct sna *sna = to_sna_from_pixmap(pixmap);
 	struct sna_pixmap *priv = sna_pixmap(pixmap);;
 
+	if (wedged(sna))
+		return false;
+
 	assert(priv->gpu_bo == NULL);
 	priv->gpu_bo =
 		kgem_create_2d(&sna->kgem,
commit a7c35fa4c3155d10ad75ac33aefb03dafa010aba
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 4 12:33:09 2012 +0000

    sna: Only allow mappable pixmaps to be mapped
    
    If we did not allocate the pixel data, such as for wedged pixmaps or
    scratch buffers, then we cannot perform the pointer dance nor do we want
    to create the GPU buffer.
    
    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 3b3dc92..c9f4add 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -225,11 +225,14 @@ sna_pixmap_alloc_cpu(struct sna *sna,
 done:
 	pixmap->devPrivate.ptr = priv->ptr;
 	pixmap->devKind = priv->stride;
+	assert(priv->stride);
 	return priv->ptr != NULL;
 }
 
 static void sna_pixmap_free_cpu(struct sna *sna, struct sna_pixmap *priv)
 {
+	assert(priv->stride);
+
 	if (priv->cpu_bo) {
 		DBG(("%s: discarding CPU buffer, handle=%d, size=%d\n",
 		     __FUNCTION__, priv->cpu_bo->handle, priv->cpu_bo->size));
@@ -941,7 +944,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 			}
 		}
 
-		if (priv->gpu_bo == NULL &&
+		if (priv->gpu_bo == NULL && priv->stride &&
 		    sna_pixmap_choose_tiling(pixmap) != I915_TILING_NONE &&
 		    region_inplace(sna, pixmap, region, priv) &&
 		    sna_pixmap_create_mappable_gpu(pixmap)) {
commit 2cbc97d28aae138566e49df05e16d274b533ea86
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 4 12:32:06 2012 +0000

    sna: Force creation of ordinary pixmaps when wedged.
    
    If the pixmap was intended for scanout, then the GPU bo will be created
    upon attachment to the fb.
    
    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 9279b58..3b3dc92 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -563,6 +563,11 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
 	DBG(("%s(%d, %d, %d, usage=%x)\n", __FUNCTION__,
 	     width, height, depth, usage));
 
+	if (wedged(sna))
+		return create_pixmap(sna, screen,
+				     width, height, depth,
+				     usage);
+
 	if (usage == CREATE_PIXMAP_USAGE_SCRATCH)
 #if USE_BO_FOR_SCRATCH_PIXMAP
 		return sna_pixmap_create_scratch(screen,


More information about the xorg-commit mailing list