panfrost: Add pan_bucket helper
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 15 Jul 2019 15:51:11 +0000 (08:51 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 15 Jul 2019 23:12:56 +0000 (16:12 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_bo_cache.c

index 4fb96c8efb5ff6111926a53a0300282bc7b9a32f..bdd7610b4001e5908f3b0b07ba83ae87e2415185 100644 (file)
@@ -66,6 +66,12 @@ pan_bucket_index(unsigned size)
         return (bucket_index - MIN_BO_CACHE_BUCKET);
 }
 
+static struct list_head *
+pan_bucket(struct panfrost_screen *screen, unsigned size)
+{
+        return &screen->bo_cache[pan_bucket_index(size)];
+}
+
 /* Tries to fetch a BO of sufficient size with the appropriate flags from the
  * BO cache. If it succeeds, it returns that BO and removes the BO from the
  * cache. If it fails, it returns NULL signaling the caller to allocate a new