drm/amdgpu: add sched isr to fence process
authorChunming Zhou <david1.zhou@amd.com>
Tue, 21 Jul 2015 09:43:41 +0000 (17:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2015 20:50:38 +0000 (16:50 -0400)
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

index be43ae412ae012ffa95140035fa3271a358763a1..1580d8d7a3bf098e81411c7453d08027f10f44f3 100644 (file)
@@ -346,8 +346,24 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
                }
        } while (atomic64_xchg(&ring->fence_drv.last_seq, seq) > seq);
 
-       if (wake)
+       if (wake) {
+               if (amdgpu_enable_scheduler) {
+                       uint64_t handled_seq =
+                               amd_sched_get_handled_seq(ring->scheduler);
+                       uint64_t latest_seq =
+                               atomic64_read(&ring->fence_drv.last_seq);
+                       if (handled_seq == latest_seq) {
+                               DRM_ERROR("ring %d, EOP without seq update (lastest_seq=%llu)\n",
+                                         ring->idx, latest_seq);
+                               return;
+                       }
+                       do {
+                               amd_sched_isr(ring->scheduler);
+                       } while (amd_sched_get_handled_seq(ring->scheduler) < latest_seq);
+               }
+
                wake_up_all(&ring->adev->fence_queue);
+       }
 }
 
 /**