mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-21 20:30:34 +01:00
aux/pipebuffer: add a return to pb_cache_release_all_buffers()
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23073>
This commit is contained in:
parent
d065304367
commit
d4757ea67e
2 changed files with 5 additions and 2 deletions
|
|
@ -223,11 +223,12 @@ pb_cache_reclaim_buffer(struct pb_cache *mgr, pb_size size,
|
|||
/**
|
||||
* Empty the cache. Useful when there is not enough memory.
|
||||
*/
|
||||
void
|
||||
unsigned
|
||||
pb_cache_release_all_buffers(struct pb_cache *mgr)
|
||||
{
|
||||
struct list_head *curr, *next;
|
||||
struct pb_cache_entry *buf;
|
||||
unsigned num_reclaims = 0;
|
||||
unsigned i;
|
||||
|
||||
simple_mtx_lock(&mgr->mutex);
|
||||
|
|
@ -239,11 +240,13 @@ pb_cache_release_all_buffers(struct pb_cache *mgr)
|
|||
while (curr != cache) {
|
||||
buf = list_entry(curr, struct pb_cache_entry, head);
|
||||
destroy_buffer_locked(buf);
|
||||
num_reclaims++;
|
||||
curr = next;
|
||||
next = curr->next;
|
||||
}
|
||||
}
|
||||
simple_mtx_unlock(&mgr->mutex);
|
||||
return num_reclaims;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void pb_cache_add_buffer(struct pb_cache_entry *entry);
|
|||
struct pb_buffer *pb_cache_reclaim_buffer(struct pb_cache *mgr, pb_size size,
|
||||
unsigned alignment, unsigned usage,
|
||||
unsigned bucket_index);
|
||||
void pb_cache_release_all_buffers(struct pb_cache *mgr);
|
||||
unsigned pb_cache_release_all_buffers(struct pb_cache *mgr);
|
||||
void pb_cache_init_entry(struct pb_cache *mgr, struct pb_cache_entry *entry,
|
||||
struct pb_buffer *buf, unsigned bucket_index);
|
||||
void pb_cache_init(struct pb_cache *mgr, uint num_heaps,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue