panfrost: Implement panfrost_bo_cache_evict_all
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 15 Jul 2019 16:17:12 +0000 (09:17 -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 4cbec51a2c1866a15c91fdf003a1191d3dbeba41..fba495c1dd6927410fa57e68b23037c8320eb38e 100644 (file)
@@ -127,7 +127,15 @@ void
 panfrost_bo_cache_evict_all(
                 struct panfrost_screen *screen)
 {
-        /* Stub */
+        for (unsigned i = 0; i < ARRAY_SIZE(screen->bo_cache); ++i) {
+                struct list_head *bucket = &screen->bo_cache[i];
+
+                list_for_each_entry_safe(struct panfrost_bo, entry, bucket, link) {
+                        list_del(&entry->link);
+                        panfrost_drm_release_bo(screen, entry, false);
+                }
+        }
+
         return;
 }