Commit af3b8d53 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/mmu: remove old vm creation hooks

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 8e39abff
...@@ -616,31 +616,6 @@ nvkm_vm_legacy(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset, ...@@ -616,31 +616,6 @@ nvkm_vm_legacy(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset,
return 0; return 0;
} }
int
nvkm_vm_create(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset,
u32 block, struct lock_class_key *key, struct nvkm_vm **pvm)
{
static struct lock_class_key _key;
struct nvkm_vm *vm;
int ret;
vm = kzalloc(sizeof(*vm), GFP_KERNEL);
if (!vm)
return -ENOMEM;
__mutex_init(&vm->mutex, "&vm->mutex", key ? key : &_key);
vm->mmu = mmu;
ret = nvkm_vm_legacy(mmu, offset, length, mm_offset, block, vm);
if (ret) {
kfree(vm);
return ret;
}
*pvm = vm;
return 0;
}
int int
nvkm_vm_new(struct nvkm_device *device, u64 offset, u64 length, u64 mm_offset, nvkm_vm_new(struct nvkm_device *device, u64 offset, u64 length, u64 mm_offset,
struct lock_class_key *key, struct nvkm_vm **pvm) struct lock_class_key *key, struct nvkm_vm **pvm)
...@@ -666,10 +641,7 @@ nvkm_vm_new(struct nvkm_device *device, u64 offset, u64 length, u64 mm_offset, ...@@ -666,10 +641,7 @@ nvkm_vm_new(struct nvkm_device *device, u64 offset, u64 length, u64 mm_offset,
return ret; return ret;
} }
if (!mmu->func->create) return -EINVAL;
return -EINVAL;
return mmu->func->create(mmu, offset, length, mm_offset, key, pvm);
} }
static int static int
......
...@@ -30,7 +30,6 @@ g84_mmu = { ...@@ -30,7 +30,6 @@ g84_mmu = {
.pgt_bits = 29 - 12, .pgt_bits = 29 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 16, .lpg_shift = 16,
.create = nv50_vm_create,
.map_pgt = nv50_vm_map_pgt, .map_pgt = nv50_vm_map_pgt,
.map = nv50_vm_map, .map = nv50_vm_map,
.map_sg = nv50_vm_map_sg, .map_sg = nv50_vm_map_sg,
......
...@@ -190,13 +190,6 @@ gf100_vm_flush(struct nvkm_vm *vm) ...@@ -190,13 +190,6 @@ gf100_vm_flush(struct nvkm_vm *vm)
mutex_unlock(&mmu->subdev.mutex); mutex_unlock(&mmu->subdev.mutex);
} }
int
gf100_vm_create(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset,
struct lock_class_key *key, struct nvkm_vm **pvm)
{
return nvkm_vm_create(mmu, offset, length, mm_offset, 4096, key, pvm);
}
static const struct nvkm_mmu_func static const struct nvkm_mmu_func
gf100_mmu = { gf100_mmu = {
.limit = (1ULL << 40), .limit = (1ULL << 40),
...@@ -204,7 +197,6 @@ gf100_mmu = { ...@@ -204,7 +197,6 @@ gf100_mmu = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
......
...@@ -30,7 +30,6 @@ gk104_mmu = { ...@@ -30,7 +30,6 @@ gk104_mmu = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
......
...@@ -30,7 +30,6 @@ gk20a_mmu = { ...@@ -30,7 +30,6 @@ gk20a_mmu = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
......
...@@ -32,7 +32,6 @@ gm200_mmu = { ...@@ -32,7 +32,6 @@ gm200_mmu = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
...@@ -48,7 +47,6 @@ gm200_mmu_fixed = { ...@@ -48,7 +47,6 @@ gm200_mmu_fixed = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
......
...@@ -32,7 +32,6 @@ gm20b_mmu = { ...@@ -32,7 +32,6 @@ gm20b_mmu = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
...@@ -48,7 +47,6 @@ gm20b_mmu_fixed = { ...@@ -48,7 +47,6 @@ gm20b_mmu_fixed = {
.pgt_bits = 27 - 12, .pgt_bits = 27 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 17, .lpg_shift = 17,
.create = gf100_vm_create,
.map_pgt = gf100_vm_map_pgt, .map_pgt = gf100_vm_map_pgt,
.map = gf100_vm_map, .map = gf100_vm_map,
.map_sg = gf100_vm_map_sg, .map_sg = gf100_vm_map_sg,
......
...@@ -200,16 +200,6 @@ nv50_vm_flush(struct nvkm_vm *vm) ...@@ -200,16 +200,6 @@ nv50_vm_flush(struct nvkm_vm *vm)
mutex_unlock(&subdev->mutex); mutex_unlock(&subdev->mutex);
} }
int
nv50_vm_create(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset,
struct lock_class_key *key, struct nvkm_vm **pvm)
{
u32 block = (1 << (mmu->func->pgt_bits + 12));
if (block > length)
block = length;
return nvkm_vm_create(mmu, offset, length, mm_offset, block, key, pvm);
}
static const struct nvkm_mmu_func static const struct nvkm_mmu_func
nv50_mmu = { nv50_mmu = {
.limit = (1ULL << 40), .limit = (1ULL << 40),
...@@ -217,7 +207,6 @@ nv50_mmu = { ...@@ -217,7 +207,6 @@ nv50_mmu = {
.pgt_bits = 29 - 12, .pgt_bits = 29 - 12,
.spg_shift = 12, .spg_shift = 12,
.lpg_shift = 16, .lpg_shift = 16,
.create = nv50_vm_create,
.map_pgt = nv50_vm_map_pgt, .map_pgt = nv50_vm_map_pgt,
.map = nv50_vm_map, .map = nv50_vm_map,
.map_sg = nv50_vm_map_sg, .map_sg = nv50_vm_map_sg,
......
...@@ -18,9 +18,6 @@ struct nvkm_mmu_func { ...@@ -18,9 +18,6 @@ struct nvkm_mmu_func {
u8 spg_shift; u8 spg_shift;
u8 lpg_shift; u8 lpg_shift;
int (*create)(struct nvkm_mmu *, u64 offset, u64 length, u64 mm_offset,
struct lock_class_key *, struct nvkm_vm **);
void (*map_pgt)(struct nvkm_gpuobj *pgd, u32 pde, void (*map_pgt)(struct nvkm_gpuobj *pgd, u32 pde,
struct nvkm_memory *pgt[2]); struct nvkm_memory *pgt[2]);
void (*map)(struct nvkm_vma *, struct nvkm_memory *, void (*map)(struct nvkm_vma *, struct nvkm_memory *,
...@@ -42,13 +39,8 @@ struct nvkm_mmu_func { ...@@ -42,13 +39,8 @@ struct nvkm_mmu_func {
} vmm; } vmm;
}; };
int nvkm_vm_create(struct nvkm_mmu *, u64, u64, u64, u32,
struct lock_class_key *, struct nvkm_vm **);
extern const struct nvkm_mmu_func nv04_mmu; extern const struct nvkm_mmu_func nv04_mmu;
int nv50_vm_create(struct nvkm_mmu *, u64, u64, u64, struct lock_class_key *,
struct nvkm_vm **);
void nv50_vm_map_pgt(struct nvkm_gpuobj *, u32, struct nvkm_memory **); void nv50_vm_map_pgt(struct nvkm_gpuobj *, u32, struct nvkm_memory **);
void nv50_vm_map(struct nvkm_vma *, struct nvkm_memory *, struct nvkm_mem *, void nv50_vm_map(struct nvkm_vma *, struct nvkm_memory *, struct nvkm_mem *,
u32, u32, u64, u64); u32, u32, u64, u64);
...@@ -57,8 +49,6 @@ void nv50_vm_map_sg(struct nvkm_vma *, struct nvkm_memory *, struct nvkm_mem *, ...@@ -57,8 +49,6 @@ void nv50_vm_map_sg(struct nvkm_vma *, struct nvkm_memory *, struct nvkm_mem *,
void nv50_vm_unmap(struct nvkm_vma *, struct nvkm_memory *, u32, u32); void nv50_vm_unmap(struct nvkm_vma *, struct nvkm_memory *, u32, u32);
void nv50_vm_flush(struct nvkm_vm *); void nv50_vm_flush(struct nvkm_vm *);
int gf100_vm_create(struct nvkm_mmu *, u64, u64, u64, struct lock_class_key *,
struct nvkm_vm **);
void gf100_vm_map_pgt(struct nvkm_gpuobj *, u32, struct nvkm_memory **); void gf100_vm_map_pgt(struct nvkm_gpuobj *, u32, struct nvkm_memory **);
void gf100_vm_map(struct nvkm_vma *, struct nvkm_memory *, struct nvkm_mem *, void gf100_vm_map(struct nvkm_vma *, struct nvkm_memory *, struct nvkm_mem *,
u32, u32, u64, u64); u32, u32, u64, u64);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment