Skip to contentSkip to conversation

drm/amdgpu: use the num_rings variable for checking vce rings

PATCH In review Alex Deucher 2 participants 2 messages Jan 11, 2017 – Jan 12, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -2
index 29d6d84..3ff2929 100644
@@ -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;
Signature · 6 lines
2.5.5

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1484169185-11012-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Am 11.01.2017 um 22:13 schrieb Alex Deucher:

Quoted 4 lines

Difference families may have different numbers of rings. Use the variable rather than a hardcoded number.

Quoted 11 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0 -0
index 29d6d84..3ff2929 100644
@@ -75,10 +75,10 @@ int amdgpu_cs_get_ring(struct amdgpu_device *adev, u32 ip_type,
  		*out_ring = &adev->uvd.ring;
  		break;

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c int amdgpu_cs_get_ring(struct amdgpu_device *adev, u32 ip_type, · line 84

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -2
  	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;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx