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

Chris Wilson ickle at kemper.freedesktop.org
Thu Jun 9 08:02:35 PDT 2011


 src/sna/kgem.c      |    3 +++
 src/sna/sna_accel.c |   11 ++++++++---
 src/sna/sna_dri.c   |    7 ++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 1638a0a6c0b335dd31def93a9199f7407ae51170
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 9 16:00:30 2011 +0100

    sna/dri: Add a comment to warn about a potential race between DRI clients
    
    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 7fe9aff..9abc66d 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -376,7 +376,12 @@ sna_dri_copy_region(DrawablePtr drawable, RegionPtr region,
 	}
 	ValidateGC(dst, gc);
 
-	/* Invalidate src to reflect unknown modifications made by the client */
+	/* Invalidate src to reflect unknown modifications made by the client
+	 *
+	 * XXX But what about any conflicting shadow writes made by others
+	 * between the last flush and this request? Hopefully nobody will
+	 * hit that race window to find out...
+	 */
 	damage(src, region);
 
 	/* Wait for the scanline to be outside the region to be copied */
commit 4b54c89fbddc7aa72e5f2c5eded44e84bce70b77
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 9 15:53:11 2011 +0100

    sna: Place the pixmap on the DRI dirty list after damaging the shadow copy
    
    In order that we remember to flush the contents back to the GPU
    before we wake up the DRI clients, we need to add those dirty
    pixmaps to the flushing list. I caught the obvious place, the
    central move-to-cpu, but I missed a couple of paths were we
    optimise the copy onto the shadow.
    
    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 ead56df..af021b6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -902,6 +902,8 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 		assert_pixmap_contains_box(pixmap, RegionExtents(region));
 		sna_damage_subtract(&priv->gpu_damage, region);
 		sna_damage_add(&priv->cpu_damage, region);
+		if (priv->flush)
+			list_move(&priv->list, &sna->dirty_pixmaps);
 	}
 
 	get_drawable_deltas(drawable, pixmap, &dx, &dy);
@@ -1181,6 +1183,9 @@ fallback:
 							    &region);
 					sna_damage_add(&dst_priv->cpu_damage,
 						       &region);
+					if (dst_priv->flush)
+						list_move(&dst_priv->list,
+							  &sna->dirty_pixmaps);
 				}
 			} else
 				sna_drawable_move_region_to_cpu(&dst_pixmap->drawable,
commit 190a6786563aadd69f63bb7b509f3edf712e81ef
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 9 15:13:17 2011 +0100

    sna: Periodically reduce the gpu damage (after migrating any cpu damage)
    
    This will prevent the gpu damage list from growing unbounded.
    
    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 195d035..ead56df 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -773,6 +773,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap)
 	priv->cpu_damage = NULL;
 
 done:
+	sna_damage_reduce(&priv->gpu_damage);
 	list_del(&priv->list);
 	return priv;
 }
commit 38d084ee6241527193ba08c6600b6734e1833118
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 9 14:53:34 2011 +0100

    sna: Move !kgem->wedged check down into kgem_can_create_2d
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 9ed8160..c560531 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1176,6 +1176,9 @@ static bool _kgem_can_create_2d(struct kgem *kgem,
 	if (bpp < 8)
 		return false;
 
+	if (kgem->wedged)
+		return false;
+
 	size = kgem_surface_size(kgem, width, height, bpp, tiling, &pitch);
 	if (size == 0 || size > kgem->aperture_low)
 		size = kgem_surface_size(kgem, width, height, bpp, I915_TILING_NONE, &pitch);
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 6254d0c..195d035 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1045,8 +1045,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 
 		DBG(("%s: create dst GPU bo for copy\n", __FUNCTION__));
 
-		if (!sna->kgem.wedged &&
-		    kgem_can_create_2d(&sna->kgem,
+		if (kgem_can_create_2d(&sna->kgem,
 				       dst_pixmap->drawable.width,
 				       dst_pixmap->drawable.height,
 				       dst_pixmap->drawable.bitsPerPixel,
commit d1a3bb1467429310f5d17bf6afbf2eeb043ae64d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 9 14:51:49 2011 +0100

    sna: Prefer inactive buffers when creating a bo for a dirty pixmap
    
    As we will immediately attempt to replace it with an inactive when
    moving the data to the GPU, short-circuit that replacement.
    
    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 975799e..6254d0c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -685,7 +685,7 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap)
 					      pixmap->drawable.height,
 					      pixmap->drawable.bitsPerPixel,
 					      sna_pixmap_choose_tiling(pixmap),
-					      0);
+					      priv->cpu_damage ? CREATE_INACTIVE : 0);
 		if (priv->gpu_bo == NULL)
 			return NULL;
 


More information about the xorg-commit mailing list