drm/amdgpu: remove amdgpu_fence_ref/unref
authorChristian König <christian.koenig@amd.com>
Thu, 22 Oct 2015 13:16:22 +0000 (15:16 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Oct 2015 05:58:22 +0000 (01:58 -0400)
Just move the remaining users to fence_put/get.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c

index b986ea1239943d46c6ca7aa1c31b7a6652a414eb..8305a6ccf796f968d3b543981018c2a6ab2be0be 100644 (file)
@@ -447,9 +447,6 @@ int amdgpu_fence_wait_next(struct amdgpu_ring *ring);
 int amdgpu_fence_wait_empty(struct amdgpu_ring *ring);
 unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring);
 
-struct amdgpu_fence *amdgpu_fence_ref(struct amdgpu_fence *fence);
-void amdgpu_fence_unref(struct amdgpu_fence **fence);
-
 bool amdgpu_fence_need_sync(struct amdgpu_fence *fence,
                            struct amdgpu_ring *ring);
 void amdgpu_fence_note_sync(struct amdgpu_fence *fence,
index c4bb28292b9f192f9775a69724bf687c9379104f..b912539420e49a0c0a4aaa2ec846e1c57404d0ee 100644 (file)
@@ -416,36 +416,6 @@ int amdgpu_fence_wait_empty(struct amdgpu_ring *ring)
        return amdgpu_fence_ring_wait_seq(ring, seq);
 }
 
-/**
- * amdgpu_fence_ref - take a ref on a fence
- *
- * @fence: amdgpu fence object
- *
- * Take a reference on a fence (all asics).
- * Returns the fence.
- */
-struct amdgpu_fence *amdgpu_fence_ref(struct amdgpu_fence *fence)
-{
-       fence_get(&fence->base);
-       return fence;
-}
-
-/**
- * amdgpu_fence_unref - remove a ref on a fence
- *
- * @fence: amdgpu fence object
- *
- * Remove a reference on a fence (all asics).
- */
-void amdgpu_fence_unref(struct amdgpu_fence **fence)
-{
-       struct amdgpu_fence *tmp = *fence;
-
-       *fence = NULL;
-       if (tmp)
-               fence_put(&tmp->base);
-}
-
 /**
  * amdgpu_fence_count_emitted - get the count of emitted fences
  *
index aad4c1c6944805164b482e0ed5a9f714193da790..e65987743871b18bb521113d86e0245c50686b57 100644 (file)
@@ -95,7 +95,8 @@ void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib)
 {
        amdgpu_sync_free(adev, &ib->sync, &ib->fence->base);
        amdgpu_sa_bo_free(adev, &ib->sa_bo, &ib->fence->base);
-       amdgpu_fence_unref(&ib->fence);
+       if (ib->fence)
+               fence_put(&ib->fence->base);
 }
 
 /**
index 2e946b2cad8878405ec6a03f6512233dbbf93348..dcf4a8aca680d885fc6a52414ca2c8e5e3bd0914 100644 (file)
@@ -54,7 +54,8 @@ static struct fence *amdgpu_sched_run_job(struct amd_sched_job *sched_job)
                goto err;
        }
 
-       fence = amdgpu_fence_ref(job->ibs[job->num_ibs - 1].fence);
+       fence = job->ibs[job->num_ibs - 1].fence;
+       fence_get(&fence->base);
 
 err:
        if (job->free_job)