diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-30 10:37:22 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-30 10:37:22 +0100 |
commit | 47e2db0ba8ae3fbcdf58cba26c58ec0932b4c90b (patch) | |
tree | ec86fa641bc79c82046d214eda77e8fe17c1b116 /src/sna/kgem.c | |
parent | 08a630dc5ef87e551865e558fe4fc45ea66457b4 (diff) |
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@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r-- | src/sna/kgem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 85879368..828df037 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); |