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

Chris Wilson ickle at kemper.freedesktop.org
Fri Mar 2 02:02:35 PST 2012


 src/sna/kgem.c      |    2 +-
 src/sna/sna_accel.c |   12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 29ec36ff063472e0744af99aa81ed5ad8e291a36
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Mar 2 10:01:07 2012 +0000

    sna: Only discard the inplace flag for LLC partial buffers
    
    KGEM_BUFFER_WRITE_INPLACE is WRITE | INPLACE and so the typo prevented
    uploading of partial data through the pwrite paths.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index e4ff6a7..5776a4f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3356,7 +3356,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 	assert(size <= kgem->max_object_size);
 
 	if (kgem->has_llc)
-		flags &= ~KGEM_BUFFER_WRITE_INPLACE;
+		flags &= ~KGEM_BUFFER_INPLACE;
 
 	list_for_each_entry(bo, &kgem->active_partials, base.list) {
 		/* We can reuse any write buffer which we can fit */
commit f039ccf9587eb07528034c3247a6e700c87a5500
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Mar 2 09:47:10 2012 +0000

    sna: Be careful not to discard the clear operation for move-region-to-cpu
    
    When moving only a region to the CPU and we detect a pending clear, we
    transform the operation into a move whole pixmap. In such situations, we
    only have a partial damage area and so need to or in MOVE_READ to
    prevent the pending clear of the whole pixmap from being discarded.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=46792
    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 52e75c7..c427808 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -922,6 +922,8 @@ _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
 
 	if ((flags & MOVE_READ) == 0) {
 		assert(flags & MOVE_WRITE);
+		DBG(("%s: no readbck, discarding gpu damage [%d], pending clear[%d]\n",
+		     __FUNCTION__, priv->gpu_damage != NULL, priv->clear));
 		sna_damage_destroy(&priv->gpu_damage);
 		priv->clear = false;
 
@@ -1273,9 +1275,6 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		goto out;
 	}
 
-	if (priv->clear)
-		return _sna_pixmap_move_to_cpu(pixmap, flags);
-
 	if (priv->gpu_bo == NULL &&
 	    (priv->create & KGEM_CAN_CREATE_GPU) == 0 &&
 	    flags & MOVE_WRITE)
@@ -1293,6 +1292,13 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		return _sna_pixmap_move_to_cpu(pixmap, flags);
 	}
 
+	if (priv->clear) {
+		DBG(("%s: pending clear, moving whole pixmap\n", __FUNCTION__));
+		if (dx | dy)
+			RegionTranslate(region, -dx, -dy);
+		return _sna_pixmap_move_to_cpu(pixmap, flags | MOVE_READ);
+	}
+
 	if ((flags & MOVE_READ) == 0) {
 		DBG(("%s: no read, checking to see if we can stream the write into the GPU bo\n",
 		     __FUNCTION__));


More information about the xorg-commit mailing list