From b9b94c073ce551935be1c00cb8e756ad5ce5c631 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 31 Oct 2016 14:40:19 -0700 Subject: gpu: nvgpu: Remove separate fixed address VMA Remove the special VMA that could be used for allocating fixed addresses. This feature was never used and is not worth maintaining. Bug 1396644 Bug 1729947 Change-Id: I06f92caa01623535516935acc03ce38dbdb0e318 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1265302 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/as_gk20a.c | 4 +--- drivers/gpu/nvgpu/gk20a/gk20a.h | 8 -------- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 42 +++----------------------------------- drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 3 --- drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 2 -- 5 files changed, 4 insertions(+), 55 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c index adf0297b..c8b3b02f 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c @@ -279,9 +279,7 @@ static int gk20a_as_ioctl_get_va_regions( for (i = 0; i < write_entries; ++i) { struct nvgpu_as_va_region region; - struct nvgpu_allocator *vma = - nvgpu_alloc_initialized(&vm->fixed) ? - &vm->fixed : vm->vma[i]; + struct nvgpu_allocator *vma = vm->vma[i]; memset(®ion, 0, sizeof(struct nvgpu_as_va_region)); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index f7ceaced..2f6e83a4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -932,14 +932,6 @@ struct gk20a { struct nvgpu_dbg_gpu_reg_op *dbg_regops_tmp_buf; u32 dbg_regops_tmp_buf_ops; - /* - * When set subsequent VMAs will separate fixed and non-fixed - * allocations. This avoids conflicts with fixed and non-fixed allocs - * for some tests. The value in separate_fixed_allocs is used to - * determine the split boundary. - */ - u64 separate_fixed_allocs; - void (*remove_support)(struct device *); u64 pg_ingating_time_us; diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index bf73e79f..b04a7e87 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -4437,31 +4437,6 @@ int gk20a_init_vm(struct mm_gk20a *mm, goto clean_up_page_tables; } - /* - * Attempt to make a separate VM for fixed allocations. - */ - if (g->separate_fixed_allocs && - user_vma_start < user_vma_limit) { - if (g->separate_fixed_allocs >= user_vma_limit) - goto clean_up_page_tables; - - snprintf(alloc_name, sizeof(alloc_name), - "gk20a_%s-fixed", name); - - err = __nvgpu_buddy_allocator_init(g, &vm->fixed, - vm, alloc_name, - user_vma_start, - g->separate_fixed_allocs, - SZ_4K, - GPU_BALLOC_MAX_ORDER, - GPU_ALLOC_GVA_SPACE); - if (err) - goto clean_up_page_tables; - - /* Make sure to update the user vma size. */ - user_vma_start = g->separate_fixed_allocs; - } - if (user_vma_start < user_vma_limit) { snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s", name); if (!gk20a_big_pages_possible(vm, user_vma_start, @@ -4631,18 +4606,15 @@ int gk20a_vm_alloc_space(struct gk20a_as_share *as_share, } vma = vm->vma[pgsz_idx]; - if (args->flags & NVGPU_AS_ALLOC_SPACE_FLAGS_FIXED_OFFSET) { - if (nvgpu_alloc_initialized(&vm->fixed)) - vma = &vm->fixed; + if (args->flags & NVGPU_AS_ALLOC_SPACE_FLAGS_FIXED_OFFSET) vaddr_start = nvgpu_alloc_fixed(vma, args->o_a.offset, (u64)args->pages * (u64)args->page_size, args->page_size); - } else { + else vaddr_start = nvgpu_alloc(vma, (u64)args->pages * (u64)args->page_size); - } if (!vaddr_start) { kfree(va_node); @@ -4710,10 +4682,7 @@ int gk20a_vm_free_space(struct gk20a_as_share *as_share, pgsz_idx = __get_pte_size(vm, args->offset, args->page_size * args->pages); - if (nvgpu_alloc_initialized(&vm->fixed)) - vma = &vm->fixed; - else - vma = vm->vma[pgsz_idx]; + vma = vm->vma[pgsz_idx]; nvgpu_free(vma, args->offset); mutex_lock(&vm->update_gmmu_lock); @@ -4902,8 +4871,6 @@ void gk20a_deinit_vm(struct vm_gk20a *vm) nvgpu_alloc_destroy(&vm->kernel); if (nvgpu_alloc_initialized(&vm->user)) nvgpu_alloc_destroy(&vm->user); - if (nvgpu_alloc_initialized(&vm->fixed)) - nvgpu_alloc_destroy(&vm->fixed); gk20a_vm_free_entries(vm, &vm->pdb, 0); } @@ -5467,9 +5434,6 @@ void gk20a_mm_debugfs_init(struct device *dev) struct dentry *gpu_root = platform->debugfs; struct gk20a *g = gk20a_get_platform(dev)->g; - debugfs_create_x64("separate_fixed_allocs", 0664, gpu_root, - &g->separate_fixed_allocs); - debugfs_create_bool("force_pramin", 0664, gpu_root, &g->mm.force_pramin); } diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 394d1d25..f362e27c 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -270,9 +270,6 @@ struct vm_gk20a { struct gk20a_mm_entry pdb; - /* If necessary, split fixed from non-fixed. */ - struct nvgpu_allocator fixed; - struct nvgpu_allocator *vma[gmmu_nr_page_sizes]; struct nvgpu_allocator kernel; struct nvgpu_allocator user; diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index a21a020d..76631b96 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c @@ -231,8 +231,6 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm) nvgpu_alloc_destroy(&vm->kernel); if (nvgpu_alloc_initialized(&vm->user)) nvgpu_alloc_destroy(&vm->user); - if (nvgpu_alloc_initialized(&vm->fixed)) - nvgpu_alloc_destroy(&vm->fixed); mutex_unlock(&vm->update_gmmu_lock); -- cgit v1.2.2