Loading drivers/gpu/drm/nouveau/Kbuild +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ nouveau-y += nouveau_mem.o nouveau-y += nouveau_prime.o nouveau-y += nouveau_sgdma.o nouveau-y += nouveau_ttm.o nouveau-y += nouveau_vmm.o # DRM - modesetting nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o Loading drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h +0 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ struct nvkm_vm_pgd { }; struct nvkm_vma { struct list_head head; int refcount; struct nvkm_vm *vm; struct nvkm_mm_node *node; union { Loading drivers/gpu/drm/nouveau/nouveau_abi16.c +5 −5 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include "nouveau_gem.h" #include "nouveau_chan.h" #include "nouveau_abi16.h" #include "nouveau_vmm.h" static struct nouveau_abi16 * nouveau_abi16(struct drm_file *file_priv) Loading Loading @@ -134,7 +135,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, } if (chan->ntfy) { nouveau_bo_vma_del(chan->ntfy, &chan->ntfy_vma); nouveau_vma_del(&chan->ntfy_vma); nouveau_bo_unpin(chan->ntfy); drm_gem_object_unreference_unlocked(&chan->ntfy->gem); } Loading Loading @@ -329,8 +330,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) goto done; if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) { ret = nouveau_bo_vma_add(chan->ntfy, cli->vm, &chan->ntfy_vma); ret = nouveau_vma_new(chan->ntfy, &cli->vmm, &chan->ntfy_vma); if (ret) goto done; } Loading Loading @@ -548,8 +548,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) { args.target = NV_DMA_V0_TARGET_VM; args.access = NV_DMA_V0_ACCESS_VM; args.start += chan->ntfy_vma.offset; args.limit += chan->ntfy_vma.offset; args.start += chan->ntfy_vma->addr; args.limit += chan->ntfy_vma->addr; } else if (drm->agp.bridge) { args.target = NV_DMA_V0_TARGET_AGP; Loading drivers/gpu/drm/nouveau/nouveau_abi16.h +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ struct nouveau_abi16_chan { struct nouveau_channel *chan; struct list_head notifiers; struct nouveau_bo *ntfy; struct nvkm_vma ntfy_vma; struct nouveau_vma *ntfy_vma; struct nvkm_mm heap; }; Loading drivers/gpu/drm/nouveau/nouveau_bo.c +4 −47 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include "nouveau_ttm.h" #include "nouveau_gem.h" #include "nouveau_mem.h" #include "nouveau_vmm.h" /* * NV10-NV40 tiling helpers Loading Loading @@ -1223,7 +1224,7 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, { struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL; struct nouveau_bo *nvbo = nouveau_bo(bo); struct nvkm_vma *vma; struct nouveau_vma *vma; /* ttm can now (stupidly) pass the driver bos it didn't create... */ if (bo->destroy != nouveau_bo_del_ttm) Loading @@ -1232,12 +1233,12 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, if (mem && new_reg->mem_type != TTM_PL_SYSTEM && mem->mem.page == nvbo->page) { list_for_each_entry(vma, &nvbo->vma_list, head) { nvkm_vm_map(vma, mem->_mem); nouveau_vma_map(vma, mem); } } else { list_for_each_entry(vma, &nvbo->vma_list, head) { WARN_ON(ttm_bo_wait(bo, false, false)); nvkm_vm_unmap(vma); nouveau_vma_unmap(vma); } } } Loading Loading @@ -1599,47 +1600,3 @@ struct ttm_bo_driver nouveau_bo_driver = { .io_mem_free = &nouveau_ttm_io_mem_free, .io_mem_pfn = ttm_bo_default_io_mem_pfn, }; struct nvkm_vma * nouveau_bo_vma_find(struct nouveau_bo *nvbo, struct nvkm_vm *vm) { struct nvkm_vma *vma; list_for_each_entry(vma, &nvbo->vma_list, head) { if (vma->vm == vm) return vma; } return NULL; } int nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nvkm_vm *vm, struct nvkm_vma *vma) { const u32 size = nvbo->bo.mem.num_pages << PAGE_SHIFT; struct nouveau_mem *mem = nouveau_mem(&nvbo->bo.mem); int ret; ret = nvkm_vm_get(vm, size, nvbo->page, NV_MEM_ACCESS_RW, vma); if (ret) return ret; if (nvbo->bo.mem.mem_type != TTM_PL_SYSTEM && mem->mem.page == nvbo->page) nvkm_vm_map(vma, mem->_mem); list_add_tail(&vma->head, &nvbo->vma_list); vma->refcount = 1; return 0; } void nouveau_bo_vma_del(struct nouveau_bo *nvbo, struct nvkm_vma *vma) { if (vma->node) { if (nvbo->bo.mem.mem_type != TTM_PL_SYSTEM) nvkm_vm_unmap(vma); nvkm_vm_put(vma); list_del(&vma->head); } } Loading
drivers/gpu/drm/nouveau/Kbuild +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ nouveau-y += nouveau_mem.o nouveau-y += nouveau_prime.o nouveau-y += nouveau_sgdma.o nouveau-y += nouveau_ttm.o nouveau-y += nouveau_vmm.o # DRM - modesetting nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o Loading
drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h +0 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ struct nvkm_vm_pgd { }; struct nvkm_vma { struct list_head head; int refcount; struct nvkm_vm *vm; struct nvkm_mm_node *node; union { Loading
drivers/gpu/drm/nouveau/nouveau_abi16.c +5 −5 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include "nouveau_gem.h" #include "nouveau_chan.h" #include "nouveau_abi16.h" #include "nouveau_vmm.h" static struct nouveau_abi16 * nouveau_abi16(struct drm_file *file_priv) Loading Loading @@ -134,7 +135,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, } if (chan->ntfy) { nouveau_bo_vma_del(chan->ntfy, &chan->ntfy_vma); nouveau_vma_del(&chan->ntfy_vma); nouveau_bo_unpin(chan->ntfy); drm_gem_object_unreference_unlocked(&chan->ntfy->gem); } Loading Loading @@ -329,8 +330,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) goto done; if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) { ret = nouveau_bo_vma_add(chan->ntfy, cli->vm, &chan->ntfy_vma); ret = nouveau_vma_new(chan->ntfy, &cli->vmm, &chan->ntfy_vma); if (ret) goto done; } Loading Loading @@ -548,8 +548,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) { args.target = NV_DMA_V0_TARGET_VM; args.access = NV_DMA_V0_ACCESS_VM; args.start += chan->ntfy_vma.offset; args.limit += chan->ntfy_vma.offset; args.start += chan->ntfy_vma->addr; args.limit += chan->ntfy_vma->addr; } else if (drm->agp.bridge) { args.target = NV_DMA_V0_TARGET_AGP; Loading
drivers/gpu/drm/nouveau/nouveau_abi16.h +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ struct nouveau_abi16_chan { struct nouveau_channel *chan; struct list_head notifiers; struct nouveau_bo *ntfy; struct nvkm_vma ntfy_vma; struct nouveau_vma *ntfy_vma; struct nvkm_mm heap; }; Loading
drivers/gpu/drm/nouveau/nouveau_bo.c +4 −47 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include "nouveau_ttm.h" #include "nouveau_gem.h" #include "nouveau_mem.h" #include "nouveau_vmm.h" /* * NV10-NV40 tiling helpers Loading Loading @@ -1223,7 +1224,7 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, { struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL; struct nouveau_bo *nvbo = nouveau_bo(bo); struct nvkm_vma *vma; struct nouveau_vma *vma; /* ttm can now (stupidly) pass the driver bos it didn't create... */ if (bo->destroy != nouveau_bo_del_ttm) Loading @@ -1232,12 +1233,12 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, if (mem && new_reg->mem_type != TTM_PL_SYSTEM && mem->mem.page == nvbo->page) { list_for_each_entry(vma, &nvbo->vma_list, head) { nvkm_vm_map(vma, mem->_mem); nouveau_vma_map(vma, mem); } } else { list_for_each_entry(vma, &nvbo->vma_list, head) { WARN_ON(ttm_bo_wait(bo, false, false)); nvkm_vm_unmap(vma); nouveau_vma_unmap(vma); } } } Loading Loading @@ -1599,47 +1600,3 @@ struct ttm_bo_driver nouveau_bo_driver = { .io_mem_free = &nouveau_ttm_io_mem_free, .io_mem_pfn = ttm_bo_default_io_mem_pfn, }; struct nvkm_vma * nouveau_bo_vma_find(struct nouveau_bo *nvbo, struct nvkm_vm *vm) { struct nvkm_vma *vma; list_for_each_entry(vma, &nvbo->vma_list, head) { if (vma->vm == vm) return vma; } return NULL; } int nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nvkm_vm *vm, struct nvkm_vma *vma) { const u32 size = nvbo->bo.mem.num_pages << PAGE_SHIFT; struct nouveau_mem *mem = nouveau_mem(&nvbo->bo.mem); int ret; ret = nvkm_vm_get(vm, size, nvbo->page, NV_MEM_ACCESS_RW, vma); if (ret) return ret; if (nvbo->bo.mem.mem_type != TTM_PL_SYSTEM && mem->mem.page == nvbo->page) nvkm_vm_map(vma, mem->_mem); list_add_tail(&vma->head, &nvbo->vma_list); vma->refcount = 1; return 0; } void nouveau_bo_vma_del(struct nouveau_bo *nvbo, struct nvkm_vma *vma) { if (vma->node) { if (nvbo->bo.mem.mem_type != TTM_PL_SYSTEM) nvkm_vm_unmap(vma); nvkm_vm_put(vma); list_del(&vma->head); } }