xf86-video-intel: 2 commits - src/intel_list.h src/sna/sna_accel.c src/sna/sna_damage.c src/sna/sna_io.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jul 1 14:56:44 PDT 2013


 src/intel_list.h     |    2 +-
 src/sna/sna_accel.c  |    2 +-
 src/sna/sna_damage.c |   44 +++++++++++++++++++++-----------------------
 src/sna/sna_io.c     |    2 +-
 4 files changed, 24 insertions(+), 26 deletions(-)

New commits:
commit 24a7bec7faa7dcc4393ef7f66939ae0fb8acdf36
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jul 1 22:43:02 2013 +0100

    sna: Minor tweaks to make DBG compile again
    
    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 9d8bd4c..010f6e4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2352,10 +2352,10 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 
 	if (USE_INPLACE &&
 	    priv->gpu_damage &&
+	    priv->gpu_bo->tiling == I915_TILING_NONE &&
 	    (DAMAGE_IS_ALL(priv->gpu_damage) ||
 	     sna_damage_contains_box__no_reduce(priv->gpu_damage,
 						&region->extents)) &&
-	    priv->gpu_bo->tiling == I915_TILING_NONE &&
 	    kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE) &&
 	    ((flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == 0 ||
 	     !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) {
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index 30cc83b..cd478f4 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -116,7 +116,7 @@ static const char *_debug_describe_region(char *buf, int max,
 }
 
 static const char *_debug_describe_damage(char *buf, int max,
-					  struct sna_damage *damage)
+					  const struct sna_damage *damage)
 {
 	char damage_str[500], region_str[500];
 	int str_max;
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 7861462..0a38aa8 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -223,7 +223,7 @@ void sna_read_boxes(struct sna *sna, PixmapPtr dst, struct kgem_bo *src_bo,
 	bool can_blt;
 
 	DBG(("%s x %d, src=(handle=%d), dst=(size=(%d, %d)\n",
-	     __FUNCTION__, nbox, src_bo->handle, src_dy,
+	     __FUNCTION__, nbox, src_bo->handle,
 	     dst->drawable.width, dst->drawable.height));
 
 #ifndef NDEBUG
commit ad0afda3fe4f5e408e3610d8b76fdc7d1af33138
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jul 1 22:26:29 2013 +0100

    sna: Fix checking the dirty boxes
    
    I forgot how insane the data structure for the list of dirty boxes
    attached to the damage is. It is neither a simple list, nor does not store
    the count of boxes within each chunk.
    
    Fixes regression from
    commit 9026bb954646c0425360c2236e26c79d097142cd [2.21.11]
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Fri Jun 28 15:59:17 2013 +0100
    
        sna: Inspect the dirty boxes when querying whether damage contains a rectangle
    
    A side effect is that we now make sure that there is an upper bound to
    the amount of searching we do for the no-reduce fast path.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66430
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_list.h b/src/intel_list.h
index cfaa1ad..de0b683 100644
--- a/src/intel_list.h
+++ b/src/intel_list.h
@@ -264,7 +264,7 @@ static inline void list_move_tail(struct list *list, struct list *head)
  * @return True if the list contains one or more elements or False otherwise.
  */
 static inline bool
-list_is_empty(struct list *head)
+list_is_empty(const struct list *head)
 {
     return head->next == head;
 }
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index d2a876d..30cc83b 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -1341,46 +1341,44 @@ static bool box_overlaps(const BoxRec *a, const BoxRec *b)
 bool _sna_damage_contains_box__no_reduce(const struct sna_damage *damage,
 					 const BoxRec *box)
 {
-	struct sna_damage_box *iter;
-	int ret;
+	int n, count;
+	BoxPtr b;
 
 	assert(damage && damage->mode != DAMAGE_ALL);
 	if (!box_contains(&damage->extents, box))
 		return false;
 
-	ret = pixman_region_contains_rectangle(&damage->region, (BoxPtr)box);
+	n = pixman_region_contains_rectangle(&damage->region, (BoxPtr)box);
 	if (!damage->dirty)
-		return ret == PIXMAN_REGION_IN;
+		return n == PIXMAN_REGION_IN;
 
 	if (damage->mode == DAMAGE_ADD) {
-		if (ret == PIXMAN_REGION_IN)
+		if (n == PIXMAN_REGION_IN)
 			return true;
 
-		list_for_each_entry(iter, &damage->embedded_box.list, list) {
-			BoxPtr b;
-			int n;
+		count = damage->embedded_box.size;
+		if (list_is_empty(&damage->embedded_box.list))
+			count -= damage->remain;
 
-			b = (BoxPtr)(iter + 1);
-			for (n = 0; n < iter->size; n++) {
-				if (box_contains(&b[n], box))
-					return true;
-			}
+		b = damage->embedded_box.box;
+		for (n = 0; n < count; n++) {
+			if (box_contains(&b[n], box))
+				return true;
 		}
 
 		return false;
 	} else {
-		if (ret != PIXMAN_REGION_IN)
+		if (n != PIXMAN_REGION_IN)
 			return false;
 
-		list_for_each_entry(iter, &damage->embedded_box.list, list) {
-			BoxPtr b;
-			int n;
+		if (!list_is_empty(&damage->embedded_box.list))
+			return false;
 
-			b = (BoxPtr)(iter + 1);
-			for (n = 0; n < iter->size; n++) {
-				if (box_overlaps(&b[n], box))
-					return false;
-			}
+		count = damage->embedded_box.size - damage->remain;
+		b = damage->embedded_box.box;
+		for (n = 0; n < count; n++) {
+			if (box_overlaps(&b[n], box))
+				return false;
 		}
 
 		return true;


More information about the xorg-commit mailing list