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 <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27079>
This commit is contained in:
Lucas Stach
2024-01-15 16:59:47 +01:00
committed by Marge Bot
parent 235ce3df9b
commit ea754657eb

View File

@@ -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);