]> 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 51b5e977ca885ef1f7d7df49698f3c6843bab437..ec0e6238dbc3678f40021d298064afc8c3b5c7d3 100644 (file)
@@ -32,6 +32,7 @@
 #include <drm/amdgpu_drm.h>
 #include "amdgpu.h"
 #include "atom.h"
+#include "amdgpu_trace.h"
 
 #define AMDGPU_IB_TEST_TIMEOUT msecs_to_jiffies(1000)
 
@@ -145,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;
        }
@@ -170,6 +171,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
             (amdgpu_sriov_vf(adev) && need_ctx_switch) ||
             amdgpu_vm_need_pipeline_sync(ring, job))) {
                need_pipe_sync = true;
+
+               if (tmp)
+                       trace_amdgpu_ib_pipe_sync(job, tmp);
+
                dma_fence_put(tmp);
        }
 
@@ -342,11 +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)
+               /* KIQ rings don't have an IB test because we never submit IBs
+                * to them and they have no interrupt support.
+                */
+               if (!ring->sched.ready || !ring->funcs->test_ib)
                        continue;
 
                /* MM engine need more time */
@@ -361,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.038624 seconds and 4 git commands to generate.