summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-26 14:14:21 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-27 19:34:44 -0400
commit8aa0370005a81a7e26ae7c86585626d3261aa4d3 (patch)
tree635472c476daf9987ff5ec61bbd41a794dc96b21 /drivers/gpu/nvgpu/gv11b
parentafa29933e45b2c3054db67065a0a68606bbc1f52 (diff)
gpu: nvgpu: gv11b: Reorg fecs_trace HAL init
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: I43932a8eac2a9f791e967a8ed736f76350889a51 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1527420 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c31
-rw-r--r--drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h23
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c24
3 files changed, 22 insertions, 56 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c b/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c
deleted file mode 100644
index 92357980..00000000
--- a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * GV11B GPU FECS traces
3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#include "gp10b/fecs_trace_gp10b.h"
17
18#include "gv11b/fecs_trace_gv11b.h"
19
20#ifdef CONFIG_GK20A_CTXSW_TRACE
21int gv11b_init_fecs_trace_ops(struct gpu_ops *ops)
22{
23 gp10b_init_fecs_trace_ops(ops);
24 return 0;
25}
26#else
27int gv11b_init_fecs_trace_ops(struct gpu_ops *ops)
28{
29 return 0;
30}
31#endif /* CONFIG_GK20A_CTXSW_TRACE */
diff --git a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h b/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h
deleted file mode 100644
index 607d715b..00000000
--- a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * GV11B GPU FECS traces
3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _NVGPU_FECS_TRACE_GV11B_H_
17#define _NVGPU_FECS_TRACE_GV11B_H_
18
19struct gpu_ops;
20
21int gv11b_init_fecs_trace_ops(struct gpu_ops *);
22
23#endif
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index f5191da7..04712409 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -21,6 +21,8 @@
21 21
22#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
23#include "gk20a/fifo_gk20a.h" 23#include "gk20a/fifo_gk20a.h"
24#include "gk20a/ctxsw_trace_gk20a.h"
25#include "gk20a/fecs_trace_gk20a.h"
24#include "gk20a/css_gr_gk20a.h" 26#include "gk20a/css_gr_gk20a.h"
25#include "gk20a/mc_gk20a.h" 27#include "gk20a/mc_gk20a.h"
26#include "gk20a/dbg_gpu_gk20a.h" 28#include "gk20a/dbg_gpu_gk20a.h"
@@ -37,12 +39,12 @@
37#include "gp10b/ce_gp10b.h" 39#include "gp10b/ce_gp10b.h"
38#include "gp10b/priv_ring_gp10b.h" 40#include "gp10b/priv_ring_gp10b.h"
39#include "gp10b/fifo_gp10b.h" 41#include "gp10b/fifo_gp10b.h"
42#include "gp10b/fecs_trace_gp10b.h"
40 43
41#include "hal_gv11b.h" 44#include "hal_gv11b.h"
42#include "gr_gv11b.h" 45#include "gr_gv11b.h"
43#include "mc_gv11b.h" 46#include "mc_gv11b.h"
44#include "ltc_gv11b.h" 47#include "ltc_gv11b.h"
45#include "fecs_trace_gv11b.h"
46#include "gv11b.h" 48#include "gv11b.h"
47#include "ce_gv11b.h" 49#include "ce_gv11b.h"
48#include "gr_ctx_gv11b.h" 50#include "gr_ctx_gv11b.h"
@@ -286,6 +288,24 @@ static const struct gpu_ops gv11b_ops = {
286 .get_netlist_name = gr_gv11b_get_netlist_name, 288 .get_netlist_name = gr_gv11b_get_netlist_name,
287 .is_fw_defined = gr_gv11b_is_firmware_defined, 289 .is_fw_defined = gr_gv11b_is_firmware_defined,
288 }, 290 },
291#ifdef CONFIG_GK20A_CTXSW_TRACE
292 .fecs_trace = {
293 .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
294 .free_user_buffer = gk20a_ctxsw_dev_ring_free,
295 .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
296 .init = gk20a_fecs_trace_init,
297 .deinit = gk20a_fecs_trace_deinit,
298 .enable = gk20a_fecs_trace_enable,
299 .disable = gk20a_fecs_trace_disable,
300 .is_enabled = gk20a_fecs_trace_is_enabled,
301 .reset = gk20a_fecs_trace_reset,
302 .flush = gp10b_fecs_trace_flush,
303 .poll = gk20a_fecs_trace_poll,
304 .bind_channel = gk20a_fecs_trace_bind_channel,
305 .unbind_channel = gk20a_fecs_trace_unbind_channel,
306 .max_entries = gk20a_gr_max_entries,
307 },
308#endif /* CONFIG_GK20A_CTXSW_TRACE */
289 .mc = { 309 .mc = {
290 .intr_enable = mc_gv11b_intr_enable, 310 .intr_enable = mc_gv11b_intr_enable,
291 .intr_unit_config = mc_gp10b_intr_unit_config, 311 .intr_unit_config = mc_gp10b_intr_unit_config,
@@ -354,6 +374,7 @@ int gv11b_init_hal(struct gk20a *g)
354 gops->clock_gating = gv11b_ops.clock_gating; 374 gops->clock_gating = gv11b_ops.clock_gating;
355 gops->fifo = gv11b_ops.fifo; 375 gops->fifo = gv11b_ops.fifo;
356 gops->gr_ctx = gv11b_ops.gr_ctx; 376 gops->gr_ctx = gv11b_ops.gr_ctx;
377 gops->fecs_trace = gv11b_ops.fecs_trace;
357 gops->mc = gv11b_ops.mc; 378 gops->mc = gv11b_ops.mc;
358 gops->debug = gv11b_ops.debug; 379 gops->debug = gv11b_ops.debug;
359 gops->dbg_session_ops = gv11b_ops.dbg_session_ops; 380 gops->dbg_session_ops = gv11b_ops.dbg_session_ops;
@@ -375,7 +396,6 @@ int gv11b_init_hal(struct gk20a *g)
375 __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false); 396 __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false);
376 397
377 gv11b_init_gr(g); 398 gv11b_init_gr(g);
378 gv11b_init_fecs_trace_ops(gops);
379 gv11b_init_fb(gops); 399 gv11b_init_fb(gops);
380 gv11b_init_mm(gops); 400 gv11b_init_mm(gops);
381 gv11b_init_pmu_ops(g); 401 gv11b_init_pmu_ops(g);