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

Chris Wilson ickle at kemper.freedesktop.org
Sat Dec 24 03:42:14 PST 2011


 src/sna/sna_accel.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 3bcc9f08e1309725c18dfa5ca0e905bb88ebf4ea
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Dec 24 09:59:24 2011 +0000

    sna: Create a GPU for a streaming write
    
    If we are about to do a write-only drawing operation that will exceed
    our cache, allocate a GPU bo and perform the operation inplace.
    
    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 c66ed66..859530f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -888,6 +888,23 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 				sna_pixmap_free_cpu(sna, priv);
 			}
 		}
+
+		if (priv->gpu_bo == NULL &&
+		    sna_pixmap_choose_tiling(pixmap) != I915_TILING_NONE &&
+		    region_inplace(sna, pixmap, region, priv)) {
+			sna_damage_subtract(&priv->cpu_damage, region);
+			if (sna_pixmap_move_to_gpu(pixmap, MOVE_WRITE)) {
+				pixmap->devPrivate.ptr =
+					kgem_bo_map(&sna->kgem, priv->gpu_bo,
+						    PROT_WRITE);
+				priv->mapped = 1;
+
+				sna_damage_add(&priv->gpu_damage, region);
+
+				priv->gpu = true;
+				return true;
+			}
+		}
 	}
 
 	if (priv->mapped) {


More information about the xorg-commit mailing list