aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/pipebuffer
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-03-05 12:32:06 +1100
committerTimothy Arceri <[email protected]>2017-03-07 08:53:05 +1100
commit628e84a58fdb26c63a705861b92f65f242613321 (patch)
treebd6084a4dee53a1f180c62f41e790ab490ddf3ee /src/gallium/auxiliary/pipebuffer
parentba72554f3e576c1674d52ab16d8d2edff9398b71 (diff)
gallium/util: replace pipe_mutex_unlock() with mtx_unlock()
pipe_mutex_unlock() was made unnecessary with fd33a6bcd7f12. Replaced using: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_unlock(\([^)]*\)):mtx_unlock(\&\1):g' {} \; Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c24
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c14
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c10
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c12
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c6
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_cache.c10
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_slab.c8
7 files changed, 42 insertions, 42 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index b8b448340db..7421741c17c 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -348,7 +348,7 @@ fenced_buffer_finish_locked(struct fenced_manager *fenced_mgr,
ops->fence_reference(ops, &fence, fenced_buf->fence);
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
finished = ops->fence_finish(ops, fenced_buf->fence, 0);
@@ -656,7 +656,7 @@ fenced_buffer_destroy(struct pb_buffer *buf)
fenced_buffer_destroy_locked(fenced_mgr, fenced_buf);
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
}
@@ -709,7 +709,7 @@ fenced_buffer_map(struct pb_buffer *buf,
}
done:
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
return map;
}
@@ -732,7 +732,7 @@ fenced_buffer_unmap(struct pb_buffer *buf)
fenced_buf->flags &= ~PB_USAGE_CPU_READ_WRITE;
}
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
}
@@ -802,7 +802,7 @@ fenced_buffer_validate(struct pb_buffer *buf,
fenced_buf->validation_flags |= flags;
done:
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
return ret;
}
@@ -841,7 +841,7 @@ fenced_buffer_fence(struct pb_buffer *buf,
fenced_buf->validation_flags = 0;
}
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
}
@@ -868,7 +868,7 @@ fenced_buffer_get_base_buffer(struct pb_buffer *buf,
*offset = 0;
}
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
}
@@ -941,12 +941,12 @@ fenced_bufmgr_create_buffer(struct pb_manager *mgr,
LIST_ADDTAIL(&fenced_buf->head, &fenced_mgr->unfenced);
++fenced_mgr->num_unfenced;
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
return &fenced_buf->base;
no_storage:
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
FREE(fenced_buf);
no_buffer:
return NULL;
@@ -961,7 +961,7 @@ fenced_bufmgr_flush(struct pb_manager *mgr)
mtx_lock(&fenced_mgr->mutex);
while (fenced_manager_check_signalled_locked(fenced_mgr, TRUE))
;
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
assert(fenced_mgr->provider->flush);
if (fenced_mgr->provider->flush)
@@ -978,7 +978,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
/* Wait on outstanding fences. */
while (fenced_mgr->num_fenced) {
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
sched_yield();
#endif
@@ -991,7 +991,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
/* assert(!fenced_mgr->num_unfenced); */
#endif
- pipe_mutex_unlock(fenced_mgr->mutex);
+ mtx_unlock(&fenced_mgr->mutex);
mtx_destroy(&fenced_mgr->mutex);
if (fenced_mgr->provider)
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
index 717ab9eefb4..df233c39878 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
@@ -238,7 +238,7 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf)
mtx_lock(&mgr->mutex);
LIST_DEL(&buf->head);
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
mtx_destroy(&buf->mutex);
@@ -263,7 +263,7 @@ pb_debug_buffer_map(struct pb_buffer *_buf,
mtx_lock(&buf->mutex);
++buf->map_count;
debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE);
- pipe_mutex_unlock(buf->mutex);
+ mtx_unlock(&buf->mutex);
return (uint8_t *)map + buf->underflow_size;
}
@@ -278,7 +278,7 @@ pb_debug_buffer_unmap(struct pb_buffer *_buf)
assert(buf->map_count);
if(buf->map_count)
--buf->map_count;
- pipe_mutex_unlock(buf->mutex);
+ mtx_unlock(&buf->mutex);
pb_unmap(buf->buffer);
@@ -310,7 +310,7 @@ pb_debug_buffer_validate(struct pb_buffer *_buf,
debug_printf("last map backtrace is\n");
debug_backtrace_dump(buf->map_backtrace, PB_DEBUG_MAP_BACKTRACE);
}
- pipe_mutex_unlock(buf->mutex);
+ mtx_unlock(&buf->mutex);
pb_debug_buffer_check(buf);
@@ -392,7 +392,7 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr,
debug_printf("%s: failed to create buffer\n", __FUNCTION__);
if(!LIST_IS_EMPTY(&mgr->list))
pb_debug_manager_dump_locked(mgr);
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
#endif
return NULL;
}
@@ -421,7 +421,7 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr,
mtx_lock(&mgr->mutex);
LIST_ADDTAIL(&buf->head, &mgr->list);
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
return &buf->base;
}
@@ -447,7 +447,7 @@ pb_debug_manager_destroy(struct pb_manager *_mgr)
debug_printf("%s: unfreed buffers\n", __FUNCTION__);
pb_debug_manager_dump_locked(mgr);
}
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
mtx_destroy(&mgr->mutex);
mgr->provider->destroy(mgr->provider);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
index 657b5f3d326..818cadd80a4 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
@@ -102,7 +102,7 @@ mm_buffer_destroy(struct pb_buffer *buf)
mtx_lock(&mm->mutex);
u_mmFreeMem(mm_buf->block);
FREE(mm_buf);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
}
@@ -188,7 +188,7 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
mm_buf = CALLOC_STRUCT(mm_buffer);
if (!mm_buf) {
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
return NULL;
}
@@ -208,7 +208,7 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
mmDumpMemInfo(mm->heap);
#endif
FREE(mm_buf);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
return NULL;
}
@@ -216,7 +216,7 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
assert(0 <= (pb_size)mm_buf->block->ofs && (pb_size)mm_buf->block->ofs < mm->size);
assert(size <= (pb_size)mm_buf->block->size && (pb_size)mm_buf->block->ofs + (pb_size)mm_buf->block->size <= mm->size);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
return SUPER(mm_buf);
}
@@ -240,7 +240,7 @@ mm_bufmgr_destroy(struct pb_manager *mgr)
pb_unmap(mm->buffer);
pb_reference(&mm->buffer, NULL);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
FREE(mgr);
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
index 83a5568a657..31087ae5f3a 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
@@ -113,7 +113,7 @@ pool_buffer_destroy(struct pb_buffer *buf)
mtx_lock(&pool->mutex);
LIST_ADD(&pool_buf->head, &pool->free);
pool->numFree++;
- pipe_mutex_unlock(pool->mutex);
+ mtx_unlock(&pool->mutex);
}
@@ -128,7 +128,7 @@ pool_buffer_map(struct pb_buffer *buf, unsigned flags, void *flush_ctx)
mtx_lock(&pool->mutex);
map = (unsigned char *) pool->map + pool_buf->start;
- pipe_mutex_unlock(pool->mutex);
+ mtx_unlock(&pool->mutex);
return map;
}
@@ -199,7 +199,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
mtx_lock(&pool->mutex);
if (pool->numFree == 0) {
- pipe_mutex_unlock(pool->mutex);
+ mtx_unlock(&pool->mutex);
debug_printf("warning: out of fixed size buffer objects\n");
return NULL;
}
@@ -207,7 +207,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
item = pool->free.next;
if (item == &pool->free) {
- pipe_mutex_unlock(pool->mutex);
+ mtx_unlock(&pool->mutex);
debug_printf("error: fixed size buffer pool corruption\n");
return NULL;
}
@@ -215,7 +215,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
LIST_DEL(item);
--pool->numFree;
- pipe_mutex_unlock(pool->mutex);
+ mtx_unlock(&pool->mutex);
pool_buf = LIST_ENTRY(struct pool_buffer, item, head);
assert(!pipe_is_referenced(&pool_buf->base.reference));
@@ -245,7 +245,7 @@ pool_bufmgr_destroy(struct pb_manager *mgr)
pb_unmap(pool->buffer);
pb_reference(&pool->buffer, NULL);
- pipe_mutex_unlock(pool->mutex);
+ mtx_unlock(&pool->mutex);
FREE(mgr);
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index 32e664633eb..a89236ed7c1 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -221,7 +221,7 @@ pb_slab_buffer_destroy(struct pb_buffer *_buf)
FREE(slab);
}
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
}
@@ -402,7 +402,7 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr,
if (mgr->slabs.next == &mgr->slabs) {
(void) pb_slab_create(mgr);
if (mgr->slabs.next == &mgr->slabs) {
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
return NULL;
}
}
@@ -418,7 +418,7 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr,
list = slab->freeBuffers.next;
LIST_DELINIT(list);
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
buf = LIST_ENTRY(struct pb_slab_buffer, list, head);
pipe_reference_init(&buf->base.reference, 1);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_cache.c b/src/gallium/auxiliary/pipebuffer/pb_cache.c
index 4a72cb5b302..9b75ff0c1ac 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_cache.c
@@ -98,7 +98,7 @@ pb_cache_add_buffer(struct pb_cache_entry *entry)
/* Directly release any buffer that exceeds the limit. */
if (mgr->cache_size + buf->size > mgr->max_cache_size) {
mgr->destroy_buffer(buf);
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
return;
}
@@ -107,7 +107,7 @@ pb_cache_add_buffer(struct pb_cache_entry *entry)
LIST_ADDTAIL(&entry->head, cache);
++mgr->num_buffers;
mgr->cache_size += buf->size;
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
}
/**
@@ -208,13 +208,13 @@ pb_cache_reclaim_buffer(struct pb_cache *mgr, pb_size size,
mgr->cache_size -= buf->size;
LIST_DEL(&entry->head);
--mgr->num_buffers;
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
/* Increase refcount */
pipe_reference_init(&buf->reference, 1);
return buf;
}
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
return NULL;
}
@@ -241,7 +241,7 @@ pb_cache_release_all_buffers(struct pb_cache *mgr)
next = curr->next;
}
}
- pipe_mutex_unlock(mgr->mutex);
+ mtx_unlock(&mgr->mutex);
}
void
diff --git a/src/gallium/auxiliary/pipebuffer/pb_slab.c b/src/gallium/auxiliary/pipebuffer/pb_slab.c
index 4a1b269e388..27022970870 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_slab.c
@@ -135,7 +135,7 @@ pb_slab_alloc(struct pb_slabs *slabs, unsigned size, unsigned heap)
* There's a chance that racing threads will end up allocating multiple
* slabs for the same group, but that doesn't hurt correctness.
*/
- pipe_mutex_unlock(slabs->mutex);
+ mtx_unlock(&slabs->mutex);
slab = slabs->slab_alloc(slabs->priv, heap, 1 << order, group_index);
if (!slab)
return NULL;
@@ -148,7 +148,7 @@ pb_slab_alloc(struct pb_slabs *slabs, unsigned size, unsigned heap)
LIST_DEL(&entry->head);
slab->num_free--;
- pipe_mutex_unlock(slabs->mutex);
+ mtx_unlock(&slabs->mutex);
return entry;
}
@@ -164,7 +164,7 @@ pb_slab_free(struct pb_slabs* slabs, struct pb_slab_entry *entry)
{
mtx_lock(&slabs->mutex);
LIST_ADDTAIL(&entry->head, &slabs->reclaim);
- pipe_mutex_unlock(slabs->mutex);
+ mtx_unlock(&slabs->mutex);
}
/* Check if any of the entries handed to pb_slab_free are ready to be re-used.
@@ -178,7 +178,7 @@ pb_slabs_reclaim(struct pb_slabs *slabs)
{
mtx_lock(&slabs->mutex);
pb_slabs_reclaim_locked(slabs);
- pipe_mutex_unlock(slabs->mutex);
+ mtx_unlock(&slabs->mutex);
}
/* Initialize the slabs manager.