gallium/util: replace pipe_mutex_destroy() with mtx_destroy()
pipe_mutex_destroy() was made unnecessary with fd33a6bcd7
.
Replace was done with:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_destroy(\([^)]*\)):mtx_destroy(\&\1):g' {} \;
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
75b47dda0c
commit
be188289e1
|
@ -108,9 +108,6 @@ static inline int pipe_thread_is_self( pipe_thread thread )
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define pipe_mutex_destroy(mutex) \
|
||||
mtx_destroy(&(mutex))
|
||||
|
||||
#define pipe_mutex_lock(mutex) \
|
||||
(void) mtx_lock(&(mutex))
|
||||
|
||||
|
@ -185,7 +182,7 @@ static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -238,7 +235,7 @@ pipe_semaphore_init(pipe_semaphore *sema, int init_val)
|
|||
static inline void
|
||||
pipe_semaphore_destroy(pipe_semaphore *sema)
|
||||
{
|
||||
pipe_mutex_destroy(sema->mutex);
|
||||
mtx_destroy(&sema->mutex);
|
||||
cnd_destroy(&sema->cond);
|
||||
}
|
||||
|
||||
|
|
|
@ -992,7 +992,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
|
|||
#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);
|
||||
|
|
|
@ -240,7 +240,7 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf)
|
|||
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);
|
||||
|
@ -449,7 +449,7 @@ pb_debug_manager_destroy(struct pb_manager *_mgr)
|
|||
}
|
||||
pipe_mutex_unlock(mgr->mutex);
|
||||
|
||||
pipe_mutex_destroy(mgr->mutex);
|
||||
mtx_destroy(&mgr->mutex);
|
||||
mgr->provider->destroy(mgr->provider);
|
||||
FREE(mgr);
|
||||
}
|
||||
|
|
|
@ -298,5 +298,5 @@ void
|
|||
pb_cache_deinit(struct pb_cache *mgr)
|
||||
{
|
||||
pb_cache_release_all_buffers(mgr);
|
||||
pipe_mutex_destroy(mgr->mutex);
|
||||
mtx_destroy(&mgr->mutex);
|
||||
}
|
||||
|
|
|
@ -248,5 +248,5 @@ pb_slabs_deinit(struct pb_slabs *slabs)
|
|||
}
|
||||
|
||||
FREE(slabs->groups);
|
||||
pipe_mutex_destroy(slabs->mutex);
|
||||
mtx_destroy(&slabs->mutex);
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ 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);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -251,7 +251,7 @@ fail:
|
|||
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 */
|
||||
|
@ -283,7 +283,7 @@ util_queue_destroy(struct util_queue *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);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ util_range_init(struct util_range *range)
|
|||
static inline void
|
||||
util_range_destroy(struct util_range *range)
|
||||
{
|
||||
pipe_mutex_destroy(range->write_mutex);
|
||||
mtx_destroy(&range->write_mutex);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -48,7 +48,7 @@ fail:
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -598,7 +598,7 @@ dd_context_destroy(struct pipe_context *_pipe)
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -873,7 +873,7 @@ dd_context_create(struct dd_screen *dscreen, struct pipe_context *pipe)
|
|||
(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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ fd_screen_destroy(struct pipe_screen *pscreen)
|
|||
|
||||
slab_destroy_parent(&screen->transfer_pool);
|
||||
|
||||
pipe_mutex_destroy(screen->lock);
|
||||
mtx_destroy(&screen->lock);
|
||||
|
||||
free(screen);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ 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);
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ 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);
|
||||
|
|
|
@ -561,7 +561,7 @@ llvmpipe_destroy_screen( struct pipe_screen *_screen )
|
|||
if(winsys->destroy)
|
||||
winsys->destroy(winsys);
|
||||
|
||||
pipe_mutex_destroy(screen->rast_mutex);
|
||||
mtx_destroy(&screen->rast_mutex);
|
||||
|
||||
FREE(screen);
|
||||
}
|
||||
|
|
|
@ -1780,7 +1780,7 @@ nv50_blitter_destroy(struct nv50_screen *screen)
|
|||
}
|
||||
}
|
||||
|
||||
pipe_mutex_destroy(blitter->mutex);
|
||||
mtx_destroy(&blitter->mutex);
|
||||
FREE(blitter);
|
||||
}
|
||||
|
||||
|
|
|
@ -1689,7 +1689,7 @@ nvc0_blitter_destroy(struct nvc0_screen *screen)
|
|||
}
|
||||
}
|
||||
|
||||
pipe_mutex_destroy(blitter->mutex);
|
||||
mtx_destroy(&blitter->mutex);
|
||||
FREE(blitter);
|
||||
}
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ static void r300_destroy_screen(struct pipe_screen* 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)
|
||||
|
|
|
@ -1360,8 +1360,8 @@ 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);
|
||||
|
|
|
@ -704,7 +704,7 @@ static void si_destroy_screen(struct pipe_screen* pscreen)
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ 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 */
|
||||
|
@ -1960,7 +1960,7 @@ static void si_delete_shader_selector(struct pipe_context *ctx, void *state)
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -919,8 +919,8 @@ svga_destroy_screen( struct pipe_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);
|
||||
|
||||
|
|
|
@ -396,7 +396,7 @@ svga_screen_cache_cleanup(struct svga_screen *svgascreen)
|
|||
sws->fence_reference(sws, &cache->entries[i].fence, NULL);
|
||||
}
|
||||
|
||||
pipe_mutex_destroy(cache->mutex);
|
||||
mtx_destroy(&cache->mutex);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -404,7 +404,7 @@ dri_destroy_screen_helper(struct dri_screen * 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
|
||||
|
|
|
@ -265,8 +265,8 @@ 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);
|
||||
|
|
|
@ -233,7 +233,7 @@ nine_csmt_destroy( struct NineDevice9 *device, struct csmt_context *ctx )
|
|||
|
||||
nine_csmt_wait_processed(ctx);
|
||||
nine_queue_delete(ctx->pool);
|
||||
pipe_mutex_destroy(ctx->mutex_processed);
|
||||
mtx_destroy(&ctx->mutex_processed);
|
||||
|
||||
FREE(ctx);
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ vlVaTerminate(VADriverContextP ctx)
|
|||
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;
|
||||
|
|
|
@ -166,7 +166,7 @@ vlVdpDecoderDestroy(VdpDecoder decoder)
|
|||
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);
|
||||
|
|
|
@ -233,7 +233,7 @@ vlVdpDeviceDestroy(VdpDevice device)
|
|||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ GalliumContext::~GalliumContext()
|
|||
DestroyContext(i);
|
||||
Unlock();
|
||||
|
||||
pipe_mutex_destroy(fMutex);
|
||||
mtx_destroy(&fMutex);
|
||||
|
||||
// TODO: Destroy fScreen
|
||||
}
|
||||
|
|
|
@ -389,10 +389,10 @@ static void amdgpu_winsys_destroy(struct radeon_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);
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ void radeon_bo_destroy(struct pb_buffer *_buf)
|
|||
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);
|
||||
|
|
|
@ -538,8 +538,8 @@ static void radeon_winsys_destroy(struct radeon_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);
|
||||
|
@ -552,9 +552,9 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws)
|
|||
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);
|
||||
|
|
|
@ -809,7 +809,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
|
|||
#endif
|
||||
|
||||
pipe_mutex_unlock(fenced_mgr->mutex);
|
||||
pipe_mutex_destroy(fenced_mgr->mutex);
|
||||
mtx_destroy(&fenced_mgr->mutex);
|
||||
|
||||
FREE(fenced_mgr);
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
|
|||
assert(p_atomic_read(&dst->validated) == 0);
|
||||
dst->sid = SVGA3D_INVALID_ID;
|
||||
#endif
|
||||
pipe_mutex_destroy(dst->mutex);
|
||||
mtx_destroy(&dst->mutex);
|
||||
FREE(dst);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,8 +120,8 @@ virgl_drm_winsys_destroy(struct virgl_winsys *qws)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -619,7 +619,7 @@ virgl_vtest_winsys_destroy(struct virgl_winsys *vws)
|
|||
|
||||
virgl_cache_flush(vtws);
|
||||
|
||||
pipe_mutex_destroy(vtws->mutex);
|
||||
mtx_destroy(&vtws->mutex);
|
||||
FREE(vtws);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue