aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'amdgpu/amdgpu_bo.c')
-rw-r--r--amdgpu/amdgpu_bo.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index d2725da8..803fe54c 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -56,14 +56,12 @@ static void amdgpu_close_kms_handle(amdgpu_device_handle dev,
56drm_private void amdgpu_bo_free_internal(amdgpu_bo_handle bo) 56drm_private void amdgpu_bo_free_internal(amdgpu_bo_handle bo)
57{ 57{
58 /* Remove the buffer from the hash tables. */ 58 /* Remove the buffer from the hash tables. */
59 pthread_mutex_lock(&bo->dev->bo_table_mutex);
60 util_hash_table_remove(bo->dev->bo_handles, 59 util_hash_table_remove(bo->dev->bo_handles,
61 (void*)(uintptr_t)bo->handle); 60 (void*)(uintptr_t)bo->handle);
62 if (bo->flink_name) { 61 if (bo->flink_name) {
63 util_hash_table_remove(bo->dev->bo_flink_names, 62 util_hash_table_remove(bo->dev->bo_flink_names,
64 (void*)(uintptr_t)bo->flink_name); 63 (void*)(uintptr_t)bo->flink_name);
65 } 64 }
66 pthread_mutex_unlock(&bo->dev->bo_table_mutex);
67 65
68 /* Release CPU access. */ 66 /* Release CPU access. */
69 if (bo->cpu_map_count > 0) { 67 if (bo->cpu_map_count > 0) {
@@ -342,10 +340,9 @@ int amdgpu_bo_import(amdgpu_device_handle dev,
342 } 340 }
343 341
344 if (bo) { 342 if (bo) {
345 pthread_mutex_unlock(&dev->bo_table_mutex);
346
347 /* The buffer already exists, just bump the refcount. */ 343 /* The buffer already exists, just bump the refcount. */
348 atomic_inc(&bo->refcount); 344 atomic_inc(&bo->refcount);
345 pthread_mutex_unlock(&dev->bo_table_mutex);
349 346
350 output->buf_handle = bo; 347 output->buf_handle = bo;
351 output->alloc_size = bo->alloc_size; 348 output->alloc_size = bo->alloc_size;