From 0dc80244eea4c7e504976d8028a3ddb72ba60b0e Mon Sep 17 00:00:00 2001 From: Sunny He Date: Thu, 22 Jun 2017 16:43:51 -0700 Subject: gpu: nvgpu: Reorganize ltc HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the ltc 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: I1110e301e57b502cf7f97e6739424cb33cc52a69 Signed-off-by: Sunny He Reviewed-on: https://git-master/r/1507564 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c index d94e56ce..baa275c7 100644 --- a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c @@ -27,7 +27,7 @@ #include "gk20a/ltc_gk20a.h" #include "ltc_gp10b.h" -static int gp10b_determine_L2_size_bytes(struct gk20a *g) +int gp10b_determine_L2_size_bytes(struct gk20a *g) { u32 tmp; int ret; @@ -47,7 +47,7 @@ static int gp10b_determine_L2_size_bytes(struct gk20a *g) return ret; } -static int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) +int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) { /* max memory size (MB) to cover */ u32 max_size = gr->max_comptag_mem; @@ -188,7 +188,7 @@ void gp10b_ltc_isr(struct gk20a *g) } } -static void gp10b_ltc_init_fs_state(struct gk20a *g) +void gp10b_ltc_init_fs_state(struct gk20a *g) { u32 ltc_intr; @@ -206,7 +206,7 @@ static void gp10b_ltc_init_fs_state(struct gk20a *g) } #ifdef CONFIG_DEBUG_FS -static void gp10b_ltc_sync_debugfs(struct gk20a *g) +void gp10b_ltc_sync_debugfs(struct gk20a *g) { u32 reg_f = ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(); @@ -227,22 +227,3 @@ static void gp10b_ltc_sync_debugfs(struct gk20a *g) nvgpu_spinlock_release(&g->debugfs_lock); } #endif - -void gp10b_init_ltc(struct gpu_ops *gops) -{ - gops->ltc.determine_L2_size_bytes = gp10b_determine_L2_size_bytes; - gops->ltc.set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry; - gops->ltc.set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry; - gops->ltc.init_cbc = gm20b_ltc_init_cbc; - - /* GM20b specific ops. */ - gops->ltc.init_fs_state = gp10b_ltc_init_fs_state; - gops->ltc.init_comptags = gp10b_ltc_init_comptags; - gops->ltc.cbc_ctrl = gm20b_ltc_cbc_ctrl; - gops->ltc.isr = gp10b_ltc_isr; - gops->ltc.cbc_fix_config = gm20b_ltc_cbc_fix_config; - gops->ltc.flush = gm20b_flush_ltc; -#ifdef CONFIG_DEBUG_FS - gops->ltc.sync_debugfs = gp10b_ltc_sync_debugfs; -#endif -} -- cgit v1.2.2