diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-02-13 18:57:35 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-02-24 15:46:07 -0500 |
commit | 8f7286f8e4e80f7b868ba3d117ae900f0d207cbe (patch) | |
tree | 018804469b7bce4033b4156442c904512282fab2 /drivers/gpu/drm/nouveau/nv50_vm.c | |
parent | 26c0c9e33a2eb44b345d22d5928d5c8b7b261226 (diff) |
drm/nv50: support for compression
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_vm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_vm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c index 37f941bf4a0b..b23794c8859b 100644 --- a/drivers/gpu/drm/nouveau/nv50_vm.c +++ b/drivers/gpu/drm/nouveau/nv50_vm.c | |||
@@ -83,8 +83,9 @@ nv50_vm_addr(struct nouveau_vma *vma, u64 phys, u32 memtype, u32 target) | |||
83 | 83 | ||
84 | void | 84 | void |
85 | nv50_vm_map(struct nouveau_vma *vma, struct nouveau_gpuobj *pgt, | 85 | nv50_vm_map(struct nouveau_vma *vma, struct nouveau_gpuobj *pgt, |
86 | struct nouveau_mem *mem, u32 pte, u32 cnt, u64 phys) | 86 | struct nouveau_mem *mem, u32 pte, u32 cnt, u64 phys, u64 delta) |
87 | { | 87 | { |
88 | u32 comp = (mem->memtype & 0x180) >> 7; | ||
88 | u32 block; | 89 | u32 block; |
89 | int i; | 90 | int i; |
90 | 91 | ||
@@ -105,6 +106,11 @@ nv50_vm_map(struct nouveau_vma *vma, struct nouveau_gpuobj *pgt, | |||
105 | 106 | ||
106 | phys += block << (vma->node->type - 3); | 107 | phys += block << (vma->node->type - 3); |
107 | cnt -= block; | 108 | cnt -= block; |
109 | if (comp) { | ||
110 | u32 tag = mem->tag->start + ((delta >> 16) * comp); | ||
111 | offset_h |= (tag << 17); | ||
112 | delta += block << (vma->node->type - 3); | ||
113 | } | ||
108 | 114 | ||
109 | while (block) { | 115 | while (block) { |
110 | nv_wo32(pgt, pte + 0, offset_l); | 116 | nv_wo32(pgt, pte + 0, offset_l); |