drm/nouveau/mmu: 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:20 +0000 (12:40 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c

index 3551b55a5646cf4a1dc15d6a8d86c9054edc4dee..f0b6f590ec764d30a378b2b4feddc26756996680 100644 (file)
@@ -170,19 +170,19 @@ gf100_vm_flush(struct nvkm_vm *vm)
                /* looks like maybe a "free flush slots" counter, the
                 * faster you write to 0x100cbc to more it decreases
                 */
-               if (!nv_wait_ne(mmu, 0x100c80, 0x00ff0000, 0x00000000)) {
-                       nv_error(mmu, "vm timeout 0: 0x%08x %d\n",
-                                nvkm_rd32(device, 0x100c80), type);
-               }
+               nvkm_msec(device, 2000,
+                       if (nvkm_rd32(device, 0x100c80) & 0x00ff0000)
+                               break;
+               );
 
                nvkm_wr32(device, 0x100cb8, vpgd->obj->addr >> 8);
                nvkm_wr32(device, 0x100cbc, 0x80000000 | type);
 
                /* wait for flush to be queued? */
-               if (!nv_wait(mmu, 0x100c80, 0x00008000, 0x00008000)) {
-                       nv_error(mmu, "vm timeout 1: 0x%08x %d\n",
-                                nvkm_rd32(device, 0x100c80), type);
-               }
+               nvkm_msec(device, 2000,
+                       if (nvkm_rd32(device, 0x100c80) & 0x00008000)
+                               break;
+               );
        }
        mutex_unlock(&nv_subdev(mmu)->mutex);
 }
index 609c6a69b60aade80b483ff37de77d5bb066eb2e..378cd1d363aecb443bccf1390f4d86f6d7640122 100644 (file)
@@ -69,10 +69,10 @@ nv41_vm_flush(struct nvkm_vm *vm)
 
        mutex_lock(&nv_subdev(mmu)->mutex);
        nvkm_wr32(device, 0x100810, 0x00000022);
-       if (!nv_wait(mmu, 0x100810, 0x00000020, 0x00000020)) {
-               nv_warn(mmu, "flush timeout, 0x%08x\n",
-                       nvkm_rd32(device, 0x100810));
-       }
+       nvkm_msec(device, 2000,
+               if (nvkm_rd32(device, 0x100810) & 0x00000020)
+                       break;
+       );
        nvkm_wr32(device, 0x100810, 0x00000000);
        mutex_unlock(&nv_subdev(mmu)->mutex);
 }
index 371f627e17dbdd5e569e9167c53cf393c3ddb358..64203abaaee724e3587468bb0a8560115ccaec6f 100644 (file)
@@ -143,8 +143,10 @@ nv44_vm_flush(struct nvkm_vm *vm)
        struct nvkm_device *device = mmu->base.subdev.device;
        nvkm_wr32(device, 0x100814, mmu->base.limit - NV44_GART_PAGE);
        nvkm_wr32(device, 0x100808, 0x00000020);
-       if (!nv_wait(mmu, 0x100808, 0x00000001, 0x00000001))
-               nv_error(mmu, "timeout: 0x%08x\n", nvkm_rd32(device, 0x100808));
+       nvkm_msec(device, 2000,
+               if (nvkm_rd32(device, 0x100808) & 0x00000001)
+                       break;
+       );
        nvkm_wr32(device, 0x100808, 0x00000000);
 }
 
index 1d7e1aa7e7d3d48c2711346a7ec2c92b551c4439..45b5b5ac3e9bd20c374816bebae12cb8a8e43a0d 100644 (file)
@@ -182,7 +182,10 @@ nv50_vm_flush(struct nvkm_vm *vm)
                }
 
                nvkm_wr32(device, 0x100c80, (vme << 16) | 1);
-               if (!nv_wait(mmu, 0x100c80, 0x00000001, 0x00000000))
+               if (nvkm_msec(device, 2000,
+                       if (!(nvkm_rd32(device, 0x100c80) & 0x00000001))
+                               break;
+               ) < 0)
                        nv_error(mmu, "vm flush timeout: engine %d\n", vme);
        }
        mutex_unlock(&nv_subdev(mmu)->mutex);