summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-04-24 01:59:57 +0900
committerJosé Fonseca <[email protected]>2008-04-24 02:13:41 +0900
commita75a3df851339c782e045e01c2b21ffadb1e09f5 (patch)
tree1a845631a907fc0ba00b82d64ae84c9a31d0a3de /src/gallium
parent53cf833af9776d47bd4c14906784aa8f2027dc4b (diff)
pipebuffer: New function to flush the buffer cache.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr.h3
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
index 96f9af3825f..8de286e3f94 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
@@ -144,6 +144,9 @@ struct pb_manager *
pb_cache_manager_create(struct pb_manager *provider,
unsigned usecs);
+void
+pb_cache_flush(struct pb_manager *mgr);
+
/**
* Fenced buffer manager.
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
index 543fd51253c..4bd3f94a6c0 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
@@ -294,8 +294,8 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
}
-static void
-pb_cache_manager_destroy(struct pb_manager *_mgr)
+void
+pb_cache_flush(struct pb_manager *_mgr)
{
struct pb_cache_manager *mgr = pb_cache_manager(_mgr);
struct list_head *curr, *next;
@@ -311,7 +311,13 @@ pb_cache_manager_destroy(struct pb_manager *_mgr)
next = curr->next;
}
_glthread_UNLOCK_MUTEX(mgr->mutex);
-
+}
+
+
+static void
+pb_cache_manager_destroy(struct pb_manager *mgr)
+{
+ pb_cache_flush(mgr);
FREE(mgr);
}