diff options
author | Sunny He <suhe@nvidia.com> | 2017-07-26 17:23:01 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-14 18:55:25 -0400 |
commit | 8ab6445df5b24c200ac4e346684119a85008e0e3 (patch) | |
tree | 557c0e126488532942c784bdfcdfe1e9bc6d2688 /drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |
parent | 4bb0896912440d126ae47da350b448f37dabc63d (diff) |
gpu: nvgpu: Reorg mm HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
mm sub-module of the gpu_ops struct.
Perform HAL function assignments in hal_gxxxx.c through the
population of a chip-specific copy of gpu_ops.
Jira NVGPU-74
Change-Id: I5fd295c6473d5b4a6178c0c6be8fcf8f4c33f2e3
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537754
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/hal_gv11b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 14b7a541..f572084d 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "gk20a/fecs_trace_gk20a.h" | 25 | #include "gk20a/fecs_trace_gk20a.h" |
26 | #include "gk20a/css_gr_gk20a.h" | 26 | #include "gk20a/css_gr_gk20a.h" |
27 | #include "gk20a/mc_gk20a.h" | 27 | #include "gk20a/mc_gk20a.h" |
28 | #include "gk20a/mm_gk20a.h" | ||
28 | #include "gk20a/dbg_gpu_gk20a.h" | 29 | #include "gk20a/dbg_gpu_gk20a.h" |
29 | #include "gk20a/bus_gk20a.h" | 30 | #include "gk20a/bus_gk20a.h" |
30 | #include "gk20a/flcn_gk20a.h" | 31 | #include "gk20a/flcn_gk20a.h" |
@@ -35,6 +36,7 @@ | |||
35 | #include "gm20b/gr_gm20b.h" | 36 | #include "gm20b/gr_gm20b.h" |
36 | #include "gm20b/fb_gm20b.h" | 37 | #include "gm20b/fb_gm20b.h" |
37 | #include "gm20b/fifo_gm20b.h" | 38 | #include "gm20b/fifo_gm20b.h" |
39 | #include "gm20b/mm_gm20b.h" | ||
38 | 40 | ||
39 | #include "gp10b/ltc_gp10b.h" | 41 | #include "gp10b/ltc_gp10b.h" |
40 | #include "gp10b/therm_gp10b.h" | 42 | #include "gp10b/therm_gp10b.h" |
@@ -44,6 +46,7 @@ | |||
44 | #include "gp10b/fifo_gp10b.h" | 46 | #include "gp10b/fifo_gp10b.h" |
45 | #include "gp10b/fecs_trace_gp10b.h" | 47 | #include "gp10b/fecs_trace_gp10b.h" |
46 | #include "gp10b/fb_gp10b.h" | 48 | #include "gp10b/fb_gp10b.h" |
49 | #include "gp10b/mm_gp10b.h" | ||
47 | 50 | ||
48 | #include "hal_gv11b.h" | 51 | #include "hal_gv11b.h" |
49 | #include "gr_gv11b.h" | 52 | #include "gr_gv11b.h" |
@@ -336,6 +339,31 @@ static const struct gpu_ops gv11b_ops = { | |||
336 | .max_entries = gk20a_gr_max_entries, | 339 | .max_entries = gk20a_gr_max_entries, |
337 | }, | 340 | }, |
338 | #endif /* CONFIG_GK20A_CTXSW_TRACE */ | 341 | #endif /* CONFIG_GK20A_CTXSW_TRACE */ |
342 | .mm = { | ||
343 | .support_sparse = gm20b_mm_support_sparse, | ||
344 | .gmmu_map = gk20a_locked_gmmu_map, | ||
345 | .gmmu_unmap = gk20a_locked_gmmu_unmap, | ||
346 | .vm_bind_channel = gk20a_vm_bind_channel, | ||
347 | .fb_flush = gk20a_mm_fb_flush, | ||
348 | .l2_invalidate = gk20a_mm_l2_invalidate, | ||
349 | .l2_flush = gv11b_mm_l2_flush, | ||
350 | .cbc_clean = gk20a_mm_cbc_clean, | ||
351 | .set_big_page_size = gm20b_mm_set_big_page_size, | ||
352 | .get_big_page_sizes = gm20b_mm_get_big_page_sizes, | ||
353 | .get_default_big_page_size = gp10b_mm_get_default_big_page_size, | ||
354 | .gpu_phys_addr = gv11b_gpu_phys_addr, | ||
355 | .get_physical_addr_bits = gp10b_mm_get_physical_addr_bits, | ||
356 | .get_mmu_levels = gp10b_mm_get_mmu_levels, | ||
357 | .init_pdb = gp10b_mm_init_pdb, | ||
358 | .init_mm_setup_hw = gv11b_init_mm_setup_hw, | ||
359 | .is_bar1_supported = gv11b_mm_is_bar1_supported, | ||
360 | .init_inst_block = gv11b_init_inst_block, | ||
361 | .mmu_fault_pending = gv11b_mm_mmu_fault_pending, | ||
362 | .init_bar2_vm = gb10b_init_bar2_vm, | ||
363 | .init_bar2_mm_hw_setup = gv11b_init_bar2_mm_hw_setup, | ||
364 | .remove_bar2_vm = gv11b_mm_remove_bar2_vm, | ||
365 | .fault_info_mem_destroy = gv11b_mm_fault_info_mem_destroy, | ||
366 | }, | ||
339 | .therm = { | 367 | .therm = { |
340 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 368 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
341 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, | 369 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, |
@@ -432,6 +460,7 @@ int gv11b_init_hal(struct gk20a *g) | |||
432 | gops->clock_gating = gv11b_ops.clock_gating; | 460 | gops->clock_gating = gv11b_ops.clock_gating; |
433 | gops->fifo = gv11b_ops.fifo; | 461 | gops->fifo = gv11b_ops.fifo; |
434 | gops->gr_ctx = gv11b_ops.gr_ctx; | 462 | gops->gr_ctx = gv11b_ops.gr_ctx; |
463 | gops->mm = gv11b_ops.mm; | ||
435 | gops->fecs_trace = gv11b_ops.fecs_trace; | 464 | gops->fecs_trace = gv11b_ops.fecs_trace; |
436 | gops->therm = gv11b_ops.therm; | 465 | gops->therm = gv11b_ops.therm; |
437 | gops->regops = gv11b_ops.regops; | 466 | gops->regops = gv11b_ops.regops; |
@@ -456,7 +485,6 @@ int gv11b_init_hal(struct gk20a *g) | |||
456 | __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false); | 485 | __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false); |
457 | 486 | ||
458 | gv11b_init_gr(g); | 487 | gv11b_init_gr(g); |
459 | gv11b_init_mm(gops); | ||
460 | gv11b_init_pmu_ops(g); | 488 | gv11b_init_pmu_ops(g); |
461 | 489 | ||
462 | gv11b_init_uncompressed_kind_map(); | 490 | gv11b_init_uncompressed_kind_map(); |