drm/amdgpu: use the num_rings variable for checking vce rings
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 11 Jan 2017 21:11:48 +0000 (16:11 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 16:13:29 +0000 (11:13 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index 8d019ca7d9c72b17077624a88ce00434746b9da1..cf2e8c4e9b8bd38e32df537eb67baaaa6bc6bbf0 100644 (file)
@@ -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;