diff options
| author | Ben Skeggs <skeggsb@gmail.com> | 2008-04-27 18:04:50 +1000 |
|---|---|---|
| committer | Ben Skeggs <skeggsb@gmail.com> | 2008-04-27 18:04:50 +1000 |
| commit | 0cca90cea1dbe1a76dbf9ac1985c3676ec460b0a (patch) | |
| tree | 6e496a5d77d13a9f1679006c3c5334e0b8d889f4 /src/gallium/auxiliary/pipebuffer | |
| parent | 7342688286cc3b7c938af2dfeac22df4fa8c8464 (diff) | |
| parent | a8e39b6f5a1fedf2f8719e1adb8802ebbfc09688 (diff) | |
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer')
| -rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 11 | ||||
| -rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_bufmgr.h | 3 | ||||
| -rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 12 |
3 files changed, 19 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 27032b0c4c..d3c1ec4fbe 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -34,6 +34,12 @@ */ +#include "pipe/p_config.h" + +#if defined(PIPE_OS_LINUX) +#include <unistd.h> +#endif + #include "pipe/p_compiler.h" #include "pipe/p_error.h" #include "pipe/p_debug.h" @@ -45,9 +51,6 @@ #include "pb_buffer.h" #include "pb_buffer_fenced.h" -#ifndef WIN32 -#include <unistd.h> -#endif /** @@ -425,7 +428,7 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list) /* Wait on outstanding fences */ while (fenced_list->numDelayed) { _glthread_UNLOCK_MUTEX(fenced_list->mutex); -#ifndef WIN32 +#if defined(PIPE_OS_LINUX) sched_yield(); #endif _fenced_buffer_list_check_free(fenced_list, 1); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h index 96f9af3825..8de286e3f9 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 543fd51253..4bd3f94a6c 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); } |
