drm/amdgpu: use amdgpu_ring_test_helper when possible
authorNirmoy Das <nirmoy.das@amd.com>
Tue, 25 Feb 2020 13:29:45 +0000 (14:29 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Feb 2020 19:17:33 +0000 (14:17 -0500)
amdgpu_ring_test_helper already handles ring->sched.ready correctly

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c

index 0f960b498792140fff86075fd8c8a95e835b5d30..7403588684b3462c41a37e76d98e9c6fc3bd532e 100644 (file)
@@ -477,7 +477,7 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev)
                kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.compute_ring[i],
                                           RESET_QUEUES, 0, 0);
 
-       return amdgpu_ring_test_ring(kiq_ring);
+       return amdgpu_ring_test_helper(kiq_ring);
 }
 
 int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev)
index bb2f990ee070d1d650c179b52f119ac01ac28200..8b17f182d53294d538055c58920821bd0cb2f748 100644 (file)
@@ -3164,12 +3164,7 @@ static int gfx_v10_0_kiq_enable_kgq(struct amdgpu_device *adev)
        for (i = 0; i < adev->gfx.num_gfx_rings; i++)
                kiq->pmf->kiq_map_queues(kiq_ring, &adev->gfx.gfx_ring[i]);
 
-       r = amdgpu_ring_test_ring(kiq_ring);
-       if (r) {
-               DRM_ERROR("kfq enable failed\n");
-               kiq_ring->sched.ready = false;
-       }
-       return r;
+       return amdgpu_ring_test_helper(kiq_ring);
 }
 #endif
 
@@ -3785,7 +3780,7 @@ static int gfx_v10_0_kiq_disable_kgq(struct amdgpu_device *adev)
                kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.gfx_ring[i],
                                           PREEMPT_QUEUES, 0, 0);
 
-       return amdgpu_ring_test_ring(kiq_ring);
+       return amdgpu_ring_test_helper(kiq_ring);
 }
 #endif
 
index 67b9830b7c7ebfe3050d8db1cd4458f9f94a0cd5..ebfd2cdf4e651215bc5ee0bf6d54be8ec9f46762 100644 (file)
@@ -746,11 +746,9 @@ static int sdma_v5_0_gfx_resume(struct amdgpu_device *adev)
                        sdma_v5_0_enable(adev, true);
                }
 
-               r = amdgpu_ring_test_ring(ring);
-               if (r) {
-                       ring->sched.ready = false;
+               r = amdgpu_ring_test_helper(ring);
+               if (r)
                        return r;
-               }
 
                if (adev->mman.buffer_funcs_ring == ring)
                        amdgpu_ttm_set_buffer_funcs_status(adev, true);