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

Chris Wilson ickle at kemper.freedesktop.org
Mon Jan 21 08:52:49 PST 2013


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

New commits:
commit 10f549332e315cfe2cc86aadab94a95ae6757c34
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 21 16:48:34 2013 +0000

    sna: Free a non-reusable bo if it expires on the flushing list
    
    Still no sure just how the bo ends up there, but as there seems to be
    the occasional malinger, just free it.
    
    Reported-by: Jiri Slaby <jirislaby at gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index c93d971..6fa8ce4 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1766,6 +1766,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 			DBG(("%s: handle=%d -> flushing\n",
 			     __FUNCTION__, bo->handle));
 
+			assert(bo->reusable);
 			list_add(&bo->request, &kgem->flushing);
 			if (bucket(bo) < NUM_CACHE_BUCKETS)
 				cache = &kgem->active[bucket(bo)][bo->tiling];
@@ -1866,8 +1867,8 @@ static bool kgem_retire__flushing(struct kgem *kgem)
 		if (!bo->refcnt) {
 			if (bo->snoop) {
 				kgem_bo_move_to_snoop(kgem, bo);
-			} else if (kgem_bo_set_purgeable(kgem, bo)) {
-				assert(bo->reusable);
+			} else if (bo->reusable &&
+				   kgem_bo_set_purgeable(kgem, bo)) {
 				kgem_bo_move_to_inactive(kgem, bo);
 				retired = true;
 			} else
@@ -1925,12 +1926,8 @@ static bool __kgem_retire_rq(struct kgem *kgem, struct kgem_request *rq)
 			continue;
 
 		if (bo->snoop) {
-			if (bo->needs_flush) {
-				list_add(&bo->request, &kgem->flushing);
-				bo->rq = (void *)kgem;
-			} else {
+			if (!bo->needs_flush)
 				kgem_bo_move_to_snoop(kgem, bo);
-			}
 			continue;
 		}
 
@@ -2412,7 +2409,8 @@ void kgem_reset(struct kgem *kgem)
 			bo->rq = NULL;
 			bo->domain = DOMAIN_NONE;
 
-			if (!bo->refcnt) {
+			if (!bo->refcnt && !bo->reusable) {
+				assert(!bo->snoop);
 				DBG(("%s: discarding handle=%d\n",
 				     __FUNCTION__, bo->handle));
 				kgem_bo_free(kgem, bo);
commit d7f0df27edb20b052ad39beb26a0b1924f432618
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 21 16:34:09 2013 +0000

    sna: Use the maximum backlight value if we fail to read the current value
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 25c10de..967b88b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -197,13 +197,15 @@ sna_output_backlight_set(xf86OutputPtr output, int level)
 	char path[1024], val[BACKLIGHT_VALUE_LEN];
 	int fd, len, ret;
 
-	DBG(("%s: level=%d\n", __FUNCTION__, level));
+	DBG(("%s: level=%d, max=%d\n", __FUNCTION__,
+	     level, sna_output->backlight_max));
 
-	if (level > sna_output->backlight_max)
-		level = sna_output->backlight_max;
-	if (!sna_output->backlight_iface || level < 0)
+	if (!sna_output->backlight_iface)
 		return;
 
+	if ((unsigned)level > sna_output->backlight_max)
+		level = sna_output->backlight_max;
+
 	len = snprintf(val, BACKLIGHT_VALUE_LEN, "%d\n", level);
 	sprintf(path, "%s/%s/brightness",
 		BACKLIGHT_CLASS, sna_output->backlight_iface);


More information about the xorg-commit mailing list