From f3a920cb01d1517db5432c8062b660d6b60eb4de Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 14 Jan 2015 08:54:26 -0800 Subject: gpu: nvgpu: Refactor page mapping code Pass always the directory structure to mm functions instead of pointers to members to it. Also split update_gmmu_ptes_locked() into smaller functions, and turn the hard coded MMU levels (PDE, PTE) into run-time parameters. Change-Id: I315ef7aebbea1e61156705361f2e2a63b5fb7bf1 Signed-off-by: Deepak Nibade Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/672485 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu') diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index 57814f1b..9b7c7dbd 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c @@ -40,8 +40,8 @@ static int vgpu_init_mm_setup_sw(struct gk20a *g) /* gk20a_init_gpu_characteristics expects this to be populated */ vm->big_page_size = big_page_size; - vm->pde_stride = vm->big_page_size << 10; - vm->pde_stride_shift = ilog2(vm->pde_stride); + vm->mmu_levels = (vm->big_page_size == SZ_64K) ? + gk20a_mm_levels_64k : gk20a_mm_levels_128k; mm->sw_ready = true; @@ -65,7 +65,8 @@ static u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm, u32 ctag_offset, u32 flags, int rw_flag, - bool clear_ctags) + bool clear_ctags, + bool sparse) { int err = 0; struct device *d = dev_from_vm(vm); @@ -128,7 +129,8 @@ static void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm, u64 size, int pgsz_idx, bool va_allocated, - int rw_flag) + int rw_flag, + bool sparse) { struct gk20a *g = gk20a_from_vm(vm); struct gk20a_platform *platform = gk20a_get_platform(g->dev); -- cgit v1.2.2