summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-08-11 17:40:58 -0400
committerShu Zhong <shuz@nvidia.com>2017-08-11 17:57:08 -0400
commita4e095aa37ec5a6c09a8cc6477da9fa49a73cd77 (patch)
treefc8cffa187e14649b474a73ff23e3bb801319e61 /drivers/gpu/nvgpu/gv11b/mm_gv11b.c
parent96615351ad11a186f5869e56acb3c1948ab7b7cc (diff)
Revert "gpu: nvgpu: gv11b: Reorg mm HAL init"
This reverts commit 96615351ad11a186f5869e56acb3c1948ab7b7cc, which conflicts with gv100 changes. Change-Id: I08797bb23dd9226f0228ce3235fce6feef8d82f3 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1537667 Reviewed-by: Shu Zhong <shuz@nvidia.com> Tested-by: Shu Zhong <shuz@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/mm_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/mm_gv11b.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
index 941a0bbe..7ba8f74f 100644
--- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
@@ -34,12 +34,12 @@
34 34
35#define NVGPU_L3_ALLOC_BIT BIT(36) 35#define NVGPU_L3_ALLOC_BIT BIT(36)
36 36
37bool gv11b_mm_is_bar1_supported(struct gk20a *g) 37static bool gv11b_mm_is_bar1_supported(struct gk20a *g)
38{ 38{
39 return false; 39 return false;
40} 40}
41 41
42void gv11b_init_inst_block(struct nvgpu_mem *inst_block, 42static void gv11b_init_inst_block(struct nvgpu_mem *inst_block,
43 struct vm_gk20a *vm, u32 big_page_size) 43 struct vm_gk20a *vm, u32 big_page_size)
44{ 44{
45 struct gk20a *g = gk20a_from_vm(vm); 45 struct gk20a *g = gk20a_from_vm(vm);
@@ -53,12 +53,12 @@ void gv11b_init_inst_block(struct nvgpu_mem *inst_block,
53 g->ops.mm.set_big_page_size(g, inst_block, big_page_size); 53 g->ops.mm.set_big_page_size(g, inst_block, big_page_size);
54} 54}
55 55
56bool gv11b_mm_mmu_fault_pending(struct gk20a *g) 56static bool gv11b_mm_mmu_fault_pending(struct gk20a *g)
57{ 57{
58 return gv11b_fb_mmu_fault_pending(g); 58 return gv11b_fb_mmu_fault_pending(g);
59} 59}
60 60
61void gv11b_mm_fault_info_mem_destroy(struct gk20a *g) 61static void gv11b_mm_fault_info_mem_destroy(struct gk20a *g)
62{ 62{
63 nvgpu_log_fn(g, " "); 63 nvgpu_log_fn(g, " ");
64 64
@@ -174,7 +174,7 @@ static void gv11b_mm_mmu_hw_fault_buf_deinit(struct gk20a *g)
174 } 174 }
175} 175}
176 176
177void gv11b_mm_remove_bar2_vm(struct gk20a *g) 177static void gv11b_mm_remove_bar2_vm(struct gk20a *g)
178{ 178{
179 struct mm_gk20a *mm = &g->mm; 179 struct mm_gk20a *mm = &g->mm;
180 180
@@ -221,7 +221,7 @@ static int gv11b_mm_mmu_fault_setup_sw(struct gk20a *g)
221 return err; 221 return err;
222} 222}
223 223
224int gv11b_init_mm_setup_hw(struct gk20a *g) 224static int gv11b_init_mm_setup_hw(struct gk20a *g)
225{ 225{
226 int err = 0; 226 int err = 0;
227 227
@@ -260,7 +260,7 @@ void gv11b_mm_l2_flush(struct gk20a *g, bool invalidate)
260 * checking bit 36 of the phsyical address. So if a mapping should allocte lines 260 * checking bit 36 of the phsyical address. So if a mapping should allocte lines
261 * in the L3 this bit must be set. 261 * in the L3 this bit must be set.
262 */ 262 */
263u64 gv11b_gpu_phys_addr(struct gk20a *g, 263static u64 gv11b_gpu_phys_addr(struct gk20a *g,
264 struct nvgpu_gmmu_attrs *attrs, u64 phys) 264 struct nvgpu_gmmu_attrs *attrs, u64 phys)
265{ 265{
266 if (attrs && attrs->t19x_attrs.l3_alloc) 266 if (attrs && attrs->t19x_attrs.l3_alloc)
@@ -269,7 +269,7 @@ u64 gv11b_gpu_phys_addr(struct gk20a *g,
269 return phys; 269 return phys;
270} 270}
271 271
272int gv11b_init_bar2_mm_hw_setup(struct gk20a *g) 272static int gv11b_init_bar2_mm_hw_setup(struct gk20a *g)
273{ 273{
274 struct mm_gk20a *mm = &g->mm; 274 struct mm_gk20a *mm = &g->mm;
275 struct nvgpu_mem *inst_block = &mm->bar2.inst_block; 275 struct nvgpu_mem *inst_block = &mm->bar2.inst_block;
@@ -318,3 +318,19 @@ int gv11b_init_bar2_mm_hw_setup(struct gk20a *g)
318 nvgpu_err(g, "bar2 bind failed. gpu unable to access memory"); 318 nvgpu_err(g, "bar2 bind failed. gpu unable to access memory");
319 return -EBUSY; 319 return -EBUSY;
320} 320}
321
322void gv11b_init_mm(struct gpu_ops *gops)
323{
324 gp10b_init_mm(gops);
325 gops->mm.gpu_phys_addr = gv11b_gpu_phys_addr;
326 gops->mm.is_bar1_supported = gv11b_mm_is_bar1_supported;
327 gops->mm.init_inst_block = gv11b_init_inst_block;
328 gops->mm.mmu_fault_pending = gv11b_mm_mmu_fault_pending;
329 gops->mm.l2_flush = gv11b_mm_l2_flush;
330 gops->mm.gpu_phys_addr = gv11b_gpu_phys_addr;
331 gops->mm.init_mm_setup_hw = gv11b_init_mm_setup_hw;
332 gops->mm.fault_info_mem_destroy =
333 gv11b_mm_fault_info_mem_destroy;
334 gops->mm.remove_bar2_vm = gv11b_mm_remove_bar2_vm;
335 gops->mm.init_bar2_mm_hw_setup = gv11b_init_bar2_mm_hw_setup;
336}