Skip to content

Commit

Permalink
drm/nouveau/vm: perform a bar flush when flushing vm
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maarten Lankhorst authored and Ben Skeggs committed Jul 1, 2013
1 parent 57f0ec1 commit 36798b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <subdev/timer.h>
#include <subdev/fb.h>
#include <subdev/bar.h>
#include <subdev/vm.h>

struct nv50_vmmgr_priv {
Expand Down Expand Up @@ -151,9 +152,12 @@ static void
nv50_vm_flush(struct nouveau_vm *vm)
{
struct nv50_vmmgr_priv *priv = (void *)vm->vmm;
struct nouveau_bar *bar = nouveau_bar(priv);
struct nouveau_engine *engine;
int i, vme;

bar->flush(bar);

mutex_lock(&nv_subdev(priv)->mutex);
for (i = 0; i < NVDEV_SUBDEV_NR; i++) {
if (!atomic_read(&vm->engref[i]))
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <subdev/fb.h>
#include <subdev/vm.h>
#include <subdev/ltcg.h>
#include <subdev/bar.h>

struct nvc0_vmmgr_priv {
struct nouveau_vmmgr base;
Expand Down Expand Up @@ -163,9 +164,12 @@ static void
nvc0_vm_flush(struct nouveau_vm *vm)
{
struct nvc0_vmmgr_priv *priv = (void *)vm->vmm;
struct nouveau_bar *bar = nouveau_bar(priv);
struct nouveau_vm_pgd *vpgd;
u32 type;

bar->flush(bar);

type = 0x00000001; /* PAGE_ALL */
if (atomic_read(&vm->engref[NVDEV_SUBDEV_BAR]))
type |= 0x00000004; /* HUB_ONLY */
Expand Down

0 comments on commit 36798b6

Please sign in to comment.