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

Chris Wilson ickle at kemper.freedesktop.org
Fri May 11 06:06:07 PDT 2012


 src/sna/kgem.c           |   45 ++++++++++++++++++++++++---------------------
 src/sna/sna_trapezoids.c |    7 ++++---
 2 files changed, 28 insertions(+), 24 deletions(-)

New commits:
commit 6924fc525d6bc82901cfed769c176b44c0bce024
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri May 11 14:04:09 2012 +0100

    sna: Fix off-by-one in computation of width for inplace trapezoids
    
    This lead to the dropping of the last pixel for small area trapezoids,
    such as the right hand outline of buttons under ClearLooks.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48320
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 120e755..c06c29d 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -1581,11 +1581,11 @@ inplace_subrow(struct active_list *active, int8_t *row,
 					if (xstart < FAST_SAMPLES_X * width) {
 						FAST_SAMPLES_X_TO_INT_FRAC(xstart, ix, fx);
 						row[ix] -= FAST_SAMPLES_X - fx;
-						if (fx && ix + 1< width)
+						if (fx && ix + 1 < width)
 							row[++ix] -= fx;
 
-						if (ix > *max)
-							*max = ix;
+						if (ix >= *max)
+							*max = ix + 1;
 
 						xstart = INT_MIN;
 					} else
@@ -1622,6 +1622,7 @@ inplace_subrow(struct active_list *active, int8_t *row,
 		} else {
 			edge->prev->next = next;
 			next->prev = edge->prev;
+			active->min_height = -1;
 		}
 
 		edge = next;
commit a58a543e84ed15c41f4fa7644be3ba7865d31b92
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 10 12:59:55 2012 +0100

    sna: handle vmap creation failures gracefully
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f6a34ba..2abf9d5 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3451,8 +3451,11 @@ static uint32_t gem_vmap(int fd, void *ptr, int size, int read_only)
 	if (read_only)
 		vmap.flags |= I915_VMAP_READ_ONLY;
 
-	if (drmIoctl(fd, DRM_IOCTL_I915_GEM_VMAP, &vmap))
+	if (drmIoctl(fd, DRM_IOCTL_I915_GEM_VMAP, &vmap)) {
+		DBG(("%s: failed to map %p + %d bytes: %d\n",
+		     __FUNCTION__, ptr, size, errno));
 		return 0;
+	}
 
 	return vmap.handle;
 }
@@ -3764,9 +3767,9 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 			free(old);
 			bo->base.refcnt = 1;
 		} else {
-			if (!__kgem_bo_init(&bo->base,
-					    gem_create(kgem->fd, alloc),
-					    alloc)) {
+			uint32_t handle = gem_create(kgem->fd, alloc);
+			if (handle == 0 ||
+			    !__kgem_bo_init(&bo->base, handle, alloc)) {
 				free(bo);
 				return NULL;
 			}
@@ -3874,23 +3877,23 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 	if (kgem->has_vmap) {
 		bo = partial_bo_alloc(alloc);
 		if (bo) {
-			if (!__kgem_bo_init(&bo->base,
-					    gem_vmap(kgem->fd, bo->mem,
-						     alloc * PAGE_SIZE, false),
-					    alloc)) {
+			uint32_t handle = gem_vmap(kgem->fd, bo->mem,
+						   alloc * PAGE_SIZE, false);
+			if (handle == 0 ||
+			    !__kgem_bo_init(&bo->base, handle, alloc)) {
 				free(bo);
-				return NULL;
-			}
-
-			DBG(("%s: created vmap handle=%d for buffer\n",
-			     __FUNCTION__, bo->base.handle));
+				bo = NULL;
+			} else {
+				DBG(("%s: created vmap handle=%d for buffer\n",
+				     __FUNCTION__, bo->base.handle));
 
-			bo->need_io = false;
-			bo->base.io = true;
-			bo->base.vmap = true;
-			bo->mmapped = true;
+				bo->need_io = false;
+				bo->base.io = true;
+				bo->base.vmap = true;
+				bo->mmapped = true;
 
-			goto init;
+				goto init;
+			}
 		}
 	}
 
@@ -3942,9 +3945,9 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 			free(old);
 			bo->base.refcnt = 1;
 		} else {
-			if (!__kgem_bo_init(&bo->base,
-					    gem_create(kgem->fd, alloc),
-					    alloc)) {
+			uint32_t handle = gem_create(kgem->fd, alloc);
+			if (handle == 0 ||
+			    !__kgem_bo_init(&bo->base, handle, alloc)) {
 				free(bo);
 				return NULL;
 			}


More information about the xorg-commit mailing list