summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
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
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')
-rw-r--r--drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c12
-rw-r--r--drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h4
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c22
3 files changed, 24 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c
index 723da1a2..bec40512 100644
--- a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c
@@ -22,7 +22,7 @@
22#include <nvgpu/hw/gp10b/hw_gr_gp10b.h> 22#include <nvgpu/hw/gp10b/hw_gr_gp10b.h>
23 23
24#ifdef CONFIG_GK20A_CTXSW_TRACE 24#ifdef CONFIG_GK20A_CTXSW_TRACE
25static int gp10b_fecs_trace_flush(struct gk20a *g) 25int gp10b_fecs_trace_flush(struct gk20a *g)
26{ 26{
27 struct fecs_method_op_gk20a op = { 27 struct fecs_method_op_gk20a op = {
28 .mailbox = { .id = 0, .data = 0, 28 .mailbox = { .id = 0, .data = 0,
@@ -43,14 +43,4 @@ static int gp10b_fecs_trace_flush(struct gk20a *g)
43 43
44 return err; 44 return err;
45} 45}
46
47void gp10b_init_fecs_trace_ops(struct gpu_ops *ops)
48{
49 gk20a_init_fecs_trace_ops(ops);
50 ops->fecs_trace.flush = gp10b_fecs_trace_flush;
51}
52#else
53void gp10b_init_fecs_trace_ops(struct gpu_ops *ops)
54{
55}
56#endif /* CONFIG_GK20A_CTXSW_TRACE */ 46#endif /* CONFIG_GK20A_CTXSW_TRACE */
diff --git a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h
index 656bc551..43ecb6fc 100644
--- a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h
@@ -16,8 +16,8 @@
16#ifndef _NVGPU_FECS_TRACE_GP10B_H_ 16#ifndef _NVGPU_FECS_TRACE_GP10B_H_
17#define _NVGPU_FECS_TRACE_GP10B_H_ 17#define _NVGPU_FECS_TRACE_GP10B_H_
18 18
19struct gpu_ops; 19struct gk20a;
20 20
21void gp10b_init_fecs_trace_ops(struct gpu_ops *); 21int gp10b_fecs_trace_flush(struct gk20a *g);
22 22
23#endif 23#endif
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);