Replace rings' index value for rings' name.

Signed-off-by: Alexandre Demers <alexandre.f.dem...@gmail.com>
---
 drivers/gpu/drm/radeon/cik.c          |  6 +++---
 drivers/gpu/drm/radeon/cik_sdma.c     |  6 +++---
 drivers/gpu/drm/radeon/r600.c         |  8 ++++----
 drivers/gpu/drm/radeon/r600_dma.c     |  8 ++++----
 drivers/gpu/drm/radeon/radeon_fence.c |  6 ++++--
 drivers/gpu/drm/radeon/radeon_ring.c  |  4 ++--
 drivers/gpu/drm/radeon/radeon_vce.c   | 13 +++++++------
 drivers/gpu/drm/radeon/uvd_v1_0.c     | 14 +++++++-------
 8 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 6d6a6abd57fb..8065039900a4 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -3473,10 +3473,10 @@ int cik_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
                udelay(1);
        }
        if (i < rdev->usec_timeout) {
-               DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, 
i);
+               DRM_INFO("ring test on %s succeeded in %d usecs\n", ring->name, 
i);
        } else {
-               DRM_ERROR("radeon: ring %d test failed 
(scratch(0x%04X)=0x%08X)\n",
-                         ring->idx, scratch, tmp);
+               DRM_ERROR("radeon: ring %s test failed 
(scratch(0x%04X)=0x%08X)\n",
+                         ring->name, scratch, tmp);
                r = -EINVAL;
        }
        radeon_scratch_free(rdev, scratch);
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c 
b/drivers/gpu/drm/radeon/cik_sdma.c
index 919b14845c3c..54c67c100fe0 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -680,10 +680,10 @@ int cik_sdma_ring_test(struct radeon_device *rdev,
        }
 
        if (i < rdev->usec_timeout) {
-               DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, 
i);
+               DRM_INFO("ring test on %s succeeded in %d usecs\n", ring->name, 
i);
        } else {
-               DRM_ERROR("radeon: ring %d test failed (0x%08X)\n",
-                         ring->idx, tmp);
+               DRM_ERROR("radeon: ring %s test failed (0x%08X)\n",
+                         ring->name, tmp);
                r = -EINVAL;
        }
        return r;
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 8b62f7faa5b9..de98e4613114 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2835,7 +2835,7 @@ int r600_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
        WREG32(scratch, 0xCAFEDEAD);
        r = radeon_ring_lock(rdev, ring, 3);
        if (r) {
-               DRM_ERROR("radeon: cp failed to lock ring %d (%d).\n", 
ring->idx, r);
+               DRM_ERROR("radeon: cp failed to lock ring %s (%d).\n", 
ring->name, r);
                radeon_scratch_free(rdev, scratch);
                return r;
        }
@@ -2850,10 +2850,10 @@ int r600_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
                udelay(1);
        }
        if (i < rdev->usec_timeout) {
-               DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, 
i);
+               DRM_INFO("ring test on %s succeeded in %d usecs\n", ring->name, 
i);
        } else {
-               DRM_ERROR("radeon: ring %d test failed 
(scratch(0x%04X)=0x%08X)\n",
-                         ring->idx, scratch, tmp);
+               DRM_ERROR("radeon: ring %s test failed 
(scratch(0x%04X)=0x%08X)\n",
+                         ring->name, scratch, tmp);
                r = -EINVAL;
        }
        radeon_scratch_free(rdev, scratch);
diff --git a/drivers/gpu/drm/radeon/r600_dma.c 
b/drivers/gpu/drm/radeon/r600_dma.c
index 89ca2738c5d4..d69a6edce9ac 100644
--- a/drivers/gpu/drm/radeon/r600_dma.c
+++ b/drivers/gpu/drm/radeon/r600_dma.c
@@ -247,7 +247,7 @@ int r600_dma_ring_test(struct radeon_device *rdev,
 
        r = radeon_ring_lock(rdev, ring, 4);
        if (r) {
-               DRM_ERROR("radeon: dma failed to lock ring %d (%d).\n", 
ring->idx, r);
+               DRM_ERROR("radeon: dma failed to lock ring %s (%d).\n", 
ring->name, r);
                return r;
        }
        radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1));
@@ -264,10 +264,10 @@ int r600_dma_ring_test(struct radeon_device *rdev,
        }
 
        if (i < rdev->usec_timeout) {
-               DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, 
i);
+               DRM_INFO("ring test on %s succeeded in %d usecs\n", ring->name, 
i);
        } else {
-               DRM_ERROR("radeon: ring %d test failed (0x%08X)\n",
-                         ring->idx, tmp);
+               DRM_ERROR("radeon: ring %s test failed (0x%08X)\n",
+                         ring->name, tmp);
                r = -EINVAL;
        }
        return r;
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c 
b/drivers/gpu/drm/radeon/radeon_fence.c
index 1be8364b2a97..b873b995b0ff 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -809,6 +809,8 @@ int radeon_fence_driver_start_ring(struct radeon_device 
*rdev, int ring_idx)
 {
        uint64_t index;
        int r;
+       struct radeon_ring *ring = &rdev->ring[ring_idx];
+
        radeon_scratch_free(rdev, rdev->fence_drv[ring_idx].scratch_reg);
        if (rdev->wb.use_event || !radeon_ring_supports_scratch_reg(rdev, 
ring)) {
                rdev->fence_drv[ring_idx].scratch_reg = 0;
@@ -840,8 +842,8 @@ int radeon_fence_driver_start_ring(struct radeon_device 
*rdev, int ring_idx)
        radeon_fence_write(rdev, 
atomic64_read(&rdev->fence_drv[ring_idx].last_seq), ring_idx);
        rdev->fence_drv[ring_idx].initialized = true;
 
-       dev_info(rdev->dev, "fence driver on ring %d uses gpu addr 0x%016llx\n",
-                ring_idx, rdev->fence_drv[ring_idx].gpu_addr);
+       dev_info(rdev->dev, "fence driver on ring %s uses gpu addr 0x%016llx\n",
+                ring->name, rdev->fence_drv[ring_idx].gpu_addr);
        return 0;
 }
 
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
b/drivers/gpu/drm/radeon/radeon_ring.c
index 581ae20c46e4..b5cd28977c54 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -265,8 +265,8 @@ bool radeon_ring_test_lockup(struct radeon_device *rdev, 
struct radeon_ring *rin
 
        elapsed = jiffies_to_msecs(jiffies_64 - last);
        if (radeon_lockup_timeout && elapsed >= radeon_lockup_timeout) {
-               dev_err(rdev->dev, "ring %d stalled for more than %llumsec\n",
-                       ring->idx, elapsed);
+               dev_err(rdev->dev, "ring %s stalled for more than %llumsec\n",
+                       ring->name, elapsed);
                return true;
        }
        /* give a chance to the GPU ... */
diff --git a/drivers/gpu/drm/radeon/radeon_vce.c 
b/drivers/gpu/drm/radeon/radeon_vce.c
index d1871af967d4..761e8b453e1e 100644
--- a/drivers/gpu/drm/radeon/radeon_vce.c
+++ b/drivers/gpu/drm/radeon/radeon_vce.c
@@ -760,8 +760,9 @@ int radeon_vce_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
 
        r = radeon_ring_lock(rdev, ring, 16);
        if (r) {
-               DRM_ERROR("radeon: vce failed to lock ring %d (%d).\n",
-                         ring->idx, r);
+               DRM_ERROR("radeon: vce failed to lock ring %s (%d).\n",
+                         ring->name, r);
+               DRM_INFO("Out %s", __func__);
                return r;
        }
        radeon_ring_write(ring, cpu_to_le32(VCE_CMD_END));
@@ -774,11 +775,11 @@ int radeon_vce_ring_test(struct radeon_device *rdev, 
struct radeon_ring *ring)
        }
 
        if (i < rdev->usec_timeout) {
-               DRM_INFO("ring test on %d succeeded in %d usecs\n",
-                        ring->idx, i);
+               DRM_INFO("ring test on %s succeeded in %d usecs\n",
+                        ring->name, i);
        } else {
-               DRM_ERROR("radeon: ring %d test failed\n",
-                        ring->idx);
+               DRM_ERROR("radeon: ring %s test failed\n",
+                        ring->name);
                r = -ETIMEDOUT;
        }
 
diff --git a/drivers/gpu/drm/radeon/uvd_v1_0.c 
b/drivers/gpu/drm/radeon/uvd_v1_0.c
index 5684639d20a6..8d7913b5b6a8 100644
--- a/drivers/gpu/drm/radeon/uvd_v1_0.c
+++ b/drivers/gpu/drm/radeon/uvd_v1_0.c
@@ -427,8 +427,8 @@ int uvd_v1_0_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
        WREG32(UVD_CONTEXT_ID, 0xCAFEDEAD);
        r = radeon_ring_lock(rdev, ring, 3);
        if (r) {
-               DRM_ERROR("radeon: cp failed to lock ring %d (%d).\n",
-                         ring->idx, r);
+               DRM_ERROR("radeon: cp failed to lock ring %s (%d).\n",
+                         ring->name, r);
                return r;
        }
        radeon_ring_write(ring, PACKET0(UVD_CONTEXT_ID, 0));
@@ -442,11 +442,11 @@ int uvd_v1_0_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
        }
 
        if (i < rdev->usec_timeout) {
-               DRM_INFO("ring test on %d succeeded in %d usecs\n",
-                        ring->idx, i);
+               DRM_INFO("ring test on %s succeeded in %d usecs\n",
+                        ring->name, i);
        } else {
-               DRM_ERROR("radeon: ring %d test failed (0x%08X)\n",
-                         ring->idx, tmp);
+               DRM_ERROR("radeon: ring %s test failed (0x%08X)\n",
+                         ring->name, tmp);
                r = -EINVAL;
        }
        return r;
@@ -534,7 +534,7 @@ int uvd_v1_0_ib_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
                goto error;
        }
        r = 0;
-       DRM_INFO("ib test on ring %d succeeded\n",  ring->idx);
+       DRM_INFO("ib test on ring %s succeeded\n",  ring->name);
 error:
        radeon_fence_unref(&fence);
        radeon_set_uvd_clocks(rdev, 0, 0);
-- 
2.50.1

Reply via email to