diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:09 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:16 +1000 |
commit | 83f56106ead017a07868176279746d73bc7a7060 (patch) | |
tree | 714e684b2d2d9dbada3f577f51427056f69a83fd /drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c | |
parent | 25e3a463fc1bd39c01cc6d19d2c8b4c4725699b9 (diff) | |
download | linux-83f56106ead017a07868176279746d73bc7a7060.tar.bz2 |
drm/nouveau/mmu: switch to device pri macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c index 860654fee387..371f627e17db 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c @@ -140,11 +140,12 @@ static void nv44_vm_flush(struct nvkm_vm *vm) { struct nv04_mmu *mmu = (void *)vm->mmu; - nv_wr32(mmu, 0x100814, mmu->base.limit - NV44_GART_PAGE); - nv_wr32(mmu, 0x100808, 0x00000020); + struct nvkm_device *device = mmu->base.subdev.device; + nvkm_wr32(device, 0x100814, mmu->base.limit - NV44_GART_PAGE); + nvkm_wr32(device, 0x100808, 0x00000020); if (!nv_wait(mmu, 0x100808, 0x00000001, 0x00000001)) - nv_error(mmu, "timeout: 0x%08x\n", nv_rd32(mmu, 0x100808)); - nv_wr32(mmu, 0x100808, 0x00000000); + nv_error(mmu, "timeout: 0x%08x\n", nvkm_rd32(device, 0x100808)); + nvkm_wr32(device, 0x100808, 0x00000000); } /******************************************************************************* @@ -208,6 +209,7 @@ static int nv44_mmu_init(struct nvkm_object *object) { struct nv04_mmu *mmu = (void *)object; + struct nvkm_device *device = mmu->base.subdev.device; struct nvkm_gpuobj *gart = mmu->vm->pgt[0].obj[0]; u32 addr; int ret; @@ -220,17 +222,17 @@ nv44_mmu_init(struct nvkm_object *object) * allocated on 512KiB alignment, and not exceed a total size * of 512KiB for this to work correctly */ - addr = nv_rd32(mmu, 0x10020c); + addr = nvkm_rd32(device, 0x10020c); addr -= ((gart->addr >> 19) + 1) << 19; - nv_wr32(mmu, 0x100850, 0x80000000); - nv_wr32(mmu, 0x100818, mmu->null); - nv_wr32(mmu, 0x100804, NV44_GART_SIZE); - nv_wr32(mmu, 0x100850, 0x00008000); - nv_mask(mmu, 0x10008c, 0x00000200, 0x00000200); - nv_wr32(mmu, 0x100820, 0x00000000); - nv_wr32(mmu, 0x10082c, 0x00000001); - nv_wr32(mmu, 0x100800, addr | 0x00000010); + nvkm_wr32(device, 0x100850, 0x80000000); + nvkm_wr32(device, 0x100818, mmu->null); + nvkm_wr32(device, 0x100804, NV44_GART_SIZE); + nvkm_wr32(device, 0x100850, 0x00008000); + nvkm_mask(device, 0x10008c, 0x00000200, 0x00000200); + nvkm_wr32(device, 0x100820, 0x00000000); + nvkm_wr32(device, 0x10082c, 0x00000001); + nvkm_wr32(device, 0x100800, addr | 0x00000010); return 0; } |