diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2013-06-11 08:17:25 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-06-30 23:50:42 -0400 |
commit | 36798b61ed799962e08d49a632fee94b5177d4ac (patch) | |
tree | 4b64f19ef2adf329a82f706e9501b3090f36861e | |
parent | 57f0ec159b77df764a6948f8a612b0b825cd8350 (diff) |
drm/nouveau/vm: perform a bar flush when flushing vm
Appears to fix the regression from "drm/nvc0/vm: handle bar tlb flushes
internally".
nvidia always seems to do this flush after writing values.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c index 50c66122cc89..486c813b9ea9 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <subdev/timer.h> | 28 | #include <subdev/timer.h> |
29 | #include <subdev/fb.h> | 29 | #include <subdev/fb.h> |
30 | #include <subdev/bar.h> | ||
30 | #include <subdev/vm.h> | 31 | #include <subdev/vm.h> |
31 | 32 | ||
32 | struct nv50_vmmgr_priv { | 33 | struct nv50_vmmgr_priv { |
@@ -151,9 +152,12 @@ static void | |||
151 | nv50_vm_flush(struct nouveau_vm *vm) | 152 | nv50_vm_flush(struct nouveau_vm *vm) |
152 | { | 153 | { |
153 | struct nv50_vmmgr_priv *priv = (void *)vm->vmm; | 154 | struct nv50_vmmgr_priv *priv = (void *)vm->vmm; |
155 | struct nouveau_bar *bar = nouveau_bar(priv); | ||
154 | struct nouveau_engine *engine; | 156 | struct nouveau_engine *engine; |
155 | int i, vme; | 157 | int i, vme; |
156 | 158 | ||
159 | bar->flush(bar); | ||
160 | |||
157 | mutex_lock(&nv_subdev(priv)->mutex); | 161 | mutex_lock(&nv_subdev(priv)->mutex); |
158 | for (i = 0; i < NVDEV_SUBDEV_NR; i++) { | 162 | for (i = 0; i < NVDEV_SUBDEV_NR; i++) { |
159 | if (!atomic_read(&vm->engref[i])) | 163 | if (!atomic_read(&vm->engref[i])) |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c index 6c3aea55d503..668cf964e4a9 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <subdev/fb.h> | 29 | #include <subdev/fb.h> |
30 | #include <subdev/vm.h> | 30 | #include <subdev/vm.h> |
31 | #include <subdev/ltcg.h> | 31 | #include <subdev/ltcg.h> |
32 | #include <subdev/bar.h> | ||
32 | 33 | ||
33 | struct nvc0_vmmgr_priv { | 34 | struct nvc0_vmmgr_priv { |
34 | struct nouveau_vmmgr base; | 35 | struct nouveau_vmmgr base; |
@@ -163,9 +164,12 @@ static void | |||
163 | nvc0_vm_flush(struct nouveau_vm *vm) | 164 | nvc0_vm_flush(struct nouveau_vm *vm) |
164 | { | 165 | { |
165 | struct nvc0_vmmgr_priv *priv = (void *)vm->vmm; | 166 | struct nvc0_vmmgr_priv *priv = (void *)vm->vmm; |
167 | struct nouveau_bar *bar = nouveau_bar(priv); | ||
166 | struct nouveau_vm_pgd *vpgd; | 168 | struct nouveau_vm_pgd *vpgd; |
167 | u32 type; | 169 | u32 type; |
168 | 170 | ||
171 | bar->flush(bar); | ||
172 | |||
169 | type = 0x00000001; /* PAGE_ALL */ | 173 | type = 0x00000001; /* PAGE_ALL */ |
170 | if (atomic_read(&vm->engref[NVDEV_SUBDEV_BAR])) | 174 | if (atomic_read(&vm->engref[NVDEV_SUBDEV_BAR])) |
171 | type |= 0x00000004; /* HUB_ONLY */ | 175 | type |= 0x00000004; /* HUB_ONLY */ |