summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-01-14 11:54:26 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:08:16 -0400
commitf3a920cb01d1517db5432c8062b660d6b60eb4de (patch)
treebc366a7df51745ea2d6b740395403cf2add2ebef /drivers/gpu/nvgpu/vgpu/mm_vgpu.c
parent8d1ab756ed8a7f4d3138dc5da9d2de9f52915261 (diff)
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 <dnibade@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/672485 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c10
1 files changed, 6 insertions, 4 deletions
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)
40 40
41 /* gk20a_init_gpu_characteristics expects this to be populated */ 41 /* gk20a_init_gpu_characteristics expects this to be populated */
42 vm->big_page_size = big_page_size; 42 vm->big_page_size = big_page_size;
43 vm->pde_stride = vm->big_page_size << 10; 43 vm->mmu_levels = (vm->big_page_size == SZ_64K) ?
44 vm->pde_stride_shift = ilog2(vm->pde_stride); 44 gk20a_mm_levels_64k : gk20a_mm_levels_128k;
45 45
46 mm->sw_ready = true; 46 mm->sw_ready = true;
47 47
@@ -65,7 +65,8 @@ static u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm,
65 u32 ctag_offset, 65 u32 ctag_offset,
66 u32 flags, 66 u32 flags,
67 int rw_flag, 67 int rw_flag,
68 bool clear_ctags) 68 bool clear_ctags,
69 bool sparse)
69{ 70{
70 int err = 0; 71 int err = 0;
71 struct device *d = dev_from_vm(vm); 72 struct device *d = dev_from_vm(vm);
@@ -128,7 +129,8 @@ static void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
128 u64 size, 129 u64 size,
129 int pgsz_idx, 130 int pgsz_idx,
130 bool va_allocated, 131 bool va_allocated,
131 int rw_flag) 132 int rw_flag,
133 bool sparse)
132{ 134{
133 struct gk20a *g = gk20a_from_vm(vm); 135 struct gk20a *g = gk20a_from_vm(vm);
134 struct gk20a_platform *platform = gk20a_get_platform(g->dev); 136 struct gk20a_platform *platform = gk20a_get_platform(g->dev);