diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-29 14:16:36 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-13 03:09:09 -0400 |
commit | 542ad000f2fb0301fbfb7e6defc6a01eb488906d (patch) | |
tree | 13ee76cd70b5ed771b04e699b3842bb5451bca1a /drivers/gpu/nvgpu/gp106/hal_gp106.c | |
parent | 47cb48f1e2d9c34f22f9fcf443ef67a32cd54a73 (diff) |
gpu: nvgpu: Reorg debug HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch covers the debug
and dbg_session_ops sub-modules 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: Id51feeccbea91f884a6057efc680566a7d5d0b6d
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514822
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 8521bf6d..14f7dc2e 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "gk20a/bus_gk20a.h" | 19 | #include "gk20a/bus_gk20a.h" |
20 | #include "gk20a/pramin_gk20a.h" | 20 | #include "gk20a/pramin_gk20a.h" |
21 | #include "gk20a/flcn_gk20a.h" | 21 | #include "gk20a/flcn_gk20a.h" |
22 | #include "gk20a/regops_gk20a.h" | ||
22 | #include "gk20a/mc_gk20a.h" | 23 | #include "gk20a/mc_gk20a.h" |
23 | 24 | ||
24 | #include "gp10b/ltc_gp10b.h" | 25 | #include "gp10b/ltc_gp10b.h" |
@@ -257,6 +258,21 @@ static const struct gpu_ops gp106_ops = { | |||
257 | .boot_0 = gk20a_mc_boot_0, | 258 | .boot_0 = gk20a_mc_boot_0, |
258 | .is_intr1_pending = mc_gp10b_is_intr1_pending, | 259 | .is_intr1_pending = mc_gp10b_is_intr1_pending, |
259 | }, | 260 | }, |
261 | .debug = { | ||
262 | .show_dump = gk20a_debug_show_dump, | ||
263 | }, | ||
264 | .dbg_session_ops = { | ||
265 | .exec_reg_ops = exec_regops_gk20a, | ||
266 | .dbg_set_powergate = dbg_set_powergate, | ||
267 | .check_and_set_global_reservation = | ||
268 | nvgpu_check_and_set_global_reservation, | ||
269 | .check_and_set_context_reservation = | ||
270 | nvgpu_check_and_set_context_reservation, | ||
271 | .release_profiler_reservation = | ||
272 | nvgpu_release_profiler_reservation, | ||
273 | .perfbuffer_enable = gk20a_perfbuf_enable_locked, | ||
274 | .perfbuffer_disable = gk20a_perfbuf_disable_locked, | ||
275 | }, | ||
260 | .cde = { | 276 | .cde = { |
261 | .get_program_numbers = gp10b_cde_get_program_numbers, | 277 | .get_program_numbers = gp10b_cde_get_program_numbers, |
262 | .need_scatter_buffer = gp10b_need_scatter_buffer, | 278 | .need_scatter_buffer = gp10b_need_scatter_buffer, |
@@ -295,6 +311,8 @@ int gp106_init_hal(struct gk20a *g) | |||
295 | gops->ltc = gp106_ops.ltc; | 311 | gops->ltc = gp106_ops.ltc; |
296 | gops->clock_gating = gp106_ops.clock_gating; | 312 | gops->clock_gating = gp106_ops.clock_gating; |
297 | gops->mc = gp106_ops.mc; | 313 | gops->mc = gp106_ops.mc; |
314 | gops->debug = gp106_ops.debug; | ||
315 | gops->dbg_session_ops = gp106_ops.dbg_session_ops; | ||
298 | gops->cde = gp106_ops.cde; | 316 | gops->cde = gp106_ops.cde; |
299 | gops->xve = gp106_ops.xve; | 317 | gops->xve = gp106_ops.xve; |
300 | gops->falcon = gp106_ops.falcon; | 318 | gops->falcon = gp106_ops.falcon; |
@@ -318,8 +336,6 @@ int gp106_init_hal(struct gk20a *g) | |||
318 | gp106_init_gr_ctx(gops); | 336 | gp106_init_gr_ctx(gops); |
319 | gp106_init_mm(gops); | 337 | gp106_init_mm(gops); |
320 | gp106_init_pmu_ops(gops); | 338 | gp106_init_pmu_ops(gops); |
321 | gk20a_init_debug_ops(gops); | ||
322 | gk20a_init_dbg_session_ops(gops); | ||
323 | gp106_init_clk_ops(gops); | 339 | gp106_init_clk_ops(gops); |
324 | gp106_init_clk_arb_ops(gops); | 340 | gp106_init_clk_arb_ops(gops); |
325 | gp106_init_regops(gops); | 341 | gp106_init_regops(gops); |