From: Christian König Date: Tue, 12 Jul 2016 11:57:03 +0000 (+0200) Subject: drm/amdgpu: always signal all fences X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2ef004d984226fb6845481bc928ae37fb1dacc5e;p=linux-beck.git drm/amdgpu: always signal all fences A little fallout from "drm/amdgpu: sanitize fence numbers", we sometimes need to signal all fences in the ring. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index e320b5b73ac6..0b109aebfec6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -204,10 +204,13 @@ void amdgpu_fence_process(struct amdgpu_ring *ring) if (seq != ring->fence_drv.sync_seq) amdgpu_fence_schedule_fallback(ring); + if (unlikely(seq == last_seq)) + return; + last_seq &= drv->num_fences_mask; seq &= drv->num_fences_mask; - while (last_seq != seq) { + do { struct fence *fence, **ptr; ++last_seq; @@ -228,7 +231,7 @@ void amdgpu_fence_process(struct amdgpu_ring *ring) BUG(); fence_put(fence); - } + } while (last_seq != seq); } /**