aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/panfrost/pan_bo_cache.c13
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c1
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.h3
3 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_bo_cache.c b/src/gallium/drivers/panfrost/pan_bo_cache.c
index 3804592b41d..d0ca99da136 100644
--- a/src/gallium/drivers/panfrost/pan_bo_cache.c
+++ b/src/gallium/drivers/panfrost/pan_bo_cache.c
@@ -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;
+}
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 27ff0020915..48ffde0d7b1 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -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);
}
diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h
index b90d9febad2..18866db049e 100644
--- a/src/gallium/drivers/panfrost/pan_screen.h
+++ b/src/gallium/drivers/panfrost/pan_screen.h
@@ -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 */