From a75a3df851339c782e045e01c2b21ffadb1e09f5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 24 Apr 2008 01:59:57 +0900 Subject: pipebuffer: New function to flush the buffer cache. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr.h | 3 +++ src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary') 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); } -- cgit v1.2.3