drm/nouveau/fifo: switch to new-style timer macros
authorBen Skeggs <bskeggs@redhat.com>
Thu, 20 Aug 2015 04:54:11 +0000 (14:54 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 28 Aug 2015 02:40:21 +0000 (12:40 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/fifo/g84.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.c

index dfc27a0d2ac29e1bfa328ddb3aa23343771caef7..b2da05d2f76d825491e2fcbffa2739431aa64c89 100644 (file)
@@ -106,7 +106,10 @@ g84_fifo_context_detach(struct nvkm_object *parent, bool suspend,
 
        save = nvkm_mask(device, 0x002520, 0x0000003f, 1 << engn);
        nvkm_wr32(device, 0x0032fc, nv_gpuobj(base)->addr >> 12);
-       done = nv_wait_ne(fifo, 0x0032fc, 0xffffffff, 0xffffffff);
+       done = nvkm_msec(device, 2000,
+               if (nvkm_rd32(device, 0x0032fc) != 0xffffffff)
+                       break;
+       ) >= 0;
        nvkm_wr32(device, 0x002520, save);
        if (!done) {
                nv_error(fifo, "channel %d [%s] unload timeout\n",
index f714bda4230f6220ab3f24fb82336c4d0a62c9fb..503ea80883452cf2a2f7134175dd6d8596639956 100644 (file)
@@ -166,7 +166,10 @@ gf100_fifo_context_detach(struct nvkm_object *parent, bool suspend,
        }
 
        nvkm_wr32(device, 0x002634, chan->base.chid);
-       if (!nv_wait(fifo, 0x002634, 0xffffffff, chan->base.chid)) {
+       if (nvkm_msec(device, 2000,
+               if (nvkm_rd32(device, 0x002634) == chan->base.chid)
+                       break;
+       ) < 0) {
                nv_error(fifo, "channel %d [%s] kick timeout\n",
                         chan->base.chid, nvkm_client_name(chan));
                if (suspend)
index cec1281dbd122446478a54f3316a714f758df25d..cc8151129888370233d939b66526182513751b70 100644 (file)
@@ -174,7 +174,10 @@ gk104_fifo_chan_kick(struct gk104_fifo_chan *chan)
        struct nvkm_device *device = fifo->base.engine.subdev.device;
 
        nvkm_wr32(device, 0x002634, chan->base.chid);
-       if (!nv_wait(fifo, 0x002634, 0x100000, 0x000000)) {
+       if (nvkm_msec(device, 2000,
+               if (!(nvkm_rd32(device, 0x002634) & 0x00100000))
+                       break;
+       ) < 0) {
                nv_error(fifo, "channel %d [%s] kick timeout\n",
                         chan->base.chid, nvkm_client_name(chan));
                return -EBUSY;
index 6339b473feb0ad200d6913c97ab77f41628b36a3..214bf122b19c6159e7935d04729da64b93aceeae 100644 (file)
@@ -321,9 +321,11 @@ __acquires(fifo->base.lock)
         * to avoid this, we invalidate the most recently calculated
         * instance.
         */
-       if (!nv_wait(fifo, NV04_PFIFO_CACHE1_PULL0,
-                          NV04_PFIFO_CACHE1_PULL0_HASH_BUSY, 0x00000000))
-               nv_warn(fifo, "timeout idling puller\n");
+       nvkm_msec(device, 2000,
+               u32 tmp = nvkm_rd32(device, NV04_PFIFO_CACHE1_PULL0);
+               if (!(tmp & NV04_PFIFO_CACHE1_PULL0_HASH_BUSY))
+                       break;
+       );
 
        if (nvkm_rd32(device, NV04_PFIFO_CACHE1_PULL0) &
                          NV04_PFIFO_CACHE1_PULL0_HASH_FAILED)
index 3a868f9c0a39be5057f3c5f43d13c85fd835cd10..e0188a674974aeaf4f542d5c4c07b152f84e371b 100644 (file)
@@ -135,7 +135,10 @@ nv50_fifo_context_detach(struct nvkm_object *parent, bool suspend,
 
        /* do the kickoff... */
        nvkm_wr32(device, 0x0032fc, nv_gpuobj(base)->addr >> 12);
-       if (!nv_wait_ne(fifo, 0x0032fc, 0xffffffff, 0xffffffff)) {
+       if (nvkm_msec(device, 2000,
+               if (nvkm_rd32(device, 0x0032fc) != 0xffffffff)
+                       break;
+       ) < 0) {
                nv_error(fifo, "channel %d [%s] unload timeout\n",
                         chan->base.chid, nvkm_client_name(chan));
                if (suspend)