summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/hal_gp10b.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/gp10b/hal_gp10b.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/gp10b/hal_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 80018910..1574ac56 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.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"
@@ -283,6 +285,24 @@ static const struct gpu_ops gp10b_ops = {
283 .get_netlist_name = gr_gp10b_get_netlist_name, 285 .get_netlist_name = gr_gp10b_get_netlist_name,
284 .is_fw_defined = gr_gp10b_is_firmware_defined, 286 .is_fw_defined = gr_gp10b_is_firmware_defined,
285 }, 287 },
288#ifdef CONFIG_GK20A_CTXSW_TRACE
289 .fecs_trace = {
290 .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
291 .free_user_buffer = gk20a_ctxsw_dev_ring_free,
292 .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
293 .init = gk20a_fecs_trace_init,
294 .deinit = gk20a_fecs_trace_deinit,
295 .enable = gk20a_fecs_trace_enable,
296 .disable = gk20a_fecs_trace_disable,
297 .is_enabled = gk20a_fecs_trace_is_enabled,
298 .reset = gk20a_fecs_trace_reset,
299 .flush = gp10b_fecs_trace_flush,
300 .poll = gk20a_fecs_trace_poll,
301 .bind_channel = gk20a_fecs_trace_bind_channel,
302 .unbind_channel = gk20a_fecs_trace_unbind_channel,
303 .max_entries = gk20a_gr_max_entries,
304 },
305#endif /* CONFIG_GK20A_CTXSW_TRACE */
286 .mc = { 306 .mc = {
287 .intr_enable = mc_gp10b_intr_enable, 307 .intr_enable = mc_gp10b_intr_enable,
288 .intr_unit_config = mc_gp10b_intr_unit_config, 308 .intr_unit_config = mc_gp10b_intr_unit_config,
@@ -357,6 +377,7 @@ int gp10b_init_hal(struct gk20a *g)
357 gops->clock_gating = gp10b_ops.clock_gating; 377 gops->clock_gating = gp10b_ops.clock_gating;
358 gops->fifo = gp10b_ops.fifo; 378 gops->fifo = gp10b_ops.fifo;
359 gops->gr_ctx = gp10b_ops.gr_ctx; 379 gops->gr_ctx = gp10b_ops.gr_ctx;
380 gops->fecs_trace = gp10b_ops.fecs_trace;
360 gops->mc = gp10b_ops.mc; 381 gops->mc = gp10b_ops.mc;
361 gops->debug = gp10b_ops.debug; 382 gops->debug = gp10b_ops.debug;
362 gops->dbg_session_ops = gp10b_ops.dbg_session_ops; 383 gops->dbg_session_ops = gp10b_ops.dbg_session_ops;
@@ -416,7 +437,6 @@ int gp10b_init_hal(struct gk20a *g)
416 437
417 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; 438 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT;
418 gp10b_init_gr(g); 439 gp10b_init_gr(g);
419 gp10b_init_fecs_trace_ops(gops);
420 gp10b_init_fb(gops); 440 gp10b_init_fb(gops);
421 gp10b_init_mm(gops); 441 gp10b_init_mm(gops);
422 gp10b_init_pmu_ops(g); 442 gp10b_init_pmu_ops(g);