Mesa (master): panfrost: Fix crashes with small BOs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 22 01:16:17 UTC 2020


Module: Mesa
Branch: master
Commit: 133c1aba051f838a7651c966bdedc1e972d3e029
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=133c1aba051f838a7651c966bdedc1e972d3e029

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Apr 21 18:23:00 2020 -0400

panfrost: Fix crashes with small BOs

Affects Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4671>

---

 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;
 



More information about the mesa-commit mailing list