summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/hal_gp106.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-26 14:13:15 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-27 19:34:44 -0400
commit9d37d8b78c2dac7fa480493d1ab67b95290b87f1 (patch)
tree338d862a37c8639c68a22f9543fa1499f2307762 /drivers/gpu/nvgpu/gp106/hal_gp106.c
parent6431ec360bf7b7baf6dd687b1525c40114ede189 (diff)
gpu: nvgpu: Reorg fecs_trace HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the fecs_trace 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: I84485ad64997270c6a0fce3c95dc9ceb0094cf6c Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1527419 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index 763dab44..dd162109 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -15,6 +15,8 @@
15 15
16#include "gk20a/gk20a.h" 16#include "gk20a/gk20a.h"
17#include "gk20a/fifo_gk20a.h" 17#include "gk20a/fifo_gk20a.h"
18#include "gk20a/ctxsw_trace_gk20a.h"
19#include "gk20a/fecs_trace_gk20a.h"
18#include "gk20a/dbg_gpu_gk20a.h" 20#include "gk20a/dbg_gpu_gk20a.h"
19#include "gk20a/css_gr_gk20a.h" 21#include "gk20a/css_gr_gk20a.h"
20#include "gk20a/bus_gk20a.h" 22#include "gk20a/bus_gk20a.h"
@@ -317,6 +319,24 @@ static const struct gpu_ops gp106_ops = {
317 .get_netlist_name = gr_gp106_get_netlist_name, 319 .get_netlist_name = gr_gp106_get_netlist_name,
318 .is_fw_defined = gr_gp106_is_firmware_defined, 320 .is_fw_defined = gr_gp106_is_firmware_defined,
319 }, 321 },
322#ifdef CONFIG_GK20A_CTXSW_TRACE
323 .fecs_trace = {
324 .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
325 .free_user_buffer = gk20a_ctxsw_dev_ring_free,
326 .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
327 .init = gk20a_fecs_trace_init,
328 .deinit = gk20a_fecs_trace_deinit,
329 .enable = gk20a_fecs_trace_enable,
330 .disable = gk20a_fecs_trace_disable,
331 .is_enabled = gk20a_fecs_trace_is_enabled,
332 .reset = gk20a_fecs_trace_reset,
333 .flush = gp10b_fecs_trace_flush,
334 .poll = gk20a_fecs_trace_poll,
335 .bind_channel = gk20a_fecs_trace_bind_channel,
336 .unbind_channel = gk20a_fecs_trace_unbind_channel,
337 .max_entries = gk20a_gr_max_entries,
338 },
339#endif /* CONFIG_GK20A_CTXSW_TRACE */
320 .mc = { 340 .mc = {
321 .intr_enable = mc_gp10b_intr_enable, 341 .intr_enable = mc_gp10b_intr_enable,
322 .intr_unit_config = mc_gp10b_intr_unit_config, 342 .intr_unit_config = mc_gp10b_intr_unit_config,
@@ -408,6 +428,7 @@ int gp106_init_hal(struct gk20a *g)
408 gops->clock_gating = gp106_ops.clock_gating; 428 gops->clock_gating = gp106_ops.clock_gating;
409 gops->fifo = gp106_ops.fifo; 429 gops->fifo = gp106_ops.fifo;
410 gops->gr_ctx = gp106_ops.gr_ctx; 430 gops->gr_ctx = gp106_ops.gr_ctx;
431 gops->fecs_trace = gp106_ops.fecs_trace;
411 gops->mc = gp106_ops.mc; 432 gops->mc = gp106_ops.mc;
412 gops->debug = gp106_ops.debug; 433 gops->debug = gp106_ops.debug;
413 gops->dbg_session_ops = gp106_ops.dbg_session_ops; 434 gops->dbg_session_ops = gp106_ops.dbg_session_ops;
@@ -433,7 +454,6 @@ int gp106_init_hal(struct gk20a *g)
433 454
434 g->bootstrap_owner = LSF_FALCON_ID_SEC2; 455 g->bootstrap_owner = LSF_FALCON_ID_SEC2;
435 gp106_init_gr(g); 456 gp106_init_gr(g);
436 gp10b_init_fecs_trace_ops(gops);
437 gp106_init_fb(gops); 457 gp106_init_fb(gops);
438 gp106_init_mm(gops); 458 gp106_init_mm(gops);
439 gp106_init_pmu_ops(g); 459 gp106_init_pmu_ops(g);