diff options
author | Sunny He <suhe@nvidia.com> | 2017-08-17 19:10:42 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-24 12:34:43 -0400 |
commit | 866165749a0b7b2e6b219bb26bffd69d790d97c5 (patch) | |
tree | 912f2df921d7a8964947efa9be6bec25cf0445d7 /drivers/gpu/nvgpu/gv11b/gr_gv11b.h | |
parent | bcf556b640a3680522b03042574081abe0e17fef (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: I8feaa95a9830969221f7ac70a5ef61cdf25094c3
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1542988
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/gr_gv11b.h')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.h | 140 |
1 files changed, 139 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h index 69148554..9adace63 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h | |||
@@ -30,6 +30,9 @@ struct zbc_s_table { | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct gk20a; | 32 | struct gk20a; |
33 | struct zbc_entry; | ||
34 | struct zbc_query_params; | ||
35 | struct channel_ctx_gk20a; | ||
33 | 36 | ||
34 | enum { | 37 | enum { |
35 | VOLTA_CHANNEL_GPFIFO_A = 0xC36F, | 38 | VOLTA_CHANNEL_GPFIFO_A = 0xC36F, |
@@ -59,11 +62,146 @@ enum { | |||
59 | 62 | ||
60 | #define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0 | 63 | #define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0 |
61 | 64 | ||
62 | void gv11b_init_gr(struct gk20a *g); | ||
63 | int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size, | 65 | int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size, |
64 | struct nvgpu_mem *mem); | 66 | struct nvgpu_mem *mem); |
65 | /*zcull*/ | 67 | /*zcull*/ |
66 | void gr_gv11b_program_zcull_mapping(struct gk20a *g, u32 zcull_num_entries, | 68 | void gr_gv11b_program_zcull_mapping(struct gk20a *g, u32 zcull_num_entries, |
67 | u32 *zcull_map_tiles); | 69 | u32 *zcull_map_tiles); |
68 | void gr_gv11b_create_sysfs(struct device *dev); | 70 | void gr_gv11b_create_sysfs(struct device *dev); |
71 | |||
72 | bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num); | ||
73 | bool gr_gv11b_is_valid_gfx_class(struct gk20a *g, u32 class_num); | ||
74 | bool gr_gv11b_is_valid_compute_class(struct gk20a *g, u32 class_num); | ||
75 | void gr_gv11b_enable_hww_exceptions(struct gk20a *g); | ||
76 | void gr_gv11b_enable_exceptions(struct gk20a *g); | ||
77 | int gr_gv11b_handle_tpc_sm_ecc_exception(struct gk20a *g, | ||
78 | u32 gpc, u32 tpc, | ||
79 | bool *post_event, struct channel_gk20a *fault_ch, | ||
80 | u32 *hww_global_esr); | ||
81 | int gr_gv11b_handle_gcc_exception(struct gk20a *g, u32 gpc, u32 tpc, | ||
82 | bool *post_event, struct channel_gk20a *fault_ch, | ||
83 | u32 *hww_global_esr); | ||
84 | int gr_gv11b_handle_gpc_gpcmmu_exception(struct gk20a *g, u32 gpc, | ||
85 | u32 gpc_exception); | ||
86 | int gr_gv11b_handle_gpc_gpccs_exception(struct gk20a *g, u32 gpc, | ||
87 | u32 gpc_exception); | ||
88 | void gr_gv11b_enable_gpc_exceptions(struct gk20a *g); | ||
89 | int gr_gv11b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc, | ||
90 | bool *post_event); | ||
91 | int gr_gv11b_zbc_s_query_table(struct gk20a *g, struct gr_gk20a *gr, | ||
92 | struct zbc_query_params *query_params); | ||
93 | bool gr_gv11b_add_zbc_type_s(struct gk20a *g, struct gr_gk20a *gr, | ||
94 | struct zbc_entry *zbc_val, int *ret_val); | ||
95 | int gr_gv11b_add_zbc_stencil(struct gk20a *g, struct gr_gk20a *gr, | ||
96 | struct zbc_entry *stencil_val, u32 index); | ||
97 | int gr_gv11b_load_stencil_default_tbl(struct gk20a *g, | ||
98 | struct gr_gk20a *gr); | ||
99 | int gr_gv11b_load_stencil_tbl(struct gk20a *g, struct gr_gk20a *gr); | ||
100 | u32 gr_gv11b_pagepool_default_size(struct gk20a *g); | ||
101 | int gr_gv11b_calc_global_ctx_buffer_size(struct gk20a *g); | ||
102 | int gr_gv11b_handle_sw_method(struct gk20a *g, u32 addr, | ||
103 | u32 class_num, u32 offset, u32 data); | ||
104 | void gr_gv11b_bundle_cb_defaults(struct gk20a *g); | ||
105 | void gr_gv11b_cb_size_default(struct gk20a *g); | ||
106 | void gr_gv11b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data); | ||
107 | void gr_gv11b_set_circular_buffer_size(struct gk20a *g, u32 data); | ||
108 | int gr_gv11b_dump_gr_status_regs(struct gk20a *g, | ||
109 | struct gk20a_debug_output *o); | ||
110 | int gr_gv11b_wait_empty(struct gk20a *g, unsigned long duration_ms, | ||
111 | u32 expect_delay); | ||
112 | void gr_gv11b_commit_global_attrib_cb(struct gk20a *g, | ||
113 | struct channel_ctx_gk20a *ch_ctx, | ||
114 | u64 addr, bool patch); | ||
115 | void gr_gv11b_init_cyclestats(struct gk20a *g); | ||
116 | void gr_gv11b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index); | ||
117 | void gr_gv11b_get_access_map(struct gk20a *g, | ||
118 | u32 **whitelist, int *num_entries); | ||
119 | int gr_gv11b_pre_process_sm_exception(struct gk20a *g, | ||
120 | u32 gpc, u32 tpc, u32 sm, u32 global_esr, u32 warp_esr, | ||
121 | bool sm_debugger_attached, struct channel_gk20a *fault_ch, | ||
122 | bool *early_exit, bool *ignore_debugger); | ||
123 | int gr_gv11b_handle_fecs_error(struct gk20a *g, | ||
124 | struct channel_gk20a *__ch, | ||
125 | struct gr_gk20a_isr_data *isr_data); | ||
126 | int gr_gv11b_setup_rop_mapping(struct gk20a *g, struct gr_gk20a *gr); | ||
127 | int gr_gv11b_init_sw_veid_bundle(struct gk20a *g); | ||
128 | void gr_gv11b_detect_sm_arch(struct gk20a *g); | ||
129 | void gr_gv11b_init_sm_id_table(struct gk20a *g); | ||
130 | void gr_gv11b_program_sm_id_numbering(struct gk20a *g, | ||
131 | u32 gpc, u32 tpc, u32 smid); | ||
132 | int gr_gv11b_load_smid_config(struct gk20a *g); | ||
133 | int gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va); | ||
134 | int gr_gv11b_commit_global_timeslice(struct gk20a *g, | ||
135 | struct channel_gk20a *c, bool patch); | ||
136 | void gv11b_restore_context_header(struct gk20a *g, | ||
137 | struct nvgpu_mem *ctxheader); | ||
138 | void gr_gv11b_write_zcull_ptr(struct gk20a *g, | ||
139 | struct nvgpu_mem *mem, u64 gpu_va); | ||
140 | void gr_gv11b_write_pm_ptr(struct gk20a *g, | ||
141 | struct nvgpu_mem *mem, u64 gpu_va); | ||
142 | void gr_gv11b_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
143 | void gr_gv11b_load_tpc_mask(struct gk20a *g); | ||
144 | void gr_gv11b_set_preemption_buffer_va(struct gk20a *g, | ||
145 | struct nvgpu_mem *mem, u64 gpu_va); | ||
146 | int gr_gv11b_init_fs_state(struct gk20a *g); | ||
147 | void gv11b_gr_get_esr_sm_sel(struct gk20a *g, u32 gpc, u32 tpc, | ||
148 | u32 *esr_sm_sel); | ||
149 | int gv11b_gr_sm_trigger_suspend(struct gk20a *g); | ||
150 | void gv11b_gr_bpt_reg_info(struct gk20a *g, struct warpstate *w_state); | ||
151 | int gv11b_gr_update_sm_error_state(struct gk20a *g, | ||
152 | struct channel_gk20a *ch, u32 sm_id, | ||
153 | struct nvgpu_dbg_gpu_sm_error_state_record *sm_error_state); | ||
154 | int gv11b_gr_set_sm_debug_mode(struct gk20a *g, | ||
155 | struct channel_gk20a *ch, u64 sms, bool enable); | ||
156 | int gv11b_gr_record_sm_error_state(struct gk20a *g, u32 gpc, u32 tpc); | ||
157 | void gv11b_gr_set_hww_esr_report_mask(struct gk20a *g); | ||
158 | bool gv11b_gr_sm_debugger_attached(struct gk20a *g); | ||
159 | void gv11b_gr_suspend_single_sm(struct gk20a *g, | ||
160 | u32 gpc, u32 tpc, u32 sm, | ||
161 | u32 global_esr_mask, bool check_errors); | ||
162 | void gv11b_gr_suspend_all_sms(struct gk20a *g, | ||
163 | u32 global_esr_mask, bool check_errors); | ||
164 | void gv11b_gr_resume_single_sm(struct gk20a *g, | ||
165 | u32 gpc, u32 tpc, u32 sm); | ||
166 | void gv11b_gr_resume_all_sms(struct gk20a *g); | ||
167 | int gv11b_gr_resume_from_pause(struct gk20a *g); | ||
168 | u32 gv11b_gr_get_sm_hww_warp_esr(struct gk20a *g, | ||
169 | u32 gpc, u32 tpc, u32 sm); | ||
170 | u32 gv11b_gr_get_sm_hww_global_esr(struct gk20a *g, | ||
171 | u32 gpc, u32 tpc, u32 sm); | ||
172 | u32 gv11b_gr_get_sm_no_lock_down_hww_global_esr_mask(struct gk20a *g); | ||
173 | int gv11b_gr_wait_for_sm_lock_down(struct gk20a *g, | ||
174 | u32 gpc, u32 tpc, u32 sm, | ||
175 | u32 global_esr_mask, bool check_errors); | ||
176 | int gv11b_gr_lock_down_sm(struct gk20a *g, | ||
177 | u32 gpc, u32 tpc, u32 sm, u32 global_esr_mask, | ||
178 | bool check_errors); | ||
179 | void gv11b_gr_clear_sm_hww(struct gk20a *g, u32 gpc, u32 tpc, u32 sm, | ||
180 | u32 global_esr); | ||
181 | int gr_gv11b_handle_tpc_mpc_exception(struct gk20a *g, | ||
182 | u32 gpc, u32 tpc, bool *post_event); | ||
183 | void gv11b_gr_init_ovr_sm_dsm_perf(void); | ||
184 | void gv11b_gr_init_sm_dsm_reg_info(void); | ||
185 | void gv11b_gr_get_sm_dsm_perf_regs(struct gk20a *g, | ||
186 | u32 *num_sm_dsm_perf_regs, | ||
187 | u32 **sm_dsm_perf_regs, | ||
188 | u32 *perf_register_stride); | ||
189 | void gv11b_gr_get_sm_dsm_perf_ctrl_regs(struct gk20a *g, | ||
190 | u32 *num_sm_dsm_perf_ctrl_regs, | ||
191 | u32 **sm_dsm_perf_ctrl_regs, | ||
192 | u32 *ctrl_register_stride); | ||
193 | void gv11b_gr_get_ovr_perf_regs(struct gk20a *g, u32 *num_ovr_perf_regs, | ||
194 | u32 **ovr_perf_regs); | ||
195 | void gv11b_gr_access_smpc_reg(struct gk20a *g, u32 quad, u32 offset); | ||
196 | bool gv11b_gr_pri_is_egpc_addr(struct gk20a *g, u32 addr); | ||
197 | bool gv11b_gr_pri_is_etpc_addr(struct gk20a *g, u32 addr); | ||
198 | void gv11b_gr_get_egpc_etpc_num(struct gk20a *g, u32 addr, | ||
199 | u32 *egpc_num, u32 *etpc_num); | ||
200 | int gv11b_gr_decode_egpc_addr(struct gk20a *g, u32 addr, int *addr_type, | ||
201 | u32 *gpc_num, u32 *tpc_num, u32 *broadcast_flags); | ||
202 | void gv11b_gr_egpc_etpc_priv_addr_table(struct gk20a *g, u32 addr, | ||
203 | u32 gpc, u32 broadcast_flags, u32 *priv_addr_table, u32 *t); | ||
204 | u32 gv11b_gr_get_egpc_base(struct gk20a *g); | ||
205 | void gr_gv11b_init_gpc_mmu(struct gk20a *g); | ||
206 | |||
69 | #endif | 207 | #endif |