From 01f359f3f1bbf95d7ac4453a6c1de811bf0aee11 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Fri, 15 May 2015 09:13:28 -0700 Subject: Revert "Revert "gpu: nvgpu: New allocator for VA space"" This reverts commit 7eb42bc239dbd207208ff491c3fb65c3d83274d8. The original commit was actually fine. Change-Id: I564ce6530ac73fcfad17dcec9c53f0353b4f02d4 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/743300 (cherry picked from commit e99aa2485f8992eabe3556f3ebcb57bdc8ad91ff) Reviewed-on: http://git-master/r/743301 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index 94e4602f..855aac0d 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c @@ -243,11 +243,9 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, struct tegra_vgpu_as_share_params *p = &msg.params.as_share; struct mm_gk20a *mm = &g->mm; struct vm_gk20a *vm; - u32 num_small_pages, num_large_pages, low_hole_pages; u64 small_vma_size, large_vma_size; char name[32]; int err, i; - u32 start; /* note: keep the page sizes sorted lowest to highest here */ u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { @@ -294,33 +292,27 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, small_vma_size = (u64)16 << 30; large_vma_size = vm->va_limit - small_vma_size; - num_small_pages = (u32)(small_vma_size >> - ilog2(vm->gmmu_page_sizes[gmmu_page_size_small])); - - /* num_pages above is without regard to the low-side hole. */ - low_hole_pages = (vm->va_start >> - ilog2(vm->gmmu_page_sizes[gmmu_page_size_small])); - snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, gmmu_page_sizes[gmmu_page_size_small]>>10); - err = gk20a_allocator_init(&vm->vma[gmmu_page_size_small], - name, - low_hole_pages, /*start*/ - num_small_pages - low_hole_pages);/* length*/ + err = __gk20a_allocator_init(&vm->vma[gmmu_page_size_small], + vm, name, + vm->va_start, + small_vma_size - vm->va_start, + SZ_4K, + GPU_BALLOC_MAX_ORDER, + GPU_BALLOC_GVA_SPACE); if (err) goto clean_up_share; - start = (u32)(small_vma_size >> - ilog2(vm->gmmu_page_sizes[gmmu_page_size_big])); - num_large_pages = (u32)(large_vma_size >> - ilog2(vm->gmmu_page_sizes[gmmu_page_size_big])); - snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, gmmu_page_sizes[gmmu_page_size_big]>>10); - err = gk20a_allocator_init(&vm->vma[gmmu_page_size_big], - name, - start, /* start */ - num_large_pages); /* length */ + err = __gk20a_allocator_init(&vm->vma[gmmu_page_size_big], + vm, name, + small_vma_size, + large_vma_size, + big_page_size, + GPU_BALLOC_MAX_ORDER, + GPU_BALLOC_GVA_SPACE); if (err) goto clean_up_small_allocator; -- cgit v1.2.2