|
@@ -159,39 +159,37 @@ nvc0_vm_unmap(struct nouveau_gpuobj *pgt, u32 pte, u32 cnt)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void
|
|
|
-nvc0_vm_flush_engine(struct nouveau_subdev *subdev, u64 addr, int type)
|
|
|
-{
|
|
|
- struct nvc0_vmmgr_priv *priv = (void *)nouveau_vmmgr(subdev);
|
|
|
-
|
|
|
- /* looks like maybe a "free flush slots" counter, the
|
|
|
- * faster you write to 0x100cbc to more it decreases
|
|
|
- */
|
|
|
- mutex_lock(&nv_subdev(priv)->mutex);
|
|
|
- if (!nv_wait_ne(subdev, 0x100c80, 0x00ff0000, 0x00000000)) {
|
|
|
- nv_error(subdev, "vm timeout 0: 0x%08x %d\n",
|
|
|
- nv_rd32(subdev, 0x100c80), type);
|
|
|
- }
|
|
|
-
|
|
|
- nv_wr32(subdev, 0x100cb8, addr >> 8);
|
|
|
- nv_wr32(subdev, 0x100cbc, 0x80000000 | type);
|
|
|
-
|
|
|
- /* wait for flush to be queued? */
|
|
|
- if (!nv_wait(subdev, 0x100c80, 0x00008000, 0x00008000)) {
|
|
|
- nv_error(subdev, "vm timeout 1: 0x%08x %d\n",
|
|
|
- nv_rd32(subdev, 0x100c80), type);
|
|
|
- }
|
|
|
- mutex_unlock(&nv_subdev(priv)->mutex);
|
|
|
-}
|
|
|
-
|
|
|
static void
|
|
|
nvc0_vm_flush(struct nouveau_vm *vm)
|
|
|
{
|
|
|
+ struct nvc0_vmmgr_priv *priv = (void *)vm->vmm;
|
|
|
struct nouveau_vm_pgd *vpgd;
|
|
|
+ u32 type;
|
|
|
|
|
|
+ type = 0x00000001; /* PAGE_ALL */
|
|
|
+ if (atomic_read(&vm->engref[NVDEV_SUBDEV_BAR]))
|
|
|
+ type |= 0x00000004; /* HUB_ONLY */
|
|
|
+
|
|
|
+ mutex_lock(&nv_subdev(priv)->mutex);
|
|
|
list_for_each_entry(vpgd, &vm->pgd_list, head) {
|
|
|
- nvc0_vm_flush_engine(nv_subdev(vm->vmm), vpgd->obj->addr, 1);
|
|
|
+ /* looks like maybe a "free flush slots" counter, the
|
|
|
+ * faster you write to 0x100cbc to more it decreases
|
|
|
+ */
|
|
|
+ if (!nv_wait_ne(priv, 0x100c80, 0x00ff0000, 0x00000000)) {
|
|
|
+ nv_error(priv, "vm timeout 0: 0x%08x %d\n",
|
|
|
+ nv_rd32(priv, 0x100c80), type);
|
|
|
+ }
|
|
|
+
|
|
|
+ nv_wr32(priv, 0x100cb8, vpgd->obj->addr >> 8);
|
|
|
+ nv_wr32(priv, 0x100cbc, 0x80000000 | type);
|
|
|
+
|
|
|
+ /* wait for flush to be queued? */
|
|
|
+ if (!nv_wait(priv, 0x100c80, 0x00008000, 0x00008000)) {
|
|
|
+ nv_error(priv, "vm timeout 1: 0x%08x %d\n",
|
|
|
+ nv_rd32(priv, 0x100c80), type);
|
|
|
+ }
|
|
|
}
|
|
|
+ mutex_unlock(&nv_subdev(priv)->mutex);
|
|
|
}
|
|
|
|
|
|
static int
|