drm/amdgpu/gfx8: test KIQ before compute rings
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Mar 2017 05:38:11 +0000 (01:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:54:10 +0000 (23:54 -0400)
If KIQ isn't working, the compute rings won't work either.

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

index bad28d8a42fb5892ba801d4bd3c2b75654f3c98e..111fa5d91bdfafda46744dba8357bb130e5bd991 100644 (file)
@@ -4980,6 +4980,13 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
        if (r)
                goto done;
 
+       ring->ready = true;
+       r = amdgpu_ring_test_ring(ring);
+       if (r) {
+               ring->ready = false;
+               goto done;
+       }
+
        for (i = 0; i < adev->gfx.num_compute_rings; i++) {
                ring = &adev->gfx.compute_ring[i];
 
@@ -5008,12 +5015,6 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
                        ring->ready = false;
        }
 
-       ring = &adev->gfx.kiq.ring;
-       ring->ready = true;
-       r = amdgpu_ring_test_ring(ring);
-       if (r)
-               ring->ready = false;
-
 done:
        return r;
 }