summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
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
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')
-rw-r--r--src/gallium/auxiliary/hud/hud_cpufreq.c6
-rw-r--r--src/gallium/auxiliary/hud/hud_diskstat.c8
-rw-r--r--src/gallium/auxiliary/hud/hud_nic.c6
-rw-r--r--src/gallium/auxiliary/hud/hud_sensors_temp.c6
-rw-r--r--src/gallium/auxiliary/os/os_thread.h9
-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
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_execmem.c4
-rw-r--r--src/gallium/auxiliary/util/u_debug_flush.c12
-rw-r--r--src/gallium/auxiliary/util/u_debug_memory.c6
-rw-r--r--src/gallium/auxiliary/util/u_debug_refcnt.c4
-rw-r--r--src/gallium/auxiliary/util/u_debug_symbol.c2
-rw-r--r--src/gallium/auxiliary/util/u_queue.c20
-rw-r--r--src/gallium/auxiliary/util/u_range.h2
-rw-r--r--src/gallium/auxiliary/util/u_ringbuffer.c4
20 files changed, 85 insertions, 88 deletions
diff --git a/src/gallium/auxiliary/hud/hud_cpufreq.c b/src/gallium/auxiliary/hud/hud_cpufreq.c
index bc77e5a14f2..abb930d7e28 100644
--- a/src/gallium/auxiliary/hud/hud_cpufreq.c
+++ b/src/gallium/auxiliary/hud/hud_cpufreq.c
@@ -191,7 +191,7 @@ hud_get_num_cpufreq(bool displayhelp)
/* Return the number of CPU metrics we support. */
mtx_lock(&gcpufreq_mutex);
if (gcpufreq_count) {
- pipe_mutex_unlock(gcpufreq_mutex);
+ mtx_unlock(&gcpufreq_mutex);
return gcpufreq_count;
}
@@ -201,7 +201,7 @@ hud_get_num_cpufreq(bool displayhelp)
list_inithead(&gcpufreq_list);
DIR *dir = opendir("/sys/devices/system/cpu");
if (!dir) {
- pipe_mutex_unlock(gcpufreq_mutex);
+ mtx_unlock(&gcpufreq_mutex);
return 0;
}
@@ -247,7 +247,7 @@ hud_get_num_cpufreq(bool displayhelp)
}
}
- pipe_mutex_unlock(gcpufreq_mutex);
+ mtx_unlock(&gcpufreq_mutex);
return gcpufreq_count;
}
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c
index 940758a3480..df86abd12d8 100644
--- a/src/gallium/auxiliary/hud/hud_diskstat.c
+++ b/src/gallium/auxiliary/hud/hud_diskstat.c
@@ -248,7 +248,7 @@ hud_get_num_disks(bool displayhelp)
/* Return the number of block devices and partitions. */
mtx_lock(&gdiskstat_mutex);
if (gdiskstat_count) {
- pipe_mutex_unlock(gdiskstat_mutex);
+ mtx_unlock(&gdiskstat_mutex);
return gdiskstat_count;
}
@@ -258,7 +258,7 @@ hud_get_num_disks(bool displayhelp)
list_inithead(&gdiskstat_list);
DIR *dir = opendir("/sys/block/");
if (!dir) {
- pipe_mutex_unlock(gdiskstat_mutex);
+ mtx_unlock(&gdiskstat_mutex);
return 0;
}
@@ -285,7 +285,7 @@ hud_get_num_disks(bool displayhelp)
struct dirent *dpart;
DIR *pdir = opendir(basename);
if (!pdir) {
- pipe_mutex_unlock(gdiskstat_mutex);
+ mtx_unlock(&gdiskstat_mutex);
closedir(dir);
return 0;
}
@@ -320,7 +320,7 @@ hud_get_num_disks(bool displayhelp)
puts(line);
}
}
- pipe_mutex_unlock(gdiskstat_mutex);
+ mtx_unlock(&gdiskstat_mutex);
return gdiskstat_count;
}
diff --git a/src/gallium/auxiliary/hud/hud_nic.c b/src/gallium/auxiliary/hud/hud_nic.c
index ab74436ee20..835f92e2e04 100644
--- a/src/gallium/auxiliary/hud/hud_nic.c
+++ b/src/gallium/auxiliary/hud/hud_nic.c
@@ -333,7 +333,7 @@ hud_get_num_nics(bool displayhelp)
/* Return the number if network interfaces. */
mtx_lock(&gnic_mutex);
if (gnic_count) {
- pipe_mutex_unlock(gnic_mutex);
+ mtx_unlock(&gnic_mutex);
return gnic_count;
}
@@ -343,7 +343,7 @@ hud_get_num_nics(bool displayhelp)
list_inithead(&gnic_list);
DIR *dir = opendir("/sys/class/net/");
if (!dir) {
- pipe_mutex_unlock(gnic_mutex);
+ mtx_unlock(&gnic_mutex);
return 0;
}
@@ -419,7 +419,7 @@ hud_get_num_nics(bool displayhelp)
}
- pipe_mutex_unlock(gnic_mutex);
+ mtx_unlock(&gnic_mutex);
return gnic_count;
}
diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c b/src/gallium/auxiliary/hud/hud_sensors_temp.c
index 06d25901a39..29ee257ce86 100644
--- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
+++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
@@ -326,13 +326,13 @@ hud_get_num_sensors(bool displayhelp)
/* Return the number of sensors detected. */
mtx_lock(&gsensor_temp_mutex);
if (gsensors_temp_count) {
- pipe_mutex_unlock(gsensor_temp_mutex);
+ mtx_unlock(&gsensor_temp_mutex);
return gsensors_temp_count;
}
int ret = sensors_init(NULL);
if (ret) {
- pipe_mutex_unlock(gsensor_temp_mutex);
+ mtx_unlock(&gsensor_temp_mutex);
return 0;
}
@@ -368,7 +368,7 @@ hud_get_num_sensors(bool displayhelp)
}
}
- pipe_mutex_unlock(gsensor_temp_mutex);
+ mtx_unlock(&gsensor_temp_mutex);
return gsensors_temp_count;
}
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index 5b759659cae..a429f4eaf76 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -108,9 +108,6 @@ static inline int pipe_thread_is_self( pipe_thread thread )
return 0;
}
-#define pipe_mutex_unlock(mutex) \
- (void) mtx_unlock(&(mutex))
-
#define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
@@ -202,7 +199,7 @@ static inline void pipe_barrier_wait(pipe_barrier *barrier)
cnd_broadcast(&barrier->condvar);
}
- pipe_mutex_unlock(barrier->mutex);
+ mtx_unlock(&barrier->mutex);
}
@@ -243,7 +240,7 @@ pipe_semaphore_signal(pipe_semaphore *sema)
mtx_lock(&sema->mutex);
sema->counter++;
cnd_signal(&sema->cond);
- pipe_mutex_unlock(sema->mutex);
+ mtx_unlock(&sema->mutex);
}
/** Wait for semaphore counter to be greater than zero */
@@ -255,7 +252,7 @@ pipe_semaphore_wait(pipe_semaphore *sema)
cnd_wait(&sema->cond, &sema->mutex);
}
sema->counter--;
- pipe_mutex_unlock(sema->mutex);
+ mtx_unlock(&sema->mutex);
}
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.
diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
index a1c3de95fd5..fcb67a62de0 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
@@ -106,7 +106,7 @@ rtasm_exec_malloc(size_t size)
debug_printf("rtasm_exec_malloc failed\n");
bail:
- pipe_mutex_unlock(exec_mutex);
+ mtx_unlock(&exec_mutex);
return addr;
}
@@ -124,7 +124,7 @@ rtasm_exec_free(void *addr)
u_mmFreeMem(block);
}
- pipe_mutex_unlock(exec_mutex);
+ mtx_unlock(&exec_mutex);
}
diff --git a/src/gallium/auxiliary/util/u_debug_flush.c b/src/gallium/auxiliary/util/u_debug_flush.c
index dde21f9f917..06d0cfafa82 100644
--- a/src/gallium/auxiliary/util/u_debug_flush.c
+++ b/src/gallium/auxiliary/util/u_debug_flush.c
@@ -167,7 +167,7 @@ debug_flush_ctx_create(boolean catch_reference_of_mapped, unsigned bt_depth)
fctx->bt_depth = bt_depth;
mtx_lock(&list_mutex);
list_addtail(&fctx->head, &ctx_list);
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
return fctx;
@@ -227,7 +227,7 @@ debug_flush_map(struct debug_flush_buf *fbuf, unsigned flags)
}
fbuf->map_frame = debug_flush_capture_frame(1, fbuf->bt_depth);
fbuf->mapped = TRUE;
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
if (mapped_sync) {
struct debug_flush_ctx *fctx;
@@ -244,7 +244,7 @@ debug_flush_map(struct debug_flush_buf *fbuf, unsigned flags)
FALSE, FALSE, item->ref_frame);
}
}
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
}
}
@@ -263,7 +263,7 @@ debug_flush_unmap(struct debug_flush_buf *fbuf)
fbuf->mapped = FALSE;
FREE(fbuf->map_frame);
fbuf->map_frame = NULL;
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
}
void
@@ -284,7 +284,7 @@ debug_flush_cb_reference(struct debug_flush_ctx *fctx,
debug_flush_alert(NULL, "Map", 0, fbuf->bt_depth, FALSE,
FALSE, fbuf->map_frame);
}
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
if (!item) {
item = CALLOC_STRUCT(debug_flush_item);
@@ -328,7 +328,7 @@ debug_flush_might_flush_cb(void *key, void *value, void *data)
debug_flush_alert(NULL, "First reference", 0, item->bt_depth, FALSE,
FALSE, item->ref_frame);
}
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
return PIPE_OK;
}
diff --git a/src/gallium/auxiliary/util/u_debug_memory.c b/src/gallium/auxiliary/util/u_debug_memory.c
index d5b0d916cbe..1ba553cb6e7 100644
--- a/src/gallium/auxiliary/util/u_debug_memory.c
+++ b/src/gallium/auxiliary/util/u_debug_memory.c
@@ -155,7 +155,7 @@ debug_malloc(const char *file, unsigned line, const char *function,
mtx_lock(&list_mutex);
LIST_ADDTAIL(&hdr->head, &list);
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
return data_from_header(hdr);
}
@@ -200,7 +200,7 @@ debug_free(const char *file, unsigned line, const char *function,
#else
mtx_lock(&list_mutex);
LIST_DEL(&hdr->head);
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
hdr->magic = 0;
ftr->magic = 0;
@@ -275,7 +275,7 @@ debug_realloc(const char *file, unsigned line, const char *function,
mtx_lock(&list_mutex);
LIST_REPLACE(&old_hdr->head, &new_hdr->head);
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
/* copy data */
new_ptr = data_from_header(new_hdr);
diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c
index 1db1787001c..cb0158253e1 100644
--- a/src/gallium/auxiliary/util/u_debug_refcnt.c
+++ b/src/gallium/auxiliary/util/u_debug_refcnt.c
@@ -112,7 +112,7 @@ debug_serial(void *p, unsigned *pserial)
util_hash_table_set(serials_hash, p, (void *) (uintptr_t) serial);
found = FALSE;
}
- pipe_mutex_unlock(serials_mutex);
+ mtx_unlock(&serials_mutex);
*pserial = serial;
@@ -128,7 +128,7 @@ debug_serial_delete(void *p)
{
mtx_lock(&serials_mutex);
util_hash_table_remove(serials_hash, p);
- pipe_mutex_unlock(serials_mutex);
+ mtx_unlock(&serials_mutex);
}
diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c
index de320b3e585..f0b0629c8e8 100644
--- a/src/gallium/auxiliary/util/u_debug_symbol.c
+++ b/src/gallium/auxiliary/util/u_debug_symbol.c
@@ -313,6 +313,6 @@ debug_symbol_name_cached(const void *addr)
util_hash_table_set(symbols_hash, (void*)addr, (void*)name);
}
- pipe_mutex_unlock(symbols_mutex);
+ mtx_unlock(&symbols_mutex);
return name;
}
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c
index 2926d8c6bfc..25252300897 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -52,7 +52,7 @@ atexit_handler(void)
LIST_FOR_EACH_ENTRY(iter, &queue_list, head) {
util_queue_killall_and_wait(iter);
}
- pipe_mutex_unlock(exit_mutex);
+ mtx_unlock(&exit_mutex);
}
static void
@@ -69,7 +69,7 @@ add_to_atexit_list(struct util_queue *queue)
mtx_lock(&exit_mutex);
LIST_ADD(&queue->head, &queue_list);
- pipe_mutex_unlock(exit_mutex);
+ mtx_unlock(&exit_mutex);
}
static void
@@ -84,7 +84,7 @@ remove_from_atexit_list(struct util_queue *queue)
break;
}
}
- pipe_mutex_unlock(exit_mutex);
+ mtx_unlock(&exit_mutex);
}
/****************************************************************************
@@ -97,7 +97,7 @@ util_queue_fence_signal(struct util_queue_fence *fence)
mtx_lock(&fence->mutex);
fence->signalled = true;
cnd_broadcast(&fence->cond);
- pipe_mutex_unlock(fence->mutex);
+ mtx_unlock(&fence->mutex);
}
void
@@ -106,7 +106,7 @@ util_queue_fence_wait(struct util_queue_fence *fence)
mtx_lock(&fence->mutex);
while (!fence->signalled)
cnd_wait(&fence->cond, &fence->mutex);
- pipe_mutex_unlock(fence->mutex);
+ mtx_unlock(&fence->mutex);
}
void
@@ -159,7 +159,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
cnd_wait(&queue->has_queued_cond, &queue->lock);
if (queue->kill_threads) {
- pipe_mutex_unlock(queue->lock);
+ mtx_unlock(&queue->lock);
break;
}
@@ -169,7 +169,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
queue->num_queued--;
cnd_signal(&queue->has_space_cond);
- pipe_mutex_unlock(queue->lock);
+ mtx_unlock(&queue->lock);
if (job.job) {
job.execute(job.job, thread_index);
@@ -188,7 +188,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
queue->read_idx = (queue->read_idx + 1) % queue->max_jobs;
}
queue->num_queued = 0; /* reset this when exiting the thread */
- pipe_mutex_unlock(queue->lock);
+ mtx_unlock(&queue->lock);
return 0;
}
@@ -268,7 +268,7 @@ util_queue_killall_and_wait(struct util_queue *queue)
mtx_lock(&queue->lock);
queue->kill_threads = 1;
cnd_broadcast(&queue->has_queued_cond);
- pipe_mutex_unlock(queue->lock);
+ mtx_unlock(&queue->lock);
for (i = 0; i < queue->num_threads; i++)
pipe_thread_wait(queue->threads[i]);
@@ -317,7 +317,7 @@ util_queue_add_job(struct util_queue *queue,
queue->num_queued++;
cnd_signal(&queue->has_queued_cond);
- pipe_mutex_unlock(queue->lock);
+ mtx_unlock(&queue->lock);
}
int64_t
diff --git a/src/gallium/auxiliary/util/u_range.h b/src/gallium/auxiliary/util/u_range.h
index a09dc9ae267..7d3fc61aa32 100644
--- a/src/gallium/auxiliary/util/u_range.h
+++ b/src/gallium/auxiliary/util/u_range.h
@@ -62,7 +62,7 @@ util_range_add(struct util_range *range, unsigned start, unsigned end)
mtx_lock(&range->write_mutex);
range->start = MIN2(start, range->start);
range->end = MAX2(end, range->end);
- pipe_mutex_unlock(range->write_mutex);
+ mtx_unlock(&range->write_mutex);
}
}
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c
index 6a83d305c8a..fd51f266425 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -103,7 +103,7 @@ void util_ringbuffer_enqueue( struct util_ringbuffer *ring,
/* Signal change:
*/
cnd_signal(&ring->change);
- pipe_mutex_unlock(ring->mutex);
+ mtx_unlock(&ring->mutex);
}
enum pipe_error util_ringbuffer_dequeue( struct util_ringbuffer *ring,
@@ -155,6 +155,6 @@ out:
/* Signal change:
*/
cnd_signal(&ring->change);
- pipe_mutex_unlock(ring->mutex);
+ mtx_unlock(&ring->mutex);
return ret;
}