summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-18 15:39:35 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-18 15:39:35 +0000
commit1ad5320fd40eaaf0bffcd209bf1eabd9a20e4bf8 (patch)
tree788edfd2d759c0d5a88ed6a74af0304898e8b241
parentf3da610eadd1f560812603ab1a72c2e173679689 (diff)
sna: Add valgrind markup for tracking CPU mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 1866fcd6..f8242306 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -859,6 +859,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(CPU_MAP(bo->map), 0));
munmap(CPU_MAP(bo->map), bo->size);
bo->map = NULL;
@@ -2606,6 +2607,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(CPU_MAP(bo->map), 0));
munmap(CPU_MAP(bo->map), bo->size);
bo->map = NULL;
list_del(&bo->vma);
@@ -2707,6 +2709,8 @@ void *kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo)
return NULL;
}
+ VG(VALGRIND_MALLOCLIKE_BLOCK(mmap_arg.addr_ptr, bo->size, 0, 1));
+
DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle));
bo->map = MAKE_CPU_MAP(mmap_arg.addr_ptr);
return (void *)(uintptr_t)mmap_arg.addr_ptr;