summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index ec020d5f..87e6f30c 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -702,8 +702,6 @@ int gk20a_init_mm_setup_sw(struct gk20a *g)
702 if (err) 702 if (err)
703 return err; 703 return err;
704 704
705 /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */
706 g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share;
707 mm->remove_support = gk20a_remove_mm_support; 705 mm->remove_support = gk20a_remove_mm_support;
708 mm->remove_ce_support = gk20a_remove_mm_ce_support; 706 mm->remove_ce_support = gk20a_remove_mm_ce_support;
709 707
@@ -2451,65 +2449,6 @@ enum gmmu_pgsz_gk20a __get_pte_size(struct vm_gk20a *vm, u64 base, u64 size)
2451 return gmmu_page_size_small; 2449 return gmmu_page_size_small;
2452} 2450}
2453 2451
2454/* address space interfaces for the gk20a module */
2455int gk20a_vm_alloc_share(struct gk20a_as_share *as_share, u32 big_page_size,
2456 u32 flags)
2457{
2458 struct gk20a_as *as = as_share->as;
2459 struct gk20a *g = gk20a_from_as(as);
2460 struct mm_gk20a *mm = &g->mm;
2461 struct vm_gk20a *vm;
2462 char name[32];
2463 int err;
2464 const bool userspace_managed =
2465 (flags & NVGPU_GPU_IOCTL_ALLOC_AS_FLAGS_USERSPACE_MANAGED) != 0;
2466
2467 gk20a_dbg_fn("");
2468
2469 if (big_page_size == 0) {
2470 big_page_size =
2471 gk20a_get_platform(g->dev)->default_big_page_size;
2472 } else {
2473 if (!is_power_of_2(big_page_size))
2474 return -EINVAL;
2475
2476 if (!(big_page_size & g->gpu_characteristics.available_big_page_sizes))
2477 return -EINVAL;
2478 }
2479
2480 vm = nvgpu_kzalloc(g, sizeof(*vm));
2481 if (!vm)
2482 return -ENOMEM;
2483
2484 as_share->vm = vm;
2485 vm->as_share = as_share;
2486 vm->enable_ctag = true;
2487
2488 snprintf(name, sizeof(name), "as_%d", as_share->id);
2489
2490 err = nvgpu_init_vm(mm, vm, big_page_size,
2491 big_page_size << 10,
2492 mm->channel.kernel_size,
2493 mm->channel.user_size + mm->channel.kernel_size,
2494 !mm->disable_bigpage, userspace_managed, name);
2495
2496 return err;
2497}
2498
2499int gk20a_vm_release_share(struct gk20a_as_share *as_share)
2500{
2501 struct vm_gk20a *vm = as_share->vm;
2502
2503 gk20a_dbg_fn("");
2504
2505 vm->as_share = NULL;
2506 as_share->vm = NULL;
2507
2508 nvgpu_vm_put(vm);
2509
2510 return 0;
2511}
2512
2513int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch) 2452int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch)
2514{ 2453{
2515 int err = 0; 2454 int err = 0;
@@ -3130,7 +3069,6 @@ void gk20a_init_mm(struct gpu_ops *gops)
3130{ 3069{
3131 gops->mm.gmmu_map = gk20a_locked_gmmu_map; 3070 gops->mm.gmmu_map = gk20a_locked_gmmu_map;
3132 gops->mm.gmmu_unmap = gk20a_locked_gmmu_unmap; 3071 gops->mm.gmmu_unmap = gk20a_locked_gmmu_unmap;
3133 gops->mm.vm_alloc_share = gk20a_vm_alloc_share;
3134 gops->mm.vm_bind_channel = gk20a_vm_bind_channel; 3072 gops->mm.vm_bind_channel = gk20a_vm_bind_channel;
3135 gops->mm.fb_flush = gk20a_mm_fb_flush; 3073 gops->mm.fb_flush = gk20a_mm_fb_flush;
3136 gops->mm.l2_invalidate = gk20a_mm_l2_invalidate; 3074 gops->mm.l2_invalidate = gk20a_mm_l2_invalidate;