aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-10-29 05:48:31 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-11-05 14:21:25 -0500
commitdc9eeff84c77080f545575a30062af0ac65b1eb0 (patch)
treef426bd63d15eac17f1ce7119bffa22d92f7556cf /drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
parente4312d459a2e572e093c758793bd5357d6bddfd1 (diff)
drm/amdgpu: further ring test cleanups
Move all error messages from IP specific code into the common helper. This way we now uses the ring name in the messages instead of the index and note which device is affected as well. Also cleanup error handling in the IP specific code and consequently use ETIMEDOUT when the ring test timed out. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index 5f3f54073818..7b999ee3defb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -1079,11 +1079,9 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
1079 return 0; 1079 return 0;
1080 1080
1081 r = amdgpu_ring_alloc(ring, 16); 1081 r = amdgpu_ring_alloc(ring, 16);
1082 if (r) { 1082 if (r)
1083 DRM_ERROR("amdgpu: vce failed to lock ring %d (%d).\n",
1084 ring->idx, r);
1085 return r; 1083 return r;
1086 } 1084
1087 amdgpu_ring_write(ring, VCE_CMD_END); 1085 amdgpu_ring_write(ring, VCE_CMD_END);
1088 amdgpu_ring_commit(ring); 1086 amdgpu_ring_commit(ring);
1089 1087
@@ -1093,14 +1091,8 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
1093 DRM_UDELAY(1); 1091 DRM_UDELAY(1);
1094 } 1092 }
1095 1093
1096 if (i < timeout) { 1094 if (i >= timeout)
1097 DRM_DEBUG("ring test on %d succeeded in %d usecs\n",
1098 ring->idx, i);
1099 } else {
1100 DRM_ERROR("amdgpu: ring %d test failed\n",
1101 ring->idx);
1102 r = -ETIMEDOUT; 1095 r = -ETIMEDOUT;
1103 }
1104 1096
1105 return r; 1097 return r;
1106} 1098}