diff options
author | Sunny He <suhe@nvidia.com> | 2017-08-17 19:11:34 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-24 12:34:43 -0400 |
commit | 4b5b67d6d83430d8d670660b1dfc9cf024d60d88 (patch) | |
tree | 541a421438fe849ee4b1ab9e6bdfa9e8b6ee4485 /drivers/gpu/nvgpu/gm20b/gr_gm20b.h | |
parent | 82ba1277f3da7379ed6b8288c04bb91db008549c (diff) |
gpu: nvgpu: Reorg gr HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
gr 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: Ie37638f442fd68aca8a7ade5f297118447bdc91e
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1542989
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.h')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_gm20b.h | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h index 116a92f4..f81aa728 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h | |||
@@ -34,12 +34,95 @@ enum { | |||
34 | #define NVB1C0_SET_RD_COALESCE 0x0228 | 34 | #define NVB1C0_SET_RD_COALESCE 0x0228 |
35 | 35 | ||
36 | #define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0 | 36 | #define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0 |
37 | void gm20b_init_gr(struct gk20a *g); | 37 | |
38 | void gr_gm20b_commit_global_attrib_cb(struct gk20a *g, | 38 | void gr_gm20b_commit_global_attrib_cb(struct gk20a *g, |
39 | struct channel_ctx_gk20a *ch_ctx, | 39 | struct channel_ctx_gk20a *ch_ctx, |
40 | u64 addr, bool patch); | 40 | u64 addr, bool patch); |
41 | int gr_gm20b_init_fs_state(struct gk20a *g); | 41 | int gr_gm20b_init_fs_state(struct gk20a *g); |
42 | int gm20b_gr_tpc_disable_override(struct gk20a *g, u32 mask); | 42 | int gm20b_gr_tpc_disable_override(struct gk20a *g, u32 mask); |
43 | void gr_gm20b_set_rd_coalesce(struct gk20a *g, u32 data); | 43 | void gr_gm20b_set_rd_coalesce(struct gk20a *g, u32 data); |
44 | 44 | void gm20a_gr_disable_rd_coalesce(struct gk20a *g); | |
45 | void gr_gm20b_init_gpc_mmu(struct gk20a *g); | ||
46 | void gr_gm20b_bundle_cb_defaults(struct gk20a *g); | ||
47 | void gr_gm20b_cb_size_default(struct gk20a *g); | ||
48 | int gr_gm20b_calc_global_ctx_buffer_size(struct gk20a *g); | ||
49 | void gr_gm20b_commit_global_bundle_cb(struct gk20a *g, | ||
50 | struct channel_ctx_gk20a *ch_ctx, | ||
51 | u64 addr, u64 size, bool patch); | ||
52 | int gr_gm20b_commit_global_cb_manager(struct gk20a *g, | ||
53 | struct channel_gk20a *c, bool patch); | ||
54 | void gr_gm20b_commit_global_pagepool(struct gk20a *g, | ||
55 | struct channel_ctx_gk20a *ch_ctx, | ||
56 | u64 addr, u32 size, bool patch); | ||
57 | int gr_gm20b_handle_sw_method(struct gk20a *g, u32 addr, | ||
58 | u32 class_num, u32 offset, u32 data); | ||
59 | void gr_gm20b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data); | ||
60 | void gr_gm20b_set_circular_buffer_size(struct gk20a *g, u32 data); | ||
61 | void gr_gm20b_set_hww_esr_report_mask(struct gk20a *g); | ||
62 | bool gr_gm20b_is_valid_class(struct gk20a *g, u32 class_num); | ||
63 | bool gr_gm20b_is_valid_gfx_class(struct gk20a *g, u32 class_num); | ||
64 | bool gr_gm20b_is_valid_compute_class(struct gk20a *g, u32 class_num); | ||
65 | void gr_gm20b_init_sm_dsm_reg_info(void); | ||
66 | void gr_gm20b_get_sm_dsm_perf_regs(struct gk20a *g, | ||
67 | u32 *num_sm_dsm_perf_regs, | ||
68 | u32 **sm_dsm_perf_regs, | ||
69 | u32 *perf_register_stride); | ||
70 | void gr_gm20b_get_sm_dsm_perf_ctrl_regs(struct gk20a *g, | ||
71 | u32 *num_sm_dsm_perf_ctrl_regs, | ||
72 | u32 **sm_dsm_perf_ctrl_regs, | ||
73 | u32 *ctrl_register_stride); | ||
74 | u32 gr_gm20b_get_gpc_tpc_mask(struct gk20a *g, u32 gpc_index); | ||
75 | void gr_gm20b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index); | ||
76 | void gr_gm20b_load_tpc_mask(struct gk20a *g); | ||
77 | void gr_gm20b_program_sm_id_numbering(struct gk20a *g, | ||
78 | u32 gpc, u32 tpc, u32 smid); | ||
79 | int gr_gm20b_load_smid_config(struct gk20a *g); | ||
80 | int gr_gm20b_load_ctxsw_ucode_segments(struct gk20a *g, u64 addr_base, | ||
81 | struct gk20a_ctxsw_ucode_segments *segments, u32 reg_offset); | ||
82 | bool gr_gm20b_is_tpc_addr(struct gk20a *g, u32 addr); | ||
83 | u32 gr_gm20b_get_tpc_num(struct gk20a *g, u32 addr); | ||
84 | int gr_gm20b_load_ctxsw_ucode(struct gk20a *g); | ||
85 | int gr_gm20b_load_ctxsw_ucode(struct gk20a *g); | ||
86 | void gr_gm20b_detect_sm_arch(struct gk20a *g); | ||
87 | u32 gr_gm20b_pagepool_default_size(struct gk20a *g); | ||
88 | int gr_gm20b_alloc_gr_ctx(struct gk20a *g, | ||
89 | struct gr_ctx_desc **gr_ctx, struct vm_gk20a *vm, | ||
90 | u32 class, | ||
91 | u32 flags); | ||
92 | void gr_gm20b_update_ctxsw_preemption_mode(struct gk20a *g, | ||
93 | struct channel_ctx_gk20a *ch_ctx, | ||
94 | struct nvgpu_mem *mem); | ||
95 | int gr_gm20b_dump_gr_status_regs(struct gk20a *g, | ||
96 | struct gk20a_debug_output *o); | ||
97 | int gr_gm20b_update_pc_sampling(struct channel_gk20a *c, | ||
98 | bool enable); | ||
99 | u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g); | ||
100 | u32 gr_gm20b_get_max_ltc_per_fbp(struct gk20a *g); | ||
101 | u32 gr_gm20b_get_max_lts_per_ltc(struct gk20a *g); | ||
102 | u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g); | ||
103 | u32 gr_gm20b_get_max_fbps_count(struct gk20a *g); | ||
104 | void gr_gm20b_init_cyclestats(struct gk20a *g); | ||
105 | void gr_gm20b_enable_cde_in_fecs(struct gk20a *g, struct nvgpu_mem *mem); | ||
106 | void gr_gm20b_bpt_reg_info(struct gk20a *g, struct warpstate *w_state); | ||
107 | void gr_gm20b_get_access_map(struct gk20a *g, | ||
108 | u32 **whitelist, int *num_entries); | ||
109 | int gm20b_gr_record_sm_error_state(struct gk20a *g, u32 gpc, u32 tpc); | ||
110 | int gm20b_gr_update_sm_error_state(struct gk20a *g, | ||
111 | struct channel_gk20a *ch, u32 sm_id, | ||
112 | struct nvgpu_dbg_gpu_sm_error_state_record *sm_error_state); | ||
113 | int gm20b_gr_clear_sm_error_state(struct gk20a *g, | ||
114 | struct channel_gk20a *ch, u32 sm_id); | ||
115 | int gr_gm20b_get_preemption_mode_flags(struct gk20a *g, | ||
116 | struct nvgpu_preemption_modes_rec *preemption_modes_rec); | ||
117 | int gm20b_gr_fuse_override(struct gk20a *g); | ||
118 | bool gr_gm20b_is_ltcs_ltss_addr(struct gk20a *g, u32 addr); | ||
119 | bool gr_gm20b_is_ltcn_ltss_addr(struct gk20a *g, u32 addr); | ||
120 | void gr_gm20b_split_lts_broadcast_addr(struct gk20a *g, u32 addr, | ||
121 | u32 *priv_addr_table, | ||
122 | u32 *priv_addr_table_index); | ||
123 | void gr_gm20b_split_ltc_broadcast_addr(struct gk20a *g, u32 addr, | ||
124 | u32 *priv_addr_table, | ||
125 | u32 *priv_addr_table_index); | ||
126 | void gm20b_gr_clear_sm_hww(struct gk20a *g, u32 gpc, u32 tpc, u32 sm, | ||
127 | u32 global_esr); | ||
45 | #endif | 128 | #endif |