From f87007829f176baa5d3e784c71f3bceb082a29eb Mon Sep 17 00:00:00 2001 From: Sunny He Date: Fri, 28 Jul 2017 18:37:49 -0700 Subject: gpu: nvgpu: gv11b: Reorg regops HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the regops 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: Ibf9f64ca445691e252b72c2b8fc59edb84e226ce Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1530136 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Tested-by: Alex Waterman Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/regops_gv11b.c | 63 +++++++--------------------------- 1 file changed, 13 insertions(+), 50 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/regops_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c index 75923b6a..5e98f9f1 100644 --- a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c @@ -1327,105 +1327,68 @@ static const struct regop_offset_range gv11b_qctl_whitelist_ranges[] = { static const u32 gv11b_qctl_whitelist_ranges_count = ARRAY_SIZE(gv11b_qctl_whitelist_ranges); -static const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void) +const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void) { return gv11b_global_whitelist_ranges; } -static int gv11b_get_global_whitelist_ranges_count(void) +int gv11b_get_global_whitelist_ranges_count(void) { return gv11b_global_whitelist_ranges_count; } -static const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void) +const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void) { return gv11b_global_whitelist_ranges; } -static int gv11b_get_context_whitelist_ranges_count(void) +int gv11b_get_context_whitelist_ranges_count(void) { return gv11b_global_whitelist_ranges_count; } -static const u32 *gv11b_get_runcontrol_whitelist(void) +const u32 *gv11b_get_runcontrol_whitelist(void) { return gv11b_runcontrol_whitelist; } -static int gv11b_get_runcontrol_whitelist_count(void) +int gv11b_get_runcontrol_whitelist_count(void) { return gv11b_runcontrol_whitelist_count; } -static const -struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void) +const struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void) { return gv11b_runcontrol_whitelist_ranges; } -static int gv11b_get_runcontrol_whitelist_ranges_count(void) +int gv11b_get_runcontrol_whitelist_ranges_count(void) { return gv11b_runcontrol_whitelist_ranges_count; } -static const u32 *gv11b_get_qctl_whitelist(void) +const u32 *gv11b_get_qctl_whitelist(void) { return gv11b_qctl_whitelist; } -static int gv11b_get_qctl_whitelist_count(void) +int gv11b_get_qctl_whitelist_count(void) { return gv11b_qctl_whitelist_count; } -static const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void) +const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void) { return gv11b_qctl_whitelist_ranges; } -static int gv11b_get_qctl_whitelist_ranges_count(void) +int gv11b_get_qctl_whitelist_ranges_count(void) { return gv11b_qctl_whitelist_ranges_count; } -static int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s) +int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s) { /* Not needed on gv11b */ return 0; } - -void gv11b_init_regops(struct gpu_ops *gops) -{ - gops->regops.get_global_whitelist_ranges = - gv11b_get_global_whitelist_ranges; - gops->regops.get_global_whitelist_ranges_count = - gv11b_get_global_whitelist_ranges_count; - - gops->regops.get_context_whitelist_ranges = - gv11b_get_context_whitelist_ranges; - gops->regops.get_context_whitelist_ranges_count = - gv11b_get_context_whitelist_ranges_count; - - gops->regops.get_runcontrol_whitelist = - gv11b_get_runcontrol_whitelist; - gops->regops.get_runcontrol_whitelist_count = - gv11b_get_runcontrol_whitelist_count; - - gops->regops.get_runcontrol_whitelist_ranges = - gv11b_get_runcontrol_whitelist_ranges; - gops->regops.get_runcontrol_whitelist_ranges_count = - gv11b_get_runcontrol_whitelist_ranges_count; - - gops->regops.get_qctl_whitelist = - gv11b_get_qctl_whitelist; - gops->regops.get_qctl_whitelist_count = - gv11b_get_qctl_whitelist_count; - - gops->regops.get_qctl_whitelist_ranges = - gv11b_get_qctl_whitelist_ranges; - gops->regops.get_qctl_whitelist_ranges_count = - gv11b_get_qctl_whitelist_ranges_count; - - gops->regops.apply_smpc_war = - gv11b_apply_smpc_war; -} -- cgit v1.2.2