[Mesa-dev] [PATCH 4/7] gallium/util: replace pipe_mutex_destroy() with mtx_destroy()
Timothy Arceri
tarceri at itsqueeze.com
Sun Mar 5 01:32:04 UTC 2017
pipe_mutex_destroy() was made unnecessary with fd33a6bcd7f12.
Replace was done with:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_destroy(\([^)]*\)):mtx_destroy(\&\1):g' {} \;
---
src/gallium/auxiliary/os/os_thread.h | 7 ++-----
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 2 +-
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 4 ++--
src/gallium/auxiliary/pipebuffer/pb_cache.c | 2 +-
src/gallium/auxiliary/pipebuffer/pb_slab.c | 2 +-
src/gallium/auxiliary/util/u_queue.c | 6 +++---
src/gallium/auxiliary/util/u_range.h | 2 +-
src/gallium/auxiliary/util/u_ringbuffer.c | 2 +-
src/gallium/drivers/ddebug/dd_context.c | 4 ++--
src/gallium/drivers/freedreno/freedreno_screen.c | 2 +-
src/gallium/drivers/llvmpipe/lp_fence.c | 2 +-
src/gallium/drivers/llvmpipe/lp_scene.c | 2 +-
src/gallium/drivers/llvmpipe/lp_screen.c | 2 +-
src/gallium/drivers/nouveau/nv50/nv50_surface.c | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_surface.c | 2 +-
src/gallium/drivers/r300/r300_screen.c | 2 +-
src/gallium/drivers/radeon/r600_pipe_common.c | 4 ++--
src/gallium/drivers/radeonsi/si_pipe.c | 2 +-
src/gallium/drivers/radeonsi/si_state_shaders.c | 4 ++--
src/gallium/drivers/svga/svga_screen.c | 4 ++--
src/gallium/drivers/svga/svga_screen_cache.c | 2 +-
src/gallium/state_trackers/dri/dri_screen.c | 2 +-
src/gallium/state_trackers/nine/nine_queue.c | 4 ++--
src/gallium/state_trackers/nine/nine_state.c | 2 +-
src/gallium/state_trackers/va/context.c | 2 +-
src/gallium/state_trackers/vdpau/decode.c | 2 +-
src/gallium/state_trackers/vdpau/device.c | 2 +-
src/gallium/targets/haiku-softpipe/GalliumContext.cpp | 2 +-
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 4 ++--
src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 2 +-
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 10 +++++-----
src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c | 2 +-
src/gallium/winsys/svga/drm/vmw_surface.c | 2 +-
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 4 ++--
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c | 2 +-
35 files changed, 50 insertions(+), 53 deletions(-)
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index cccb531..571e3c6 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -101,23 +101,20 @@ static inline int pipe_thread_is_self( pipe_thread thread )
{
#if defined(HAVE_PTHREAD)
# if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
(__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
# endif
#endif
return 0;
}
-#define pipe_mutex_destroy(mutex) \
- mtx_destroy(&(mutex))
-
#define pipe_mutex_lock(mutex) \
(void) mtx_lock(&(mutex))
#define pipe_mutex_unlock(mutex) \
(void) mtx_unlock(&(mutex))
#define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
static inline void
@@ -178,21 +175,21 @@ static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
barrier->count = count;
barrier->waiters = 0;
barrier->sequence = 0;
(void) mtx_init(&barrier->mutex, mtx_plain);
cnd_init(&barrier->condvar);
}
static inline void pipe_barrier_destroy(pipe_barrier *barrier)
{
assert(barrier->waiters == 0);
- pipe_mutex_destroy(barrier->mutex);
+ mtx_destroy(&barrier->mutex);
cnd_destroy(&barrier->condvar);
}
static inline void pipe_barrier_wait(pipe_barrier *barrier)
{
pipe_mutex_lock(barrier->mutex);
assert(barrier->waiters < barrier->count);
barrier->waiters++;
@@ -231,21 +228,21 @@ static inline void
pipe_semaphore_init(pipe_semaphore *sema, int init_val)
{
(void) mtx_init(&sema->mutex, mtx_plain);
cnd_init(&sema->cond);
sema->counter = init_val;
}
static inline void
pipe_semaphore_destroy(pipe_semaphore *sema)
{
- pipe_mutex_destroy(sema->mutex);
+ mtx_destroy(&sema->mutex);
cnd_destroy(&sema->cond);
}
/** Signal/increment semaphore counter */
static inline void
pipe_semaphore_signal(pipe_semaphore *sema)
{
pipe_mutex_lock(sema->mutex);
sema->counter++;
cnd_signal(&sema->cond);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index fefdcef..b3b7828 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -985,21 +985,21 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
pipe_mutex_lock(fenced_mgr->mutex);
while (fenced_manager_check_signalled_locked(fenced_mgr, TRUE))
;
}
#ifdef DEBUG
/* assert(!fenced_mgr->num_unfenced); */
#endif
pipe_mutex_unlock(fenced_mgr->mutex);
- pipe_mutex_destroy(fenced_mgr->mutex);
+ mtx_destroy(&fenced_mgr->mutex);
if (fenced_mgr->provider)
fenced_mgr->provider->destroy(fenced_mgr->provider);
fenced_mgr->ops->destroy(fenced_mgr->ops);
FREE(fenced_mgr);
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
index f614abf..33f068e 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
@@ -233,21 +233,21 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf)
struct pb_debug_manager *mgr = buf->mgr;
assert(!pipe_is_referenced(&buf->base.reference));
pb_debug_buffer_check(buf);
pipe_mutex_lock(mgr->mutex);
LIST_DEL(&buf->head);
pipe_mutex_unlock(mgr->mutex);
- pipe_mutex_destroy(buf->mutex);
+ mtx_destroy(&buf->mutex);
pb_reference(&buf->buffer, NULL);
FREE(buf);
}
static void *
pb_debug_buffer_map(struct pb_buffer *_buf,
unsigned flags, void *flush_ctx)
{
@@ -442,21 +442,21 @@ pb_debug_manager_destroy(struct pb_manager *_mgr)
{
struct pb_debug_manager *mgr = pb_debug_manager(_mgr);
pipe_mutex_lock(mgr->mutex);
if(!LIST_IS_EMPTY(&mgr->list)) {
debug_printf("%s: unfreed buffers\n", __FUNCTION__);
pb_debug_manager_dump_locked(mgr);
}
pipe_mutex_unlock(mgr->mutex);
- pipe_mutex_destroy(mgr->mutex);
+ mtx_destroy(&mgr->mutex);
mgr->provider->destroy(mgr->provider);
FREE(mgr);
}
struct pb_manager *
pb_debug_manager_create(struct pb_manager *provider,
pb_size underflow_size, pb_size overflow_size)
{
struct pb_debug_manager *mgr;
diff --git a/src/gallium/auxiliary/pipebuffer/pb_cache.c b/src/gallium/auxiliary/pipebuffer/pb_cache.c
index 422318c..adae222 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_cache.c
@@ -291,12 +291,12 @@ pb_cache_init(struct pb_cache *mgr, uint usecs, float size_factor,
mgr->can_reclaim = can_reclaim;
}
/**
* Deinitialize the manager completely.
*/
void
pb_cache_deinit(struct pb_cache *mgr)
{
pb_cache_release_all_buffers(mgr);
- pipe_mutex_destroy(mgr->mutex);
+ mtx_destroy(&mgr->mutex);
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_slab.c b/src/gallium/auxiliary/pipebuffer/pb_slab.c
index 6f6664f..9ad88db 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_slab.c
@@ -241,12 +241,12 @@ pb_slabs_deinit(struct pb_slabs *slabs)
/* Reclaim all slab entries (even those that are still in flight). This
* implicitly calls slab_free for everything.
*/
while (!LIST_IS_EMPTY(&slabs->reclaim)) {
struct pb_slab_entry *entry =
LIST_ENTRY(struct pb_slab_entry, slabs->reclaim.next, head);
pb_slab_reclaim(slabs, entry);
}
FREE(slabs->groups);
- pipe_mutex_destroy(slabs->mutex);
+ mtx_destroy(&slabs->mutex);
}
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c
index 56a9fa8..092f91a 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -116,21 +116,21 @@ util_queue_fence_init(struct util_queue_fence *fence)
(void) mtx_init(&fence->mutex, mtx_plain);
cnd_init(&fence->cond);
fence->signalled = true;
}
void
util_queue_fence_destroy(struct util_queue_fence *fence)
{
assert(fence->signalled);
cnd_destroy(&fence->cond);
- pipe_mutex_destroy(fence->mutex);
+ mtx_destroy(&fence->mutex);
}
/****************************************************************************
* util_queue implementation
*/
struct thread_input {
struct util_queue *queue;
int thread_index;
};
@@ -244,21 +244,21 @@ util_queue_init(struct util_queue *queue,
add_to_atexit_list(queue);
return true;
fail:
FREE(queue->threads);
if (queue->jobs) {
cnd_destroy(&queue->has_space_cond);
cnd_destroy(&queue->has_queued_cond);
- pipe_mutex_destroy(queue->lock);
+ mtx_destroy(&queue->lock);
FREE(queue->jobs);
}
/* also util_queue_is_initialized can be used to check for success */
memset(queue, 0, sizeof(*queue));
return false;
}
static void
util_queue_killall_and_wait(struct util_queue *queue)
{
@@ -276,21 +276,21 @@ util_queue_killall_and_wait(struct util_queue *queue)
}
void
util_queue_destroy(struct util_queue *queue)
{
util_queue_killall_and_wait(queue);
remove_from_atexit_list(queue);
cnd_destroy(&queue->has_space_cond);
cnd_destroy(&queue->has_queued_cond);
- pipe_mutex_destroy(queue->lock);
+ mtx_destroy(&queue->lock);
FREE(queue->jobs);
FREE(queue->threads);
}
void
util_queue_add_job(struct util_queue *queue,
void *job,
struct util_queue_fence *fence,
util_queue_execute_func execute,
util_queue_execute_func cleanup)
diff --git a/src/gallium/auxiliary/util/u_range.h b/src/gallium/auxiliary/util/u_range.h
index 24c78ba..d4a4ae1 100644
--- a/src/gallium/auxiliary/util/u_range.h
+++ b/src/gallium/auxiliary/util/u_range.h
@@ -78,14 +78,14 @@ util_ranges_intersect(struct util_range *range, unsigned start, unsigned end)
static inline void
util_range_init(struct util_range *range)
{
(void) mtx_init(&range->write_mutex, mtx_plain);
util_range_set_empty(range);
}
static inline void
util_range_destroy(struct util_range *range)
{
- pipe_mutex_destroy(range->write_mutex);
+ mtx_destroy(&range->write_mutex);
}
#endif
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c
index fce1133..c13517a 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -41,21 +41,21 @@ struct util_ringbuffer *util_ringbuffer_create( unsigned dwords )
fail:
FREE(ring->buf);
FREE(ring);
return NULL;
}
void util_ringbuffer_destroy( struct util_ringbuffer *ring )
{
cnd_destroy(&ring->change);
- pipe_mutex_destroy(ring->mutex);
+ mtx_destroy(&ring->mutex);
FREE(ring->buf);
FREE(ring);
}
/**
* Return number of free entries in the ring
*/
static inline unsigned util_ringbuffer_space( const struct util_ringbuffer *ring )
{
return (ring->tail - (ring->head + 1)) & ring->mask;
diff --git a/src/gallium/drivers/ddebug/dd_context.c b/src/gallium/drivers/ddebug/dd_context.c
index 1ce4a3b..550f764 100644
--- a/src/gallium/drivers/ddebug/dd_context.c
+++ b/src/gallium/drivers/ddebug/dd_context.c
@@ -591,21 +591,21 @@ static void
dd_context_destroy(struct pipe_context *_pipe)
{
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
if (dctx->thread) {
pipe_mutex_lock(dctx->mutex);
dctx->kill_thread = 1;
pipe_mutex_unlock(dctx->mutex);
pipe_thread_wait(dctx->thread);
- pipe_mutex_destroy(dctx->mutex);
+ mtx_destroy(&dctx->mutex);
assert(!dctx->records);
}
if (dctx->fence) {
pipe->transfer_unmap(pipe, dctx->fence_transfer);
pipe_resource_reference(&dctx->fence, NULL);
}
pipe->destroy(pipe);
FREE(dctx);
}
@@ -866,21 +866,21 @@ dd_context_create(struct dd_screen *dscreen, struct pipe_context *pipe)
PIPE_TRANSFER_COHERENT,
&dctx->fence_transfer);
if (!dctx->mapped_fence)
goto fail;
*dctx->mapped_fence = 0;
(void) mtx_init(&dctx->mutex, mtx_plain);
dctx->thread = pipe_thread_create(dd_thread_pipelined_hang_detect, dctx);
if (!dctx->thread) {
- pipe_mutex_destroy(dctx->mutex);
+ mtx_destroy(&dctx->mutex);
goto fail;
}
}
return &dctx->base;
fail:
if (dctx) {
if (dctx->mapped_fence)
pipe_transfer_unmap(pipe, dctx->fence_transfer);
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index 3f43b8d..4a461fd 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -135,21 +135,21 @@ fd_screen_destroy(struct pipe_screen *pscreen)
if (screen->pipe)
fd_pipe_del(screen->pipe);
if (screen->dev)
fd_device_del(screen->dev);
fd_bc_fini(&screen->batch_cache);
slab_destroy_parent(&screen->transfer_pool);
- pipe_mutex_destroy(screen->lock);
+ mtx_destroy(&screen->lock);
free(screen);
}
/*
TODO either move caps to a2xx/a3xx specific code, or maybe have some
tables for things that differ if the delta is not too much..
*/
static int
fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
diff --git a/src/gallium/drivers/llvmpipe/lp_fence.c b/src/gallium/drivers/llvmpipe/lp_fence.c
index 04c1483..ec26bfe 100644
--- a/src/gallium/drivers/llvmpipe/lp_fence.c
+++ b/src/gallium/drivers/llvmpipe/lp_fence.c
@@ -65,21 +65,21 @@ lp_fence_create(unsigned rank)
}
/** Destroy a fence. Called when refcount hits zero. */
void
lp_fence_destroy(struct lp_fence *fence)
{
if (LP_DEBUG & DEBUG_FENCE)
debug_printf("%s %d\n", __FUNCTION__, fence->id);
- pipe_mutex_destroy(fence->mutex);
+ mtx_destroy(&fence->mutex);
cnd_destroy(&fence->signalled);
FREE(fence);
}
/**
* Called by the rendering threads to increment the fence counter.
* When the counter == the rank, the fence is finished.
*/
void
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index 0d619ef..66dd1d2 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -83,21 +83,21 @@ lp_scene_create( struct pipe_context *pipe )
}
/**
* Free all data associated with the given scene, and the scene itself.
*/
void
lp_scene_destroy(struct lp_scene *scene)
{
lp_fence_reference(&scene->fence, NULL);
- pipe_mutex_destroy(scene->mutex);
+ mtx_destroy(&scene->mutex);
assert(scene->data.head->next == NULL);
FREE(scene->data.head);
FREE(scene);
}
/**
* Check if the scene's bins are all empty.
* For debugging purposes.
*/
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index f5f7e71..4bc202c 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -554,21 +554,21 @@ llvmpipe_destroy_screen( struct pipe_screen *_screen )
struct sw_winsys *winsys = screen->winsys;
if (screen->rast)
lp_rast_destroy(screen->rast);
lp_jit_screen_cleanup(screen);
if(winsys->destroy)
winsys->destroy(winsys);
- pipe_mutex_destroy(screen->rast_mutex);
+ mtx_destroy(&screen->rast_mutex);
FREE(screen);
}
/**
* Fence reference counting.
*/
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index 5635e9f..46cd2e6 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -1773,21 +1773,21 @@ nv50_blitter_destroy(struct nv50_screen *screen)
for (m = 0; m < NV50_BLIT_MODES; ++m) {
struct nv50_program *prog = blitter->fp[i][m];
if (prog) {
nv50_program_destroy(NULL, prog);
FREE((void *)prog->pipe.tokens);
FREE(prog);
}
}
}
- pipe_mutex_destroy(blitter->mutex);
+ mtx_destroy(&blitter->mutex);
FREE(blitter);
}
bool
nv50_blitctx_create(struct nv50_context *nv50)
{
nv50->blit = CALLOC_STRUCT(nv50_blitctx);
if (!nv50->blit) {
NOUVEAU_ERR("failed to allocate blit context\n");
return false;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index 5720937..1e91fa8 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -1682,21 +1682,21 @@ nvc0_blitter_destroy(struct nvc0_screen *screen)
for (m = 0; m < NV50_BLIT_MODES; ++m) {
struct nvc0_program *prog = blitter->fp[i][m];
if (prog) {
nvc0_program_destroy(NULL, prog);
FREE((void *)prog->pipe.tokens);
FREE(prog);
}
}
}
- pipe_mutex_destroy(blitter->mutex);
+ mtx_destroy(&blitter->mutex);
FREE(blitter);
}
bool
nvc0_blitctx_create(struct nvc0_context *nvc0)
{
nvc0->blit = CALLOC_STRUCT(nvc0_blitctx);
if (!nvc0->blit) {
NOUVEAU_ERR("failed to allocate blit context\n");
return false;
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 392b0bb..9a2400d 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -677,21 +677,21 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
}
static void r300_destroy_screen(struct pipe_screen* pscreen)
{
struct r300_screen* r300screen = r300_screen(pscreen);
struct radeon_winsys *rws = radeon_winsys(pscreen);
if (rws && !rws->unref(rws))
return;
- pipe_mutex_destroy(r300screen->cmask_mutex);
+ mtx_destroy(&r300screen->cmask_mutex);
slab_destroy_parent(&r300screen->pool_transfers);
if (rws)
rws->destroy(rws);
FREE(r300screen);
}
static void r300_fence_reference(struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 2fae5ed..a257d81 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -1353,22 +1353,22 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
printf("enabled_rb_mask = 0x%x\n", rscreen->info.enabled_rb_mask);
}
return true;
}
void r600_destroy_common_screen(struct r600_common_screen *rscreen)
{
r600_perfcounters_destroy(rscreen);
r600_gpu_load_kill_thread(rscreen);
- pipe_mutex_destroy(rscreen->gpu_load_mutex);
- pipe_mutex_destroy(rscreen->aux_context_lock);
+ mtx_destroy(&rscreen->gpu_load_mutex);
+ mtx_destroy(&rscreen->aux_context_lock);
rscreen->aux_context->destroy(rscreen->aux_context);
slab_destroy_parent(&rscreen->pool_transfers);
disk_cache_destroy(rscreen->disk_shader_cache);
rscreen->ws->destroy(rscreen->ws);
FREE(rscreen);
}
bool r600_can_dump_shader(struct r600_common_screen *rscreen,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 5494b11..571c2f1 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -705,21 +705,21 @@ static void si_destroy_screen(struct pipe_screen* pscreen)
/* Free shader parts. */
for (i = 0; i < ARRAY_SIZE(parts); i++) {
while (parts[i]) {
struct si_shader_part *part = parts[i];
parts[i] = part->next;
radeon_shader_binary_clean(&part->binary);
FREE(part);
}
}
- pipe_mutex_destroy(sscreen->shader_parts_mutex);
+ mtx_destroy(&sscreen->shader_parts_mutex);
si_destroy_shader_cache(sscreen);
r600_destroy_common_screen(&sscreen->b);
}
static bool si_init_gs_info(struct si_screen *sscreen)
{
switch (sscreen->b.family) {
case CHIP_OLAND:
case CHIP_HAINAN:
case CHIP_KAVERI:
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 20410ce..c370f15 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -306,21 +306,21 @@ bool si_init_shader_cache(struct si_screen *sscreen)
si_shader_cache_key_equals);
return sscreen->shader_cache != NULL;
}
void si_destroy_shader_cache(struct si_screen *sscreen)
{
if (sscreen->shader_cache)
_mesa_hash_table_destroy(sscreen->shader_cache,
si_destroy_shader_cache_entry);
- pipe_mutex_destroy(sscreen->shader_cache_mutex);
+ mtx_destroy(&sscreen->shader_cache_mutex);
}
/* SHADER STATES */
static void si_set_tesseval_regs(struct si_screen *sscreen,
struct si_shader *shader,
struct si_pm4_state *pm4)
{
struct tgsi_shader_info *info = &shader->selector->info;
unsigned tes_prim_mode = info->properties[TGSI_PROPERTY_TES_PRIM_MODE];
@@ -1953,21 +1953,21 @@ static void si_delete_shader_selector(struct pipe_context *ctx, void *state)
if (sel->main_shader_part)
si_delete_shader(sctx, sel->main_shader_part);
if (sel->main_shader_part_ls)
si_delete_shader(sctx, sel->main_shader_part_ls);
if (sel->main_shader_part_es)
si_delete_shader(sctx, sel->main_shader_part_es);
if (sel->gs_copy_shader)
si_delete_shader(sctx, sel->gs_copy_shader);
util_queue_fence_destroy(&sel->ready);
- pipe_mutex_destroy(sel->mutex);
+ mtx_destroy(&sel->mutex);
free(sel->tokens);
free(sel);
}
static unsigned si_get_ps_input_cntl(struct si_context *sctx,
struct si_shader *vs, unsigned name,
unsigned index, unsigned interpolate)
{
struct tgsi_shader_info *vsinfo = &vs->selector->info;
unsigned j, offset, ps_input_cntl = 0;
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 479b6fc..72c142d 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -912,22 +912,22 @@ svga_get_driver_query_info(struct pipe_screen *screen,
}
static void
svga_destroy_screen( struct pipe_screen *screen )
{
struct svga_screen *svgascreen = svga_screen(screen);
svga_screen_cache_cleanup(svgascreen);
- pipe_mutex_destroy(svgascreen->swc_mutex);
- pipe_mutex_destroy(svgascreen->tex_mutex);
+ mtx_destroy(&svgascreen->swc_mutex);
+ mtx_destroy(&svgascreen->tex_mutex);
svgascreen->sws->destroy(svgascreen->sws);
FREE(svgascreen);
}
/**
* Create a new svga_screen object
*/
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c
index 514fc00..c14996d 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.c
+++ b/src/gallium/drivers/svga/svga_screen_cache.c
@@ -389,21 +389,21 @@ svga_screen_cache_cleanup(struct svga_screen *svgascreen)
"unref sid %p (shutdown)\n", cache->entries[i].handle);
sws->surface_reference(sws, &cache->entries[i].handle, NULL);
cache->total_size -= surface_size(&cache->entries[i].key);
}
if (cache->entries[i].fence)
sws->fence_reference(sws, &cache->entries[i].fence, NULL);
}
- pipe_mutex_destroy(cache->mutex);
+ mtx_destroy(&cache->mutex);
}
enum pipe_error
svga_screen_cache_init(struct svga_screen *svgascreen)
{
struct svga_host_surface_cache *cache = &svgascreen->cache;
unsigned i;
assert(cache->total_size == 0);
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index c2da7e3..02260b5 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -395,21 +395,21 @@ dri_destroy_option_cache(struct dri_screen * screen)
void
dri_destroy_screen_helper(struct dri_screen * screen)
{
if (screen->st_api && screen->st_api->destroy)
screen->st_api->destroy(screen->st_api);
if (screen->base.screen)
screen->base.screen->destroy(screen->base.screen);
dri_destroy_option_cache(screen);
- pipe_mutex_destroy(screen->opencl_func_mutex);
+ mtx_destroy(&screen->opencl_func_mutex);
}
void
dri_destroy_screen(__DRIscreen * sPriv)
{
struct dri_screen *screen = dri_screen(sPriv);
dri_destroy_screen_helper(screen);
pipe_loader_release(&screen->dev, 1);
diff --git a/src/gallium/state_trackers/nine/nine_queue.c b/src/gallium/state_trackers/nine/nine_queue.c
index 30b0e30..07dfee5 100644
--- a/src/gallium/state_trackers/nine/nine_queue.c
+++ b/src/gallium/state_trackers/nine/nine_queue.c
@@ -258,18 +258,18 @@ failed:
}
FREE(ctx);
}
return NULL;
}
void
nine_queue_delete(struct nine_queue_pool *ctx)
{
unsigned i;
- pipe_mutex_destroy(ctx->mutex_pop);
- pipe_mutex_destroy(ctx->mutex_push);
+ mtx_destroy(&ctx->mutex_pop);
+ mtx_destroy(&ctx->mutex_push);
for (i = 0; i < NINE_CMD_BUFS; i++)
FREE(ctx->pool[i].mem_pool);
FREE(ctx);
}
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index a331f7c..978fa01 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -226,21 +226,21 @@ nine_csmt_destroy( struct NineDevice9 *device, struct csmt_context *ctx )
assert(instr);
instr->func = nop_func;
p_atomic_set(&ctx->processed, FALSE);
/* Signal worker to terminate. */
p_atomic_set(&ctx->terminate, TRUE);
nine_queue_flush(ctx->pool);
nine_csmt_wait_processed(ctx);
nine_queue_delete(ctx->pool);
- pipe_mutex_destroy(ctx->mutex_processed);
+ mtx_destroy(&ctx->mutex_processed);
FREE(ctx);
pipe_thread_wait(render_thread);
}
static void
nine_csmt_pause( struct NineDevice9 *device )
{
struct csmt_context *ctx = device->csmt_ctx;
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 84bb805..36e314f 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -344,15 +344,15 @@ vlVaTerminate(VADriverContextP ctx)
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
drv = ctx->pDriverData;
vl_compositor_cleanup_state(&drv->cstate);
vl_compositor_cleanup(&drv->compositor);
drv->pipe->destroy(drv->pipe);
drv->vscreen->destroy(drv->vscreen);
handle_table_destroy(drv->htab);
- pipe_mutex_destroy(drv->mutex);
+ mtx_destroy(&drv->mutex);
FREE(drv);
return VA_STATUS_SUCCESS;
}
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index 628e503..387371b 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -159,21 +159,21 @@ vlVdpDecoderDestroy(VdpDecoder decoder)
{
vlVdpDecoder *vldecoder;
vldecoder = (vlVdpDecoder *)vlGetDataHTAB(decoder);
if (!vldecoder)
return VDP_STATUS_INVALID_HANDLE;
pipe_mutex_lock(vldecoder->mutex);
vldecoder->decoder->destroy(vldecoder->decoder);
pipe_mutex_unlock(vldecoder->mutex);
- pipe_mutex_destroy(vldecoder->mutex);
+ mtx_destroy(&vldecoder->mutex);
vlRemoveDataHTAB(decoder);
DeviceReference(&vldecoder->device, NULL);
FREE(vldecoder);
return VDP_STATUS_OK;
}
/**
* Retrieve the parameters used to create a VdpDecoder.
diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c
index 15652f0..3ae3da3 100644
--- a/src/gallium/state_trackers/vdpau/device.c
+++ b/src/gallium/state_trackers/vdpau/device.c
@@ -226,21 +226,21 @@ vlVdpDeviceDestroy(VdpDevice device)
return VDP_STATUS_OK;
}
/**
* Free a VdpDevice.
*/
void
vlVdpDeviceFree(vlVdpDevice *dev)
{
- pipe_mutex_destroy(dev->mutex);
+ mtx_destroy(&dev->mutex);
vl_compositor_cleanup(&dev->compositor);
pipe_sampler_view_reference(&dev->dummy_sv, NULL);
dev->context->destroy(dev->context);
dev->vscreen->destroy(dev->vscreen);
FREE(dev);
vlDestroyHTAB();
}
/**
* Retrieve a VDPAU function pointer.
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
index df222f6..9662149 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
@@ -62,21 +62,21 @@ GalliumContext::GalliumContext(ulong options)
GalliumContext::~GalliumContext()
{
CALLED();
// Destroy our contexts
Lock();
for (context_id i = 0; i < CONTEXT_MAX; i++)
DestroyContext(i);
Unlock();
- pipe_mutex_destroy(fMutex);
+ mtx_destroy(&fMutex);
// TODO: Destroy fScreen
}
status_t
GalliumContext::CreateScreen()
{
CALLED();
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 1af8e5d..9d1075c 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -390,24 +390,24 @@ static void do_winsys_deinit(struct amdgpu_winsys *ws)
amdgpu_device_deinitialize(ws->dev);
}
static void amdgpu_winsys_destroy(struct radeon_winsys *rws)
{
struct amdgpu_winsys *ws = (struct amdgpu_winsys*)rws;
if (util_queue_is_initialized(&ws->cs_queue))
util_queue_destroy(&ws->cs_queue);
- pipe_mutex_destroy(ws->bo_fence_lock);
+ mtx_destroy(&ws->bo_fence_lock);
pb_slabs_deinit(&ws->bo_slabs);
pb_cache_deinit(&ws->bo_cache);
- pipe_mutex_destroy(ws->global_bo_list_lock);
+ mtx_destroy(&ws->global_bo_list_lock);
do_winsys_deinit(ws);
FREE(rws);
}
static void amdgpu_winsys_query_info(struct radeon_winsys *rws,
struct radeon_info *info)
{
*info = ((struct amdgpu_winsys *)rws)->info;
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index e54dcac..786b1f6 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -363,21 +363,21 @@ void radeon_bo_destroy(struct pb_buffer *_buf)
}
}
radeon_bomgr_free_va(rws, bo->va, bo->base.size);
}
/* Close object. */
args.handle = bo->handle;
drmIoctl(rws->fd, DRM_IOCTL_GEM_CLOSE, &args);
- pipe_mutex_destroy(bo->u.real.map_mutex);
+ mtx_destroy(&bo->u.real.map_mutex);
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
rws->allocated_vram -= align(bo->base.size, rws->info.gart_page_size);
else if (bo->initial_domain & RADEON_DOMAIN_GTT)
rws->allocated_gtt -= align(bo->base.size, rws->info.gart_page_size);
if (bo->u.real.map_count >= 1) {
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
bo->rws->mapped_vram -= bo->base.size;
else
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index abab4aa..bbcf7a2 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -531,37 +531,37 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
return true;
}
static void radeon_winsys_destroy(struct radeon_winsys *rws)
{
struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws;
if (util_queue_is_initialized(&ws->cs_queue))
util_queue_destroy(&ws->cs_queue);
- pipe_mutex_destroy(ws->hyperz_owner_mutex);
- pipe_mutex_destroy(ws->cmask_owner_mutex);
+ mtx_destroy(&ws->hyperz_owner_mutex);
+ mtx_destroy(&ws->cmask_owner_mutex);
if (ws->info.has_virtual_memory)
pb_slabs_deinit(&ws->bo_slabs);
pb_cache_deinit(&ws->bo_cache);
if (ws->gen >= DRV_R600) {
radeon_surface_manager_free(ws->surf_man);
}
util_hash_table_destroy(ws->bo_names);
util_hash_table_destroy(ws->bo_handles);
util_hash_table_destroy(ws->bo_vas);
- pipe_mutex_destroy(ws->bo_handles_mutex);
- pipe_mutex_destroy(ws->bo_va_mutex);
- pipe_mutex_destroy(ws->bo_fence_lock);
+ mtx_destroy(&ws->bo_handles_mutex);
+ mtx_destroy(&ws->bo_va_mutex);
+ mtx_destroy(&ws->bo_fence_lock);
if (ws->fd >= 0)
close(ws->fd);
FREE(rws);
}
static void radeon_query_info(struct radeon_winsys *rws,
struct radeon_info *info)
{
diff --git a/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c b/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
index 0553662..293fe7e 100644
--- a/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
+++ b/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
@@ -802,21 +802,21 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
pipe_mutex_lock(fenced_mgr->mutex);
while(fenced_manager_check_signalled_locked(fenced_mgr, TRUE))
;
}
#ifdef DEBUG
/*assert(!fenced_mgr->num_unfenced);*/
#endif
pipe_mutex_unlock(fenced_mgr->mutex);
- pipe_mutex_destroy(fenced_mgr->mutex);
+ mtx_destroy(&fenced_mgr->mutex);
FREE(fenced_mgr);
}
struct pb_manager *
simple_fenced_bufmgr_create(struct pb_manager *provider,
struct pb_fence_ops *ops)
{
struct fenced_manager *fenced_mgr;
diff --git a/src/gallium/winsys/svga/drm/vmw_surface.c b/src/gallium/winsys/svga/drm/vmw_surface.c
index a438b1a..9fadbf9 100644
--- a/src/gallium/winsys/svga/drm/vmw_surface.c
+++ b/src/gallium/winsys/svga/drm/vmw_surface.c
@@ -194,16 +194,16 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
if (pipe_reference(dst_ref, src_ref)) {
if (dst->buf)
vmw_svga_winsys_buffer_destroy(&dst->screen->base, dst->buf);
vmw_ioctl_surface_destroy(dst->screen, dst->sid);
#ifdef DEBUG
/* to detect dangling pointers */
assert(p_atomic_read(&dst->validated) == 0);
dst->sid = SVGA3D_INVALID_ID;
#endif
- pipe_mutex_destroy(dst->mutex);
+ mtx_destroy(&dst->mutex);
FREE(dst);
}
*pdst = src;
}
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index b6a4234..4f3fa4d 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -113,22 +113,22 @@ virgl_cache_flush(struct virgl_drm_winsys *qdws)
}
static void
virgl_drm_winsys_destroy(struct virgl_winsys *qws)
{
struct virgl_drm_winsys *qdws = virgl_drm_winsys(qws);
virgl_cache_flush(qdws);
util_hash_table_destroy(qdws->bo_handles);
util_hash_table_destroy(qdws->bo_names);
- pipe_mutex_destroy(qdws->bo_handles_mutex);
- pipe_mutex_destroy(qdws->mutex);
+ mtx_destroy(&qdws->bo_handles_mutex);
+ mtx_destroy(&qdws->mutex);
FREE(qdws);
}
static void
virgl_cache_list_check_free(struct virgl_drm_winsys *qdws)
{
struct list_head *curr, *next;
struct virgl_hw_res *res;
int64_t now;
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
index a8c874a..dde53e7 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
@@ -612,21 +612,21 @@ static void virgl_vtest_flush_frontbuffer(struct virgl_winsys *vws,
sub_box);
}
static void
virgl_vtest_winsys_destroy(struct virgl_winsys *vws)
{
struct virgl_vtest_winsys *vtws = virgl_vtest_winsys(vws);
virgl_cache_flush(vtws);
- pipe_mutex_destroy(vtws->mutex);
+ mtx_destroy(&vtws->mutex);
FREE(vtws);
}
struct virgl_winsys *
virgl_vtest_winsys_wrap(struct sw_winsys *sws)
{
struct virgl_vtest_winsys *vtws;
vtws = CALLOC_STRUCT(virgl_vtest_winsys);
if (!vtws)
--
2.9.3
More information about the mesa-dev
mailing list