aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-01-11 16:11:48 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-01-27 11:13:29 -0500
commit034041f33498ba57d9fd1d3e4aea7e40ea4988da (patch)
tree84bf1b992c5bc85889fb68b37bdcddd5016d9d2d
parentf1543f58cbc7f62c4ea0cca57bbb4a95dc752264 (diff)
drm/amdgpu: use the num_rings variable for checking vce rings
Difference families may have different numbers of rings. Use the variable rather than a hardcoded number. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 8d019ca7d9c7..cf2e8c4e9b8b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -75,10 +75,10 @@ int amdgpu_cs_get_ring(struct amdgpu_device *adev, u32 ip_type,
75 *out_ring = &adev->uvd.ring; 75 *out_ring = &adev->uvd.ring;
76 break; 76 break;
77 case AMDGPU_HW_IP_VCE: 77 case AMDGPU_HW_IP_VCE:
78 if (ring < 2){ 78 if (ring < adev->vce.num_rings){
79 *out_ring = &adev->vce.ring[ring]; 79 *out_ring = &adev->vce.ring[ring];
80 } else { 80 } else {
81 DRM_ERROR("only two VCE rings are supported\n"); 81 DRM_ERROR("only %d VCE rings are supported\n", adev->vce.num_rings);
82 return -EINVAL; 82 return -EINVAL;
83 } 83 }
84 break; 84 break;