diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 15fd32d3..7876af63 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -105,6 +105,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
105 | static int __must_check gk20a_init_system_vm(struct mm_gk20a *mm); | 105 | static int __must_check gk20a_init_system_vm(struct mm_gk20a *mm); |
106 | static int __must_check gk20a_init_bar1_vm(struct mm_gk20a *mm); | 106 | static int __must_check gk20a_init_bar1_vm(struct mm_gk20a *mm); |
107 | static int __must_check gk20a_init_hwpm(struct mm_gk20a *mm); | 107 | static int __must_check gk20a_init_hwpm(struct mm_gk20a *mm); |
108 | static int __must_check gk20a_init_cde_vm(struct mm_gk20a *mm); | ||
108 | 109 | ||
109 | 110 | ||
110 | struct gk20a_dmabuf_priv { | 111 | struct gk20a_dmabuf_priv { |
@@ -344,6 +345,7 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) | |||
344 | gk20a_remove_vm(&mm->bar1.vm, &mm->bar1.inst_block); | 345 | gk20a_remove_vm(&mm->bar1.vm, &mm->bar1.inst_block); |
345 | gk20a_remove_vm(&mm->pmu.vm, &mm->pmu.inst_block); | 346 | gk20a_remove_vm(&mm->pmu.vm, &mm->pmu.inst_block); |
346 | gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block); | 347 | gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block); |
348 | gk20a_vm_remove_support_nofree(&mm->cde.vm); | ||
347 | } | 349 | } |
348 | 350 | ||
349 | int gk20a_init_mm_setup_sw(struct gk20a *g) | 351 | int gk20a_init_mm_setup_sw(struct gk20a *g) |
@@ -386,6 +388,10 @@ int gk20a_init_mm_setup_sw(struct gk20a *g) | |||
386 | if (err) | 388 | if (err) |
387 | return err; | 389 | return err; |
388 | 390 | ||
391 | err = gk20a_init_cde_vm(mm); | ||
392 | if (err) | ||
393 | return err; | ||
394 | |||
389 | /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */ | 395 | /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */ |
390 | g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share; | 396 | g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share; |
391 | mm->remove_support = gk20a_remove_mm_support; | 397 | mm->remove_support = gk20a_remove_mm_support; |
@@ -3268,6 +3274,19 @@ static int gk20a_init_hwpm(struct mm_gk20a *mm) | |||
3268 | return 0; | 3274 | return 0; |
3269 | } | 3275 | } |
3270 | 3276 | ||
3277 | static int gk20a_init_cde_vm(struct mm_gk20a *mm) | ||
3278 | { | ||
3279 | struct vm_gk20a *vm = &mm->cde.vm; | ||
3280 | struct gk20a *g = gk20a_from_mm(mm); | ||
3281 | u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; | ||
3282 | |||
3283 | return gk20a_init_vm(mm, vm, big_page_size, | ||
3284 | SZ_4K * 16, | ||
3285 | NV_MM_DEFAULT_KERNEL_SIZE, | ||
3286 | NV_MM_DEFAULT_KERNEL_SIZE + NV_MM_DEFAULT_USER_SIZE, | ||
3287 | false, "cde"); | ||
3288 | } | ||
3289 | |||
3271 | void gk20a_mm_init_pdb(struct gk20a *g, void *inst_ptr, u64 pdb_addr) | 3290 | void gk20a_mm_init_pdb(struct gk20a *g, void *inst_ptr, u64 pdb_addr) |
3272 | { | 3291 | { |
3273 | u32 pdb_addr_lo = u64_lo32(pdb_addr >> ram_in_base_shift_v()); | 3292 | u32 pdb_addr_lo = u64_lo32(pdb_addr >> ram_in_base_shift_v()); |