diff options
author | Seshendra Gadagottu <sgadagottu@nvidia.com> | 2014-12-03 20:57:35 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 21:04:38 -0400 |
commit | f4883ab97af69610c0507c245f69eef00d203a28 (patch) | |
tree | c8555fbd7f474db20c44719eeab679ee7f5b1751 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |
parent | 2dda8077ec7d88ac689b57448031a3bac269fdfa (diff) |
gpu:nvgpu: add bar2 aperture support
Bug 1587825
Change-Id: I884c6b268aabb04b4990713395ebedf92410e02a
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/659239
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 8cd8e18c..3bce3c74 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -311,6 +311,11 @@ int gk20a_init_mm_setup_sw(struct gk20a *g) | |||
311 | if (err) | 311 | if (err) |
312 | return err; | 312 | return err; |
313 | 313 | ||
314 | if (g->ops.mm.init_bar2_vm) { | ||
315 | err = g->ops.mm.init_bar2_vm(g); | ||
316 | if (err) | ||
317 | return err; | ||
318 | } | ||
314 | err = gk20a_init_system_vm(mm); | 319 | err = gk20a_init_system_vm(mm); |
315 | if (err) | 320 | if (err) |
316 | return err; | 321 | return err; |
@@ -330,6 +335,7 @@ static int gk20a_init_mm_setup_hw(struct gk20a *g) | |||
330 | struct mm_gk20a *mm = &g->mm; | 335 | struct mm_gk20a *mm = &g->mm; |
331 | struct inst_desc *inst_block = &mm->bar1.inst_block; | 336 | struct inst_desc *inst_block = &mm->bar1.inst_block; |
332 | phys_addr_t inst_pa = inst_block->cpu_pa; | 337 | phys_addr_t inst_pa = inst_block->cpu_pa; |
338 | int err; | ||
333 | 339 | ||
334 | gk20a_dbg_fn(""); | 340 | gk20a_dbg_fn(""); |
335 | 341 | ||
@@ -342,6 +348,13 @@ static int gk20a_init_mm_setup_hw(struct gk20a *g) | |||
342 | bus_bar1_block_target_vid_mem_f() | | 348 | bus_bar1_block_target_vid_mem_f() | |
343 | bus_bar1_block_mode_virtual_f() | | 349 | bus_bar1_block_mode_virtual_f() | |
344 | bus_bar1_block_ptr_f(inst_pa)); | 350 | bus_bar1_block_ptr_f(inst_pa)); |
351 | |||
352 | if (g->ops.mm.init_bar2_mm_hw_setup) { | ||
353 | err = g->ops.mm.init_bar2_mm_hw_setup(g); | ||
354 | if (err) | ||
355 | return err; | ||
356 | } | ||
357 | |||
345 | if (gk20a_mm_fb_flush(g) || gk20a_mm_fb_flush(g)) | 358 | if (gk20a_mm_fb_flush(g) || gk20a_mm_fb_flush(g)) |
346 | return -EBUSY; | 359 | return -EBUSY; |
347 | 360 | ||
@@ -2124,7 +2137,7 @@ void gk20a_vm_put(struct vm_gk20a *vm) | |||
2124 | kref_put(&vm->ref, gk20a_vm_remove_support_kref); | 2137 | kref_put(&vm->ref, gk20a_vm_remove_support_kref); |
2125 | } | 2138 | } |
2126 | 2139 | ||
2127 | static int gk20a_init_vm(struct mm_gk20a *mm, | 2140 | int gk20a_init_vm(struct mm_gk20a *mm, |
2128 | struct vm_gk20a *vm, | 2141 | struct vm_gk20a *vm, |
2129 | u32 big_page_size, | 2142 | u32 big_page_size, |
2130 | u64 low_hole, | 2143 | u64 low_hole, |
@@ -2659,7 +2672,7 @@ int gk20a_vm_unmap_buffer(struct gk20a_as_share *as_share, u64 offset) | |||
2659 | return 0; | 2672 | return 0; |
2660 | } | 2673 | } |
2661 | 2674 | ||
2662 | static void gk20a_deinit_vm(struct vm_gk20a *vm) | 2675 | void gk20a_deinit_vm(struct vm_gk20a *vm) |
2663 | { | 2676 | { |
2664 | u32 pde_pages; | 2677 | u32 pde_pages; |
2665 | 2678 | ||