diff options
author | Sunny He <suhe@nvidia.com> | 2017-07-26 17:23:01 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-11 17:16:53 -0400 |
commit | 96615351ad11a186f5869e56acb3c1948ab7b7cc (patch) | |
tree | ba966b032754711189b54f296888e00dcba608ef /drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |
parent | da8e67f042760d54f3d6b5f84abbd9981d9fcd54 (diff) |
gpu: nvgpu: gv11b: Reorg mm HAL init
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: Ic2c7d56e552645f2125d9c60a817967be1e8e765
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1533355
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/hal_gv11b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 9f6c67c1..afc90aa7 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" |
@@ -60,6 +63,8 @@ | |||
60 | #include "regops_gv11b.h" | 63 | #include "regops_gv11b.h" |
61 | #include "subctx_gv11b.h" | 64 | #include "subctx_gv11b.h" |
62 | 65 | ||
66 | #include "common/linux/platform_gk20a_tegra.h" | ||
67 | |||
63 | #include <nvgpu/debug.h> | 68 | #include <nvgpu/debug.h> |
64 | #include <nvgpu/enabled.h> | 69 | #include <nvgpu/enabled.h> |
65 | 70 | ||
@@ -333,6 +338,31 @@ static const struct gpu_ops gv11b_ops = { | |||
333 | .max_entries = gk20a_gr_max_entries, | 338 | .max_entries = gk20a_gr_max_entries, |
334 | }, | 339 | }, |
335 | #endif /* CONFIG_GK20A_CTXSW_TRACE */ | 340 | #endif /* CONFIG_GK20A_CTXSW_TRACE */ |
341 | .mm = { | ||
342 | .support_sparse = gm20b_mm_support_sparse, | ||
343 | .gmmu_map = gk20a_locked_gmmu_map, | ||
344 | .gmmu_unmap = gk20a_locked_gmmu_unmap, | ||
345 | .vm_bind_channel = gk20a_vm_bind_channel, | ||
346 | .fb_flush = gk20a_mm_fb_flush, | ||
347 | .l2_invalidate = gk20a_mm_l2_invalidate, | ||
348 | .l2_flush = gv11b_mm_l2_flush, | ||
349 | .cbc_clean = gk20a_mm_cbc_clean, | ||
350 | .set_big_page_size = gm20b_mm_set_big_page_size, | ||
351 | .get_big_page_sizes = gm20b_mm_get_big_page_sizes, | ||
352 | .get_default_big_page_size = gp10b_mm_get_default_big_page_size, | ||
353 | .gpu_phys_addr = gv11b_gpu_phys_addr, | ||
354 | .get_physical_addr_bits = gp10b_mm_get_physical_addr_bits, | ||
355 | .get_mmu_levels = gp10b_mm_get_mmu_levels, | ||
356 | .init_pdb = gp10b_mm_init_pdb, | ||
357 | .init_mm_setup_hw = gv11b_init_mm_setup_hw, | ||
358 | .is_bar1_supported = gv11b_mm_is_bar1_supported, | ||
359 | .init_inst_block = gv11b_init_inst_block, | ||
360 | .mmu_fault_pending = gv11b_mm_mmu_fault_pending, | ||
361 | .init_bar2_vm = gb10b_init_bar2_vm, | ||
362 | .init_bar2_mm_hw_setup = gv11b_init_bar2_mm_hw_setup, | ||
363 | .remove_bar2_vm = gv11b_mm_remove_bar2_vm, | ||
364 | .fault_info_mem_destroy = gv11b_mm_fault_info_mem_destroy, | ||
365 | }, | ||
336 | .therm = { | 366 | .therm = { |
337 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 367 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
338 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, | 368 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, |
@@ -429,6 +459,7 @@ int gv11b_init_hal(struct gk20a *g) | |||
429 | gops->clock_gating = gv11b_ops.clock_gating; | 459 | gops->clock_gating = gv11b_ops.clock_gating; |
430 | gops->fifo = gv11b_ops.fifo; | 460 | gops->fifo = gv11b_ops.fifo; |
431 | gops->gr_ctx = gv11b_ops.gr_ctx; | 461 | gops->gr_ctx = gv11b_ops.gr_ctx; |
462 | gops->mm = gv11b_ops.mm; | ||
432 | gops->fecs_trace = gv11b_ops.fecs_trace; | 463 | gops->fecs_trace = gv11b_ops.fecs_trace; |
433 | gops->therm = gv11b_ops.therm; | 464 | gops->therm = gv11b_ops.therm; |
434 | gops->regops = gv11b_ops.regops; | 465 | gops->regops = gv11b_ops.regops; |
@@ -453,7 +484,6 @@ int gv11b_init_hal(struct gk20a *g) | |||
453 | __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false); | 484 | __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false); |
454 | 485 | ||
455 | gv11b_init_gr(g); | 486 | gv11b_init_gr(g); |
456 | gv11b_init_mm(gops); | ||
457 | gv11b_init_pmu_ops(g); | 487 | gv11b_init_pmu_ops(g); |
458 | 488 | ||
459 | gv11b_init_uncompressed_kind_map(); | 489 | gv11b_init_uncompressed_kind_map(); |