xf86-video-intel: src/sna/kgem.c
Chris Wilson
ickle at kemper.freedesktop.org
Wed May 30 02:45:14 PDT 2012
src/sna/kgem.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 47e2db0ba8ae3fbcdf58cba26c58ec0932b4c90b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed May 30 10:37:22 2012 +0100
sna: Replace FREELIKE_BLOCK with MAKE_MEM_NOACCESS
And similarly for MALLOCLIKE_BLOCK. The issue being that valgrind may
overwrite such blocks with alloc-fill and free-fill values, but when in
fact they are defined and still in use by the GPU. This can lead to the
GPU processing garbage, and GPU hangs.
Reported-by: Zdenek Kabelac <zdenek.kabelac at gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8587936..828df03 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -984,7 +984,7 @@ static void kgem_bo_release_map(struct kgem *kgem, struct kgem_bo *bo)
__FUNCTION__, type ? "CPU" : "GTT",
bo->handle, kgem->vma[type].count));
- VG(if (type) VALGRIND_FREELIKE_BLOCK(MAP(bo->map), 0));
+ VG(if (type) VALGRIND_MAKE_MEM_NOACCESS(MAP(bo->map), bytes(bo)));
munmap(MAP(bo->map), bytes(bo));
bo->map = NULL;
@@ -3194,7 +3194,7 @@ static void kgem_trim_vma_cache(struct kgem *kgem, int type, int bucket)
assert(bo->map);
assert(bo->rq == NULL);
- VG(if (type) VALGRIND_FREELIKE_BLOCK(MAP(bo->map), 0));
+ VG(if (type) VALGRIND_MAKE_MEM_NOACCESS(MAP(bo->map), bytes(bo)));
munmap(MAP(bo->map), bytes(bo));
bo->map = NULL;
list_del(&bo->vma);
@@ -3348,7 +3348,7 @@ retry:
return NULL;
}
- VG(VALGRIND_MALLOCLIKE_BLOCK(mmap_arg.addr_ptr, bytes(bo), 0, 1));
+ VG(VALGRIND_MAKE_MEM_DEFINED(mmap_arg.addr_ptr, bytes(bo)));
DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle));
bo->map = MAKE_CPU_MAP(mmap_arg.addr_ptr);
More information about the xorg-commit
mailing list