From d717c69d2b1992688589ae389380fedf0b06c720 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Fri, 30 Jun 2017 14:40:33 -0700 Subject: gpu: nvgpu: Reorg css HAL initialization 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. Jira NVGPU-74 Change-Id: I3bf696e13d359982c964c7bc470500a30555c034 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1514205 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gp106/hal_gp106.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106') diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 2ebf93e2..c54232aa 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -278,6 +278,16 @@ static const struct gpu_ops gp106_ops = { .need_scatter_buffer = gp10b_need_scatter_buffer, .populate_scatter_buffer = gp10b_populate_scatter_buffer, }, +#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 .xve = { .sw_init = xve_sw_init_gp106, .get_speed = xve_get_speed_gp106, @@ -314,6 +324,9 @@ int gp106_init_hal(struct gk20a *g) gops->debug = gp106_ops.debug; gops->dbg_session_ops = gp106_ops.dbg_session_ops; gops->cde = gp106_ops.cde; +#if defined(CONFIG_GK20A_CYCLE_STATS) + gops->css = gp106_ops.css; +#endif gops->xve = gp106_ops.xve; gops->falcon = gp106_ops.falcon; @@ -342,9 +355,6 @@ int gp106_init_hal(struct gk20a *g) gp106_init_regops(gops); gk20a_init_tsg_ops(gops); gk20a_init_pramin_ops(gops); -#if defined(CONFIG_GK20A_CYCLE_STATS) - gk20a_init_css_ops(gops); -#endif gp106_init_therm_ops(gops); g->name = "gp10x"; -- cgit v1.2.2