panfrost: Stub out panfrost_bo_cache_evict
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 15 Jul 2019 15:22:33 +0000 (08:22 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 15 Jul 2019 23:12:56 +0000 (16:12 -0700)
This destructor will be used to legitimately free the BOs, now that a BO
free with cacheable=0 is only a "fake" free.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_bo_cache.c
src/gallium/drivers/panfrost/pan_screen.c
src/gallium/drivers/panfrost/pan_screen.h

index 3804592b41d683751c6ee2fe1e82a06637195ce4..d0ca99da13662bb55bd5ee102bb94722dfec810b 100644 (file)
@@ -47,4 +47,17 @@ panfrost_bo_cache_put(
         return false;
 }
 
+/* Evicts all BOs from the cache. Called during context
+ * destroy or during low-memory situations (to free up
+ * memory that may be unused by us just sitting in our
+ * cache, but still reserved from the perspective of the
+ * OS) */
+
+void
+panfrost_bo_cache_evict_all(
+                struct panfrost_screen *screen)
+{
+        /* Stub */
+        return;
+}
 
index 27ff0020915b55712d51c7c3100aa0daee70bf65..48ffde0d7b15f68e51f31ad97d7875d1f2d1ecd2 100644 (file)
@@ -443,6 +443,7 @@ static void
 panfrost_destroy_screen(struct pipe_screen *pscreen)
 {
         struct panfrost_screen *screen = pan_screen(pscreen);
+        panfrost_bo_cache_evict_all(screen);
         ralloc_free(screen);
 }
 
index b90d9febad206c00b7f366c2abea70a918878887..18866db049edc4b64fc57d4a6e288ff6b2b9c11b 100644 (file)
@@ -171,5 +171,8 @@ panfrost_bo_cache_put(
                 struct panfrost_screen *screen,
                 struct panfrost_bo *bo);
 
+void
+panfrost_bo_cache_evict_all(
+                struct panfrost_screen *screen);
 
 #endif /* PAN_SCREEN_H */