]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
drm/amdgpu: cleanup skipping IB test on KIQ
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ib.c
index b8963b725dfa05baf9353f0859bde8af7c4e14f7..ec0e6238dbc3678f40021d298064afc8c3b5c7d3 100644 (file)
@@ -146,7 +146,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
                fence_ctx = 0;
        }
 
-       if (!ring->ready) {
+       if (!ring->sched.ready) {
                dev_err(adev->dev, "couldn't schedule ib on ring <%s>\n", ring->name);
                return -EINVAL;
        }
@@ -347,19 +347,14 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
                tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT;
        }
 
-       for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
+       for (i = 0; i < adev->num_rings; ++i) {
                struct amdgpu_ring *ring = adev->rings[i];
                long tmo;
 
-               if (!ring || !ring->ready)
-                       continue;
-
-               /* skip IB tests for KIQ in general for the below reasons:
-                * 1. We never submit IBs to the KIQ
-                * 2. KIQ doesn't use the EOP interrupts,
-                *    we use some other CP interrupt.
+               /* KIQ rings don't have an IB test because we never submit IBs
+                * to them and they have no interrupt support.
                 */
-               if (ring->funcs->type == AMDGPU_RING_TYPE_KIQ)
+               if (!ring->sched.ready || !ring->funcs->test_ib)
                        continue;
 
                /* MM engine need more time */
@@ -374,20 +369,23 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
                        tmo = tmo_gfx;
 
                r = amdgpu_ring_test_ib(ring, tmo);
-               if (r) {
-                       ring->ready = false;
-
-                       if (ring == &adev->gfx.gfx_ring[0]) {
-                               /* oh, oh, that's really bad */
-                               DRM_ERROR("amdgpu: failed testing IB on GFX ring (%d).\n", r);
-                               adev->accel_working = false;
-                               return r;
-
-                       } else {
-                               /* still not good, but we can live with it */
-                               DRM_ERROR("amdgpu: failed testing IB on ring %d (%d).\n", i, r);
-                               ret = r;
-                       }
+               if (!r) {
+                       DRM_DEV_DEBUG(adev->dev, "ib test on %s succeeded\n",
+                                     ring->name);
+                       continue;
+               }
+
+               ring->sched.ready = false;
+               DRM_DEV_ERROR(adev->dev, "IB test failed on %s (%d).\n",
+                         ring->name, r);
+
+               if (ring == &adev->gfx.gfx_ring[0]) {
+                       /* oh, oh, that's really bad */
+                       adev->accel_working = false;
+                       return r;
+
+               } else {
+                       ret = r;
                }
        }
        return ret;
This page took 0.036559 seconds and 4 git commands to generate.