diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-09-26 01:01:39 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-10-02 23:13:16 -0400 |
commit | 8a57d279d6e1bf19d2d2e54f51d4f40c46c7d1a8 (patch) | |
tree | 3c9310d87287df9d9231ce510306c1b90c7d08ef | |
parent | dc73b45ad456b173610a211c588d003f7ea77957 (diff) |
drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
We don't need to pull the page address out of the page tables on nv4x
chips that have a real GART.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c index 5ad76f74416f..9f4cc2f31994 100644 --- a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c +++ b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c | |||
@@ -44,21 +44,24 @@ nv04_dmaobj_bind(struct nouveau_dmaeng *dmaeng, | |||
44 | struct nouveau_dmaobj *dmaobj, | 44 | struct nouveau_dmaobj *dmaobj, |
45 | struct nouveau_gpuobj **pgpuobj) | 45 | struct nouveau_gpuobj **pgpuobj) |
46 | { | 46 | { |
47 | struct nv04_vmmgr_priv *vmm = nv04_vmmgr(dmaeng); | ||
47 | struct nouveau_gpuobj *gpuobj; | 48 | struct nouveau_gpuobj *gpuobj; |
48 | u32 flags0 = nv_mclass(dmaobj); | 49 | u32 flags0 = nv_mclass(dmaobj); |
49 | u32 flags2 = 0x00000000; | 50 | u32 flags2 = 0x00000000; |
50 | u32 offset = (dmaobj->start & 0xfffff000); | 51 | u64 offset = dmaobj->start & 0xfffff000; |
51 | u32 adjust = (dmaobj->start & 0x00000fff); | 52 | u64 adjust = dmaobj->start & 0x00000fff; |
52 | u32 length = dmaobj->limit - dmaobj->start; | 53 | u32 length = dmaobj->limit - dmaobj->start; |
53 | int ret; | 54 | int ret; |
54 | 55 | ||
55 | if (dmaobj->target == NV_MEM_TARGET_VM) { | 56 | if (dmaobj->target == NV_MEM_TARGET_VM) { |
56 | gpuobj = nv04_vmmgr(dmaeng)->vm->pgt[0].obj[0]; | 57 | if (nv_object(vmm)->oclass == &nv04_vmmgr_oclass) { |
57 | if (dmaobj->start == 0) | 58 | struct nouveau_gpuobj *pgt = vmm->vm->pgt[0].obj[0]; |
58 | return nouveau_gpuobj_dup(parent, gpuobj, pgpuobj); | 59 | if (!dmaobj->start) |
60 | return nouveau_gpuobj_dup(parent, pgt, pgpuobj); | ||
61 | offset = nv_ro32(pgt, 8 + (offset >> 10)); | ||
62 | offset &= 0xfffff000; | ||
63 | } | ||
59 | 64 | ||
60 | offset = nv_ro32(gpuobj, 8 + (offset >> 10)); | ||
61 | offset &= 0xfffff000; | ||
62 | dmaobj->target = NV_MEM_TARGET_PCI; | 65 | dmaobj->target = NV_MEM_TARGET_PCI; |
63 | dmaobj->access = NV_MEM_ACCESS_RW; | 66 | dmaobj->access = NV_MEM_ACCESS_RW; |
64 | } | 67 | } |