From: Alex Deucher Date: Wed, 11 Jan 2017 21:11:48 +0000 (-0500) Subject: drm/amdgpu: use the num_rings variable for checking vce rings X-Git-Tag: v4.14-rc1~1422^2~31^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=034041f33498ba57d9fd1d3e4aea7e40ea4988da;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 8d019ca..cf2e8c4 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, *out_ring = &adev->uvd.ring; break; case AMDGPU_HW_IP_VCE: - if (ring < 2){ + if (ring < adev->vce.num_rings){ *out_ring = &adev->vce.ring[ring]; } else { - DRM_ERROR("only two VCE rings are supported\n"); + DRM_ERROR("only %d VCE rings are supported\n", adev->vce.num_rings); return -EINVAL; } break;