gpu: nvgpu: gv11b: Reorg css HAL init

Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
css 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.

Change-Id: I04177d6c9eb4f3c433d493c815ad15cf7b755910
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514206
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
This commit is contained in:
Sunny He
2017-07-05 15:20:14 -07:00
committed by mobile promotions
parent 8b571de456
commit 3b7d50ee12

View File

@@ -235,6 +235,16 @@ static const struct gpu_ops gv11b_ops = {
.perfbuffer_enable = gk20a_perfbuf_enable_locked,
.perfbuffer_disable = gk20a_perfbuf_disable_locked,
},
#if defined(CONFIG_GK20A_CYCLE_STATS)
.css = {
.enable_snapshot = css_hw_enable_snapshot,
.disable_snapshot = css_hw_disable_snapshot,
.check_data_available = css_hw_check_data_available,
.set_handled_snapshots = css_hw_set_handled_snapshots,
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
.release_perfmon_ids = css_gr_release_perfmon_ids,
},
#endif
.falcon = {
.falcon_hal_sw_init = gk20a_falcon_hal_sw_init,
},
@@ -252,6 +262,9 @@ int gv11b_init_hal(struct gk20a *g)
gops->mc = gv11b_ops.mc;
gops->debug = gv11b_ops.debug;
gops->dbg_session_ops = gv11b_ops.dbg_session_ops;
#if defined(CONFIG_GK20A_CYCLE_STATS)
gops->css = gv11b_ops.css;
#endif
gops->falcon = gv11b_ops.falcon;
/* Lone functions */
@@ -276,9 +289,7 @@ int gv11b_init_hal(struct gk20a *g)
gv11b_init_regops(gops);
gv11b_init_therm_ops(gops);
gk20a_init_tsg_ops(gops);
#if defined(CONFIG_GK20A_CYCLE_STATS)
gk20a_init_css_ops(gops);
#endif
g->name = "gv11b";
c->twod_class = FERMI_TWOD_A;