diff options
author | Timothy Arceri <[email protected]> | 2017-03-05 12:12:30 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-07 08:52:38 +1100 |
commit | ba72554f3e576c1674d52ab16d8d2edff9398b71 (patch) | |
tree | 317c80f33ea1edcf238d3545ff1a6104a7d55fc8 /src/gallium/auxiliary/util | |
parent | be188289e1bf0e259c91a751c405d54bb99bc5d4 (diff) |
gallium/util: replace pipe_mutex_lock() with mtx_lock()
replace pipe_mutex_lock() was made unnecessary with fd33a6bcd7f12.
Replaced using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_lock(\([^)]*\)):mtx_lock(\&\1):g' {} \;
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_flush.c | 12 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_memory.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_refcnt.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_symbol.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.c | 18 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_range.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_ringbuffer.c | 4 |
7 files changed, 24 insertions, 24 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_flush.c b/src/gallium/auxiliary/util/u_debug_flush.c index bcce4f4ec1e..dde21f9f917 100644 --- a/src/gallium/auxiliary/util/u_debug_flush.c +++ b/src/gallium/auxiliary/util/u_debug_flush.c @@ -165,7 +165,7 @@ debug_flush_ctx_create(boolean catch_reference_of_mapped, unsigned bt_depth) goto out_no_ref_hash; fctx->bt_depth = bt_depth; - pipe_mutex_lock(list_mutex); + mtx_lock(&list_mutex); list_addtail(&fctx->head, &ctx_list); pipe_mutex_unlock(list_mutex); @@ -215,7 +215,7 @@ debug_flush_map(struct debug_flush_buf *fbuf, unsigned flags) if (!fbuf) return; - pipe_mutex_lock(fbuf->mutex); + mtx_lock(&fbuf->mutex); if (fbuf->mapped) { debug_flush_alert("Recursive map detected.", "Map", 2, fbuf->bt_depth, TRUE, TRUE, NULL); @@ -232,7 +232,7 @@ debug_flush_map(struct debug_flush_buf *fbuf, unsigned flags) if (mapped_sync) { struct debug_flush_ctx *fctx; - pipe_mutex_lock(list_mutex); + mtx_lock(&list_mutex); LIST_FOR_EACH_ENTRY(fctx, &ctx_list, head) { struct debug_flush_item *item = util_hash_table_get(fctx->ref_hash, fbuf); @@ -254,7 +254,7 @@ debug_flush_unmap(struct debug_flush_buf *fbuf) if (!fbuf) return; - pipe_mutex_lock(fbuf->mutex); + mtx_lock(&fbuf->mutex); if (!fbuf->mapped) debug_flush_alert("Unmap not previously mapped detected.", "Map", 2, fbuf->bt_depth, FALSE, TRUE, NULL); @@ -277,7 +277,7 @@ debug_flush_cb_reference(struct debug_flush_ctx *fctx, item = util_hash_table_get(fctx->ref_hash, fbuf); - pipe_mutex_lock(fbuf->mutex); + mtx_lock(&fbuf->mutex); if (fbuf->mapped_sync) { debug_flush_alert("Reference of mapped buffer detected.", "Reference", 2, fctx->bt_depth, TRUE, TRUE, NULL); @@ -320,7 +320,7 @@ debug_flush_might_flush_cb(void *key, void *value, void *data) util_snprintf(message, sizeof(message), "%s referenced mapped buffer detected.", reason); - pipe_mutex_lock(fbuf->mutex); + mtx_lock(&fbuf->mutex); if (fbuf->mapped_sync) { debug_flush_alert(message, reason, 3, item->bt_depth, TRUE, TRUE, NULL); debug_flush_alert(NULL, "Map", 0, fbuf->bt_depth, TRUE, FALSE, diff --git a/src/gallium/auxiliary/util/u_debug_memory.c b/src/gallium/auxiliary/util/u_debug_memory.c index 2f7031d6dfc..d5b0d916cbe 100644 --- a/src/gallium/auxiliary/util/u_debug_memory.c +++ b/src/gallium/auxiliary/util/u_debug_memory.c @@ -153,7 +153,7 @@ debug_malloc(const char *file, unsigned line, const char *function, ftr = footer_from_header(hdr); ftr->magic = DEBUG_MEMORY_MAGIC; - pipe_mutex_lock(list_mutex); + mtx_lock(&list_mutex); LIST_ADDTAIL(&hdr->head, &list); pipe_mutex_unlock(list_mutex); @@ -198,7 +198,7 @@ debug_free(const char *file, unsigned line, const char *function, /* set freed memory to special value */ memset(ptr, DEBUG_FREED_BYTE, hdr->size); #else - pipe_mutex_lock(list_mutex); + mtx_lock(&list_mutex); LIST_DEL(&hdr->head); pipe_mutex_unlock(list_mutex); hdr->magic = 0; @@ -273,7 +273,7 @@ debug_realloc(const char *file, unsigned line, const char *function, new_ftr = footer_from_header(new_hdr); new_ftr->magic = DEBUG_MEMORY_MAGIC; - pipe_mutex_lock(list_mutex); + mtx_lock(&list_mutex); LIST_REPLACE(&old_hdr->head, &new_hdr->head); pipe_mutex_unlock(list_mutex); diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c index 754ee8b1fe1..1db1787001c 100644 --- a/src/gallium/auxiliary/util/u_debug_refcnt.c +++ b/src/gallium/auxiliary/util/u_debug_refcnt.c @@ -94,7 +94,7 @@ debug_serial(void *p, unsigned *pserial) } #endif - pipe_mutex_lock(serials_mutex); + mtx_lock(&serials_mutex); if (!serials_hash) serials_hash = util_hash_table_create(hash_ptr, compare_ptr); @@ -126,7 +126,7 @@ debug_serial(void *p, unsigned *pserial) static void debug_serial_delete(void *p) { - pipe_mutex_lock(serials_mutex); + mtx_lock(&serials_mutex); util_hash_table_remove(serials_hash, p); pipe_mutex_unlock(serials_mutex); } diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c index 9a4eafa2ec0..de320b3e585 100644 --- a/src/gallium/auxiliary/util/u_debug_symbol.c +++ b/src/gallium/auxiliary/util/u_debug_symbol.c @@ -301,7 +301,7 @@ debug_symbol_name_cached(const void *addr) } #endif - pipe_mutex_lock(symbols_mutex); + mtx_lock(&symbols_mutex); if(!symbols_hash) symbols_hash = util_hash_table_create(hash_ptr, compare_ptr); name = util_hash_table_get(symbols_hash, (void*)addr); diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c index 092f91af3c5..2926d8c6bfc 100644 --- a/src/gallium/auxiliary/util/u_queue.c +++ b/src/gallium/auxiliary/util/u_queue.c @@ -47,7 +47,7 @@ atexit_handler(void) { struct util_queue *iter; - pipe_mutex_lock(exit_mutex); + mtx_lock(&exit_mutex); /* Wait for all queues to assert idle. */ LIST_FOR_EACH_ENTRY(iter, &queue_list, head) { util_queue_killall_and_wait(iter); @@ -67,7 +67,7 @@ add_to_atexit_list(struct util_queue *queue) { call_once(&atexit_once_flag, global_init); - pipe_mutex_lock(exit_mutex); + mtx_lock(&exit_mutex); LIST_ADD(&queue->head, &queue_list); pipe_mutex_unlock(exit_mutex); } @@ -77,7 +77,7 @@ remove_from_atexit_list(struct util_queue *queue) { struct util_queue *iter, *tmp; - pipe_mutex_lock(exit_mutex); + mtx_lock(&exit_mutex); LIST_FOR_EACH_ENTRY_SAFE(iter, tmp, &queue_list, head) { if (iter == queue) { LIST_DEL(&iter->head); @@ -94,7 +94,7 @@ remove_from_atexit_list(struct util_queue *queue) static void util_queue_fence_signal(struct util_queue_fence *fence) { - pipe_mutex_lock(fence->mutex); + mtx_lock(&fence->mutex); fence->signalled = true; cnd_broadcast(&fence->cond); pipe_mutex_unlock(fence->mutex); @@ -103,7 +103,7 @@ util_queue_fence_signal(struct util_queue_fence *fence) void util_queue_fence_wait(struct util_queue_fence *fence) { - pipe_mutex_lock(fence->mutex); + mtx_lock(&fence->mutex); while (!fence->signalled) cnd_wait(&fence->cond, &fence->mutex); pipe_mutex_unlock(fence->mutex); @@ -151,7 +151,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input) while (1) { struct util_queue_job job; - pipe_mutex_lock(queue->lock); + mtx_lock(&queue->lock); assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs); /* wait if the queue is empty */ @@ -180,7 +180,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input) } /* signal remaining jobs before terminating */ - pipe_mutex_lock(queue->lock); + mtx_lock(&queue->lock); while (queue->jobs[queue->read_idx].job) { util_queue_fence_signal(queue->jobs[queue->read_idx].fence); @@ -265,7 +265,7 @@ util_queue_killall_and_wait(struct util_queue *queue) unsigned i; /* Signal all threads to terminate. */ - pipe_mutex_lock(queue->lock); + mtx_lock(&queue->lock); queue->kill_threads = 1; cnd_broadcast(&queue->has_queued_cond); pipe_mutex_unlock(queue->lock); @@ -300,7 +300,7 @@ util_queue_add_job(struct util_queue *queue, assert(fence->signalled); fence->signalled = false; - pipe_mutex_lock(queue->lock); + mtx_lock(&queue->lock); assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs); /* if the queue is full, wait until there is space */ diff --git a/src/gallium/auxiliary/util/u_range.h b/src/gallium/auxiliary/util/u_range.h index d4a4ae1575d..a09dc9ae267 100644 --- a/src/gallium/auxiliary/util/u_range.h +++ b/src/gallium/auxiliary/util/u_range.h @@ -59,7 +59,7 @@ static inline void util_range_add(struct util_range *range, unsigned start, unsigned end) { if (start < range->start || end > range->end) { - pipe_mutex_lock(range->write_mutex); + mtx_lock(&range->write_mutex); range->start = MIN2(start, range->start); range->end = MAX2(end, range->end); pipe_mutex_unlock(range->write_mutex); diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c index c13517aa547..6a83d305c8a 100644 --- a/src/gallium/auxiliary/util/u_ringbuffer.c +++ b/src/gallium/auxiliary/util/u_ringbuffer.c @@ -76,7 +76,7 @@ void util_ringbuffer_enqueue( struct util_ringbuffer *ring, /* XXX: over-reliance on mutexes, etc: */ - pipe_mutex_lock(ring->mutex); + mtx_lock(&ring->mutex); /* make sure we don't request an impossible amount of space */ @@ -117,7 +117,7 @@ enum pipe_error util_ringbuffer_dequeue( struct util_ringbuffer *ring, /* XXX: over-reliance on mutexes, etc: */ - pipe_mutex_lock(ring->mutex); + mtx_lock(&ring->mutex); /* Get next ring entry: */ |