summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-10-21 05:05:51 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:47 -0400
commitf2c905e48224fc0393199e121b797c7b35432c69 (patch)
tree2c5abeb6a3f180d233707f9b284911356c769c3d /drivers/gpu/nvgpu/vgpu/mm_vgpu.c
parent1c47b239c1e41be94b4881c5f19b9d76f3a63a17 (diff)
gpu: nvgpu: vgpu: Fix vgpu mm code build break
Some fields were moved to vm specific fields from global mm fields. Fix vgpu's mm code to follow that. Zero page is never allocated in vgpu, so don't free it. Change-Id: Ieabb33f1f004c9ffeeceabf61029b5bafc391889 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/559818 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.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index ed5e1548..c1624ec8 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -33,11 +33,6 @@ static int vgpu_init_mm_setup_sw(struct gk20a *g)
33 } 33 }
34 34
35 mm->g = g; 35 mm->g = g;
36 mm->big_page_size = gmmu_page_sizes[gmmu_page_size_big];
37 mm->compression_page_size = gmmu_page_sizes[gmmu_page_size_big];
38 mm->pde_stride = mm->big_page_size << 10;
39 mm->pde_stride_shift = ilog2(mm->pde_stride);
40 BUG_ON(mm->pde_stride_shift > 31); /* we have assumptions about this */
41 36
42 /*TBD: make channel vm size configurable */ 37 /*TBD: make channel vm size configurable */
43 mm->channel.size = 1ULL << NV_GMMU_VA_RANGE; 38 mm->channel.size = 1ULL << NV_GMMU_VA_RANGE;
@@ -202,11 +197,6 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
202 197
203 mutex_unlock(&vm->update_gmmu_lock); 198 mutex_unlock(&vm->update_gmmu_lock);
204 199
205 /* release zero page if used */
206 if (vm->zero_page_cpuva)
207 dma_free_coherent(&g->dev->dev, vm->mm->big_page_size,
208 vm->zero_page_cpuva, vm->zero_page_iova);
209
210 /* vm is not used anymore. release it. */ 200 /* vm is not used anymore. release it. */
211 kfree(vm); 201 kfree(vm);
212} 202}
@@ -236,7 +226,8 @@ u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size)
236} 226}
237 227
238/* address space interfaces for the gk20a module */ 228/* address space interfaces for the gk20a module */
239static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share) 229static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
230 u32 big_page_size)
240{ 231{
241 struct gk20a_as *as = as_share->as; 232 struct gk20a_as *as = as_share->as;
242 struct gk20a *g = gk20a_from_as(as); 233 struct gk20a *g = gk20a_from_as(as);
@@ -263,7 +254,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share)
263 254
264 vm->big_pages = true; 255 vm->big_pages = true;
265 256
266 vm->va_start = mm->pde_stride; /* create a one pde hole */ 257 vm->va_start = big_page_size << 10; /* create a one pde hole */
267 vm->va_limit = mm->channel.size; /* note this means channel.size is 258 vm->va_limit = mm->channel.size; /* note this means channel.size is
268 really just the max */ 259 really just the max */
269 260