From ea754657eb77fdd11b7141693f4dc3ab1dc581cd Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 15 Jan 2024 16:59:47 +0100 Subject: [PATCH] etnaviv: drm: use COARSE clock for BO cache timing By using the the COARSE variant of the clock we can avoid a syscall to fetch the current time on platforms where the more accurate version of the clock can not be accelerated through the VDSO. The most relevant platform with this restriction is ARM32 without the architected timer extension, e.g. the NXP i.MX6. The COARSE clock degrades the accuracy of the timing to Linux jiffies, which means it adds a worst-case jitter of 10ms, which is basically noise in relation to the 1sec holding time of the cache and the irregular call pattern of etna_bo_cache_cleanup(). Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/etnaviv/drm/etnaviv_bo_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etnaviv/drm/etnaviv_bo_cache.c b/src/etnaviv/drm/etnaviv_bo_cache.c index ee6331bfaed..70a7bb8105a 100644 --- a/src/etnaviv/drm/etnaviv_bo_cache.c +++ b/src/etnaviv/drm/etnaviv_bo_cache.c @@ -181,7 +181,7 @@ int etna_bo_cache_free(struct etna_bo_cache *cache, struct etna_bo *bo) if (bucket) { struct timespec time; - clock_gettime(CLOCK_MONOTONIC, &time); + clock_gettime(CLOCK_MONOTONIC_COARSE, &time); bo->free_time = time.tv_sec; VG_BO_RELEASE(bo);