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/gm20b/hal_gm20b.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/hal_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 2d8ed9ec..300f0872 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -234,6 +234,16 @@ static const struct gpu_ops gm20b_ops = { .cde = { .get_program_numbers = gm20b_cde_get_program_numbers, }, +#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, }, @@ -253,6 +263,9 @@ int gm20b_init_hal(struct gk20a *g) gops->dbg_session_ops = gm20b_ops.dbg_session_ops; gops->debug = gm20b_ops.debug; gops->cde = gm20b_ops.cde; +#if defined(CONFIG_GK20A_CYCLE_STATS) + gops->css = gm20b_ops.css; +#endif gops->falcon = gm20b_ops.falcon; /* Lone functions */ @@ -303,9 +316,6 @@ int gm20b_init_hal(struct gk20a *g) gm20b_init_regops(gops); gm20b_init_therm_ops(gops); gk20a_init_tsg_ops(gops); -#if defined(CONFIG_GK20A_CYCLE_STATS) - gk20a_init_css_ops(gops); -#endif g->name = "gm20b"; c->twod_class = FERMI_TWOD_A; -- cgit v1.2.2