Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: remove amdgpu_fence_ref/unref

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>

authored by

Christian König and committed by
Alex Deucher
6ef68c17 16545c32

+4 -35
-3
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 447 447 int amdgpu_fence_wait_empty(struct amdgpu_ring *ring); 448 448 unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); 449 449 450 - struct amdgpu_fence *amdgpu_fence_ref(struct amdgpu_fence *fence); 451 - void amdgpu_fence_unref(struct amdgpu_fence **fence); 452 - 453 450 bool amdgpu_fence_need_sync(struct amdgpu_fence *fence, 454 451 struct amdgpu_ring *ring); 455 452 void amdgpu_fence_note_sync(struct amdgpu_fence *fence,
-30
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
··· 417 417 } 418 418 419 419 /** 420 - * amdgpu_fence_ref - take a ref on a fence 421 - * 422 - * @fence: amdgpu fence object 423 - * 424 - * Take a reference on a fence (all asics). 425 - * Returns the fence. 426 - */ 427 - struct amdgpu_fence *amdgpu_fence_ref(struct amdgpu_fence *fence) 428 - { 429 - fence_get(&fence->base); 430 - return fence; 431 - } 432 - 433 - /** 434 - * amdgpu_fence_unref - remove a ref on a fence 435 - * 436 - * @fence: amdgpu fence object 437 - * 438 - * Remove a reference on a fence (all asics). 439 - */ 440 - void amdgpu_fence_unref(struct amdgpu_fence **fence) 441 - { 442 - struct amdgpu_fence *tmp = *fence; 443 - 444 - *fence = NULL; 445 - if (tmp) 446 - fence_put(&tmp->base); 447 - } 448 - 449 - /** 450 420 * amdgpu_fence_count_emitted - get the count of emitted fences 451 421 * 452 422 * @ring: ring the fence is associated with
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
··· 95 95 { 96 96 amdgpu_sync_free(adev, &ib->sync, &ib->fence->base); 97 97 amdgpu_sa_bo_free(adev, &ib->sa_bo, &ib->fence->base); 98 - amdgpu_fence_unref(&ib->fence); 98 + if (ib->fence) 99 + fence_put(&ib->fence->base); 99 100 } 100 101 101 102 /**
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
··· 54 54 goto err; 55 55 } 56 56 57 - fence = amdgpu_fence_ref(job->ibs[job->num_ibs - 1].fence); 57 + fence = job->ibs[job->num_ibs - 1].fence; 58 + fence_get(&fence->base); 58 59 59 60 err: 60 61 if (job->free_job)