diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 7 |
3 files changed, 4 insertions, 26 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 2ba448ee948b..abf1650f6936 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -439,7 +439,6 @@ int amdgpu_fence_wait_next(struct amdgpu_ring *ring); | |||
439 | int amdgpu_fence_wait_empty(struct amdgpu_ring *ring); | 439 | int amdgpu_fence_wait_empty(struct amdgpu_ring *ring); |
440 | unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); | 440 | unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); |
441 | 441 | ||
442 | bool amdgpu_fence_signaled(struct amdgpu_fence *fence); | ||
443 | int amdgpu_fence_wait(struct amdgpu_fence *fence, bool interruptible); | 442 | int amdgpu_fence_wait(struct amdgpu_fence *fence, bool interruptible); |
444 | signed long amdgpu_fence_wait_any(struct amdgpu_device *adev, | 443 | signed long amdgpu_fence_wait_any(struct amdgpu_device *adev, |
445 | struct amdgpu_fence **fences, | 444 | struct amdgpu_fence **fences, |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index eb419791d1b2..5a2a15cf1a7c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |||
@@ -425,28 +425,6 @@ static bool amdgpu_fence_enable_signaling(struct fence *f) | |||
425 | return true; | 425 | return true; |
426 | } | 426 | } |
427 | 427 | ||
428 | /** | ||
429 | * amdgpu_fence_signaled - check if a fence has signaled | ||
430 | * | ||
431 | * @fence: amdgpu fence object | ||
432 | * | ||
433 | * Check if the requested fence has signaled (all asics). | ||
434 | * Returns true if the fence has signaled or false if it has not. | ||
435 | */ | ||
436 | bool amdgpu_fence_signaled(struct amdgpu_fence *fence) | ||
437 | { | ||
438 | if (!fence) | ||
439 | return true; | ||
440 | |||
441 | if (amdgpu_fence_seq_signaled(fence->ring, fence->seq)) { | ||
442 | if (!fence_signal(&fence->base)) | ||
443 | FENCE_TRACE(&fence->base, "signaled from amdgpu_fence_signaled\n"); | ||
444 | return true; | ||
445 | } | ||
446 | |||
447 | return false; | ||
448 | } | ||
449 | |||
450 | /* | 428 | /* |
451 | * amdgpu_ring_wait_seq_timeout - wait for seq of the specific ring to signal | 429 | * amdgpu_ring_wait_seq_timeout - wait for seq of the specific ring to signal |
452 | * @ring: ring to wait on for the seq number | 430 | * @ring: ring to wait on for the seq number |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c index f4e20eaede82..c5b17262529d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | |||
@@ -160,7 +160,8 @@ static void amdgpu_sa_bo_try_free(struct amdgpu_sa_manager *sa_manager) | |||
160 | 160 | ||
161 | sa_bo = list_entry(sa_manager->hole->next, struct amdgpu_sa_bo, olist); | 161 | sa_bo = list_entry(sa_manager->hole->next, struct amdgpu_sa_bo, olist); |
162 | list_for_each_entry_safe_from(sa_bo, tmp, &sa_manager->olist, olist) { | 162 | list_for_each_entry_safe_from(sa_bo, tmp, &sa_manager->olist, olist) { |
163 | if (sa_bo->fence == NULL || !amdgpu_fence_signaled(sa_bo->fence)) { | 163 | if (sa_bo->fence == NULL || |
164 | !fence_is_signaled(&sa_bo->fence->base)) { | ||
164 | return; | 165 | return; |
165 | } | 166 | } |
166 | amdgpu_sa_bo_remove_locked(sa_bo); | 167 | amdgpu_sa_bo_remove_locked(sa_bo); |
@@ -274,7 +275,7 @@ static bool amdgpu_sa_bo_next_hole(struct amdgpu_sa_manager *sa_manager, | |||
274 | sa_bo = list_first_entry(&sa_manager->flist[i], | 275 | sa_bo = list_first_entry(&sa_manager->flist[i], |
275 | struct amdgpu_sa_bo, flist); | 276 | struct amdgpu_sa_bo, flist); |
276 | 277 | ||
277 | if (!amdgpu_fence_signaled(sa_bo->fence)) { | 278 | if (!fence_is_signaled(&sa_bo->fence->base)) { |
278 | fences[i] = sa_bo->fence; | 279 | fences[i] = sa_bo->fence; |
279 | continue; | 280 | continue; |
280 | } | 281 | } |
@@ -380,7 +381,7 @@ void amdgpu_sa_bo_free(struct amdgpu_device *adev, struct amdgpu_sa_bo **sa_bo, | |||
380 | 381 | ||
381 | sa_manager = (*sa_bo)->manager; | 382 | sa_manager = (*sa_bo)->manager; |
382 | spin_lock(&sa_manager->wq.lock); | 383 | spin_lock(&sa_manager->wq.lock); |
383 | if (fence && !amdgpu_fence_signaled(fence)) { | 384 | if (fence && !fence_is_signaled(&fence->base)) { |
384 | (*sa_bo)->fence = amdgpu_fence_ref(fence); | 385 | (*sa_bo)->fence = amdgpu_fence_ref(fence); |
385 | list_add_tail(&(*sa_bo)->flist, | 386 | list_add_tail(&(*sa_bo)->flist, |
386 | &sa_manager->flist[fence->ring->idx]); | 387 | &sa_manager->flist[fence->ring->idx]); |