xf86-video-intel: src/sna/kgem.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Nov 22 10:02:29 PST 2015


 src/sna/kgem.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 0995ad221d0bab03e4b4f9c1c36849fda2a51339
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Nov 22 17:59:34 2015 +0000

    sna: Remove obsolete assertion
    
    Once upon a time we only flagged th bo->purged when calling madvise and
    being told by the kernel that the bo was truncated. However, we now also
    preemptively set the flag on buffers we decide cannot be CPU mapped,
    invalidating the assertion.
    
    Reported-by: Jiri Slaby <jirislaby at gmail.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c64

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 9e32c7a..fefa475 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -870,27 +870,21 @@ static uint32_t gem_create(int fd, int num_pages)
 	return create.handle;
 }
 
-static bool
+static void
 kgem_bo_set_purgeable(struct kgem *kgem, struct kgem_bo *bo)
 {
-#if DBG_NO_MADV
-	return true;
-#else
+#if !DBG_NO_MADV
 	struct drm_i915_gem_madvise madv;
 
 	assert(bo->exec == NULL);
-	assert(!bo->purged);
 
 	VG_CLEAR(madv);
 	madv.handle = bo->handle;
 	madv.madv = I915_MADV_DONTNEED;
 	if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MADVISE, &madv) == 0) {
-		bo->purged = 1;
+		bo->purged = true;
 		kgem->need_purge |= !madv.retained && bo->domain != DOMAIN_CPU;
-		return madv.retained;
 	}
-
-	return true;
 #endif
 }
 


More information about the xorg-commit mailing list