From 21fcb2657f27e1a73059b026c10064d9c0970933 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 15 Sep 2021 15:16:48 -0700 Subject: [PATCH] freedreno/drm: Don't return shared/control bo's to cache They can never be allocated from the cache, as fd_bo_state() would return FD_BO_STATE_UNKNOWN Fixes: 7dabd624649 ("freedreno/drm: Userspace fences") Signed-off-by: Rob Clark Part-of: --- src/freedreno/drm/freedreno_bo_cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedreno/drm/freedreno_bo_cache.c b/src/freedreno/drm/freedreno_bo_cache.c index dbc21a65536..4fe9a00c811 100644 --- a/src/freedreno/drm/freedreno_bo_cache.c +++ b/src/freedreno/drm/freedreno_bo_cache.c @@ -185,6 +185,9 @@ retry: int fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo) { + if (bo->nosync || bo->shared) + return -1; + struct fd_bo_bucket *bucket = get_bucket(cache, bo->size); /* see if we can be green and recycle: */