From 133c1aba051f838a7651c966bdedc1e972d3e029 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 21 Apr 2020 18:23:00 -0400 Subject: [PATCH] panfrost: Fix crashes with small BOs Affects Bifrost. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/encoder/pan_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/encoder/pan_bo.c b/src/panfrost/encoder/pan_bo.c index aca4f8f3848..9e5ea7ed21e 100644 --- a/src/panfrost/encoder/pan_bo.c +++ b/src/panfrost/encoder/pan_bo.c @@ -270,7 +270,7 @@ panfrost_bo_cache_put(struct panfrost_bo *bo) return false; pthread_mutex_lock(&dev->bo_cache.lock); - struct list_head *bucket = pan_bucket(dev, bo->size); + struct list_head *bucket = pan_bucket(dev, MAX2(bo->size, 4096)); struct drm_panfrost_madvise madv; struct timespec time; -- 2.30.2