summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/amdgpu
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/winsys/amdgpu
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/winsys/amdgpu')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c10
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c6
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c14
3 files changed, 15 insertions, 15 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 2f0dcb63de0..c7dd1168f8b 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -99,7 +99,7 @@ static bool amdgpu_bo_wait(struct pb_buffer *_buf, uint64_t timeout,
bo->num_fences -= idle_fences;
buffer_idle = !bo->num_fences;
- pipe_mutex_unlock(ws->bo_fence_lock);
+ mtx_unlock(&ws->bo_fence_lock);
return buffer_idle;
} else {
@@ -113,7 +113,7 @@ static bool amdgpu_bo_wait(struct pb_buffer *_buf, uint64_t timeout,
amdgpu_fence_reference(&fence, bo->fences[0]);
/* Wait for the fence. */
- pipe_mutex_unlock(ws->bo_fence_lock);
+ mtx_unlock(&ws->bo_fence_lock);
if (amdgpu_fence_wait(fence, abs_timeout, true))
fence_idle = true;
else
@@ -132,7 +132,7 @@ static bool amdgpu_bo_wait(struct pb_buffer *_buf, uint64_t timeout,
amdgpu_fence_reference(&fence, NULL);
}
- pipe_mutex_unlock(ws->bo_fence_lock);
+ mtx_unlock(&ws->bo_fence_lock);
return buffer_idle;
}
@@ -163,7 +163,7 @@ void amdgpu_bo_destroy(struct pb_buffer *_buf)
mtx_lock(&bo->ws->global_bo_list_lock);
LIST_DEL(&bo->u.real.global_list_item);
bo->ws->num_buffers--;
- pipe_mutex_unlock(bo->ws->global_bo_list_lock);
+ mtx_unlock(&bo->ws->global_bo_list_lock);
amdgpu_bo_va_op(bo->bo, 0, bo->base.size, bo->va, 0, AMDGPU_VA_OP_UNMAP);
amdgpu_va_range_free(bo->u.real.va_handle);
@@ -352,7 +352,7 @@ static void amdgpu_add_buffer_to_global_list(struct amdgpu_winsys_bo *bo)
mtx_lock(&ws->global_bo_list_lock);
LIST_ADDTAIL(&bo->u.real.global_list_item, &ws->global_bo_list);
ws->num_buffers++;
- pipe_mutex_unlock(ws->global_bo_list_lock);
+ mtx_unlock(&ws->global_bo_list_lock);
}
static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws,
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index bb255f251c3..cdd8e6cecdf 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -1041,7 +1041,7 @@ void amdgpu_cs_submit_ib(void *job, int thread_index)
handles = malloc(sizeof(handles[0]) * ws->num_buffers);
if (!handles) {
- pipe_mutex_unlock(ws->global_bo_list_lock);
+ mtx_unlock(&ws->global_bo_list_lock);
amdgpu_cs_context_cleanup(cs);
cs->error_code = -ENOMEM;
return;
@@ -1056,7 +1056,7 @@ void amdgpu_cs_submit_ib(void *job, int thread_index)
handles, NULL,
&cs->request.resources);
free(handles);
- pipe_mutex_unlock(ws->global_bo_list_lock);
+ mtx_unlock(&ws->global_bo_list_lock);
} else {
r = amdgpu_bo_list_create(ws->dev, cs->num_real_buffers,
cs->handles, cs->flags,
@@ -1222,7 +1222,7 @@ static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs,
util_queue_add_job(&ws->cs_queue, cs, &cs->flush_completed,
amdgpu_cs_submit_ib, NULL);
/* The submission has been queued, unlock the fence now. */
- pipe_mutex_unlock(ws->bo_fence_lock);
+ mtx_unlock(&ws->bo_fence_lock);
if (!(flags & RADEON_FLUSH_ASYNC)) {
amdgpu_cs_sync_flush(rcs);
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 79b73759a5a..bf7a0573990 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -506,7 +506,7 @@ static bool amdgpu_winsys_unref(struct radeon_winsys *rws)
if (destroy && dev_tab)
util_hash_table_remove(dev_tab, ws->dev);
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
return destroy;
}
@@ -534,7 +534,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
* for the same fd. */
r = amdgpu_device_initialize(fd, &drm_major, &drm_minor, &dev);
if (r) {
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
fprintf(stderr, "amdgpu: amdgpu_device_initialize failed.\n");
return NULL;
}
@@ -543,7 +543,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
ws = util_hash_table_get(dev_tab, dev);
if (ws) {
pipe_reference(NULL, &ws->reference);
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
return &ws->base;
}
@@ -596,7 +596,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
if (!util_queue_init(&ws->cs_queue, "amdgpu_cs", 8, 1)) {
amdgpu_winsys_destroy(&ws->base);
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
return NULL;
}
@@ -608,7 +608,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
ws->base.screen = screen_create(&ws->base);
if (!ws->base.screen) {
amdgpu_winsys_destroy(&ws->base);
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
return NULL;
}
@@ -617,7 +617,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
/* We must unlock the mutex once the winsys is fully initialized, so that
* other threads attempting to create the winsys from the same fd will
* get a fully initialized winsys and not just half-way initialized. */
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
return &ws->base;
@@ -627,6 +627,6 @@ fail_cache:
fail_alloc:
FREE(ws);
fail:
- pipe_mutex_unlock(dev_tab_mutex);
+ mtx_unlock(&dev_tab_mutex);
return NULL;
}