diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-07-07 21:39:18 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-07-12 20:13:41 -0400 |
commit | 631872155f35b907ae3950016d9e72a308449d69 (patch) | |
tree | b75acbc33e97a3c811a240fccc16b3f17cb0ed83 /drivers/gpu/drm/nouveau/nv50_instmem.c | |
parent | f56cb86f9abd229418f894a8ffedfb9ff465c181 (diff) |
drm/nv50: move tlb flushing to a helper function
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_instmem.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_instmem.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index d9feee3b9f58..2a5ec887291c 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
@@ -453,19 +453,8 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) | |||
453 | } | 453 | } |
454 | dev_priv->engine.instmem.flush(dev); | 454 | dev_priv->engine.instmem.flush(dev); |
455 | 455 | ||
456 | nv_wr32(dev, 0x100c80, 0x00040001); | 456 | nv50_vm_flush(dev, 4); |
457 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { | 457 | nv50_vm_flush(dev, 6); |
458 | NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (1)\n"); | ||
459 | NV_ERROR(dev, "0x100c80 = 0x%08x\n", nv_rd32(dev, 0x100c80)); | ||
460 | return -EBUSY; | ||
461 | } | ||
462 | |||
463 | nv_wr32(dev, 0x100c80, 0x00060001); | ||
464 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { | ||
465 | NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (2)\n"); | ||
466 | NV_ERROR(dev, "0x100c80 = 0x%08x\n", nv_rd32(dev, 0x100c80)); | ||
467 | return -EBUSY; | ||
468 | } | ||
469 | 458 | ||
470 | gpuobj->im_bound = 1; | 459 | gpuobj->im_bound = 1; |
471 | return 0; | 460 | return 0; |
@@ -502,3 +491,11 @@ nv50_instmem_flush(struct drm_device *dev) | |||
502 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 491 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
503 | } | 492 | } |
504 | 493 | ||
494 | void | ||
495 | nv50_vm_flush(struct drm_device *dev, int engine) | ||
496 | { | ||
497 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); | ||
498 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) | ||
499 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); | ||
500 | } | ||
501 | |||