summaryrefslogtreecommitdiffstats
path: root/src/etnaviv/drm/etnaviv_bo_cache.c
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2019-06-09 00:18:29 +0200
committerLucas Stach <[email protected]>2019-08-14 10:36:20 +0200
commit6bb4b6d07816eb116dd07884b4f593916e3daf88 (patch)
treeb70a420ea45ef9a252882dcd5b501b89fa093f0c /src/etnaviv/drm/etnaviv_bo_cache.c
parentcf92074277f5d12a6812ead77c5a73419b4cbb83 (diff)
etnaviv: Add valgrind support
Add Valgrind support for etnaviv to track BO leaks. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/etnaviv/drm/etnaviv_bo_cache.c')
-rw-r--r--src/etnaviv/drm/etnaviv_bo_cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/etnaviv/drm/etnaviv_bo_cache.c b/src/etnaviv/drm/etnaviv_bo_cache.c
index 918d00d4e1d..3b28c1477aa 100644
--- a/src/etnaviv/drm/etnaviv_bo_cache.c
+++ b/src/etnaviv/drm/etnaviv_bo_cache.c
@@ -85,6 +85,7 @@ void etna_bo_cache_cleanup(struct etna_bo_cache *cache, time_t time)
if (time && ((time - bo->free_time) <= 1))
break;
+ VG_BO_OBTAIN(bo);
list_del(&bo->list);
_etna_bo_del(bo);
}
@@ -169,6 +170,7 @@ struct etna_bo *etna_bo_cache_alloc(struct etna_bo_cache *cache, uint32_t *size,
*size = bucket->size;
bo = find_in_bucket(bucket, flags);
if (bo) {
+ VG_BO_OBTAIN(bo);
p_atomic_set(&bo->refcnt, 1);
etna_device_ref(bo->dev);
return bo;
@@ -189,6 +191,7 @@ int etna_bo_cache_free(struct etna_bo_cache *cache, struct etna_bo *bo)
clock_gettime(CLOCK_MONOTONIC, &time);
bo->free_time = time.tv_sec;
+ VG_BO_RELEASE(bo);
list_addtail(&bo->list, &bucket->list);
etna_bo_cache_cleanup(cache, time.tv_sec);