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/gp10b/gr_gp10b.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/gp10b/gr_gp10b.h')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.h | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h index ac53e231..ce1ca01f 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h | |||
@@ -20,6 +20,10 @@ | |||
20 | 20 | ||
21 | struct gk20a; | 21 | struct gk20a; |
22 | struct gr_gk20a_isr_data; | 22 | struct gr_gk20a_isr_data; |
23 | struct channel_ctx_gk20a; | ||
24 | struct zbc_entry; | ||
25 | struct gr_ctx_desc; | ||
26 | struct nvgpu_preemption_modes_rec; | ||
23 | 27 | ||
24 | enum { | 28 | enum { |
25 | PASCAL_CHANNEL_GPFIFO_A = 0xC06F, | 29 | PASCAL_CHANNEL_GPFIFO_A = 0xC06F, |
@@ -39,7 +43,6 @@ enum { | |||
39 | #define NVC0C0_SET_SHADER_EXCEPTIONS 0x1528 | 43 | #define NVC0C0_SET_SHADER_EXCEPTIONS 0x1528 |
40 | #define NVC0C0_SET_RD_COALESCE 0x0228 | 44 | #define NVC0C0_SET_RD_COALESCE 0x0228 |
41 | 45 | ||
42 | void gp10b_init_gr(struct gk20a *g); | ||
43 | int gr_gp10b_init_fs_state(struct gk20a *g); | 46 | int gr_gp10b_init_fs_state(struct gk20a *g); |
44 | int gr_gp10b_alloc_buffer(struct vm_gk20a *vm, size_t size, | 47 | int gr_gp10b_alloc_buffer(struct vm_gk20a *vm, size_t size, |
45 | struct nvgpu_mem *mem); | 48 | struct nvgpu_mem *mem); |
@@ -50,6 +53,87 @@ int gr_gp10b_handle_fecs_error(struct gk20a *g, | |||
50 | int gr_gp10b_set_cilp_preempt_pending(struct gk20a *g, | 53 | int gr_gp10b_set_cilp_preempt_pending(struct gk20a *g, |
51 | struct channel_gk20a *fault_ch); | 54 | struct channel_gk20a *fault_ch); |
52 | 55 | ||
56 | bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num); | ||
57 | bool gr_gp10b_is_valid_gfx_class(struct gk20a *g, u32 class_num); | ||
58 | bool gr_gp10b_is_valid_compute_class(struct gk20a *g, u32 class_num); | ||
59 | int gr_gp10b_handle_sm_exception(struct gk20a *g, | ||
60 | u32 gpc, u32 tpc, u32 sm, | ||
61 | bool *post_event, struct channel_gk20a *fault_ch, | ||
62 | u32 *hww_global_esr); | ||
63 | int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc, | ||
64 | bool *post_event); | ||
65 | int gr_gp10b_commit_global_cb_manager(struct gk20a *g, | ||
66 | struct channel_gk20a *c, bool patch); | ||
67 | void gr_gp10b_commit_global_pagepool(struct gk20a *g, | ||
68 | struct channel_ctx_gk20a *ch_ctx, | ||
69 | u64 addr, u32 size, bool patch); | ||
70 | int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr, | ||
71 | struct zbc_entry *color_val, u32 index); | ||
72 | int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr, | ||
73 | struct zbc_entry *depth_val, u32 index); | ||
74 | u32 gr_gp10b_pagepool_default_size(struct gk20a *g); | ||
75 | int gr_gp10b_calc_global_ctx_buffer_size(struct gk20a *g); | ||
76 | void gr_gp10b_set_bes_crop_debug3(struct gk20a *g, u32 data); | ||
77 | int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, | ||
78 | u32 class_num, u32 offset, u32 data); | ||
79 | void gr_gp10b_cb_size_default(struct gk20a *g); | ||
80 | void gr_gp10b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data); | ||
81 | void gr_gp10b_set_circular_buffer_size(struct gk20a *g, u32 data); | ||
82 | int gr_gp10b_init_ctx_state(struct gk20a *g); | ||
83 | int gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, | ||
84 | struct gr_ctx_desc *gr_ctx, | ||
85 | struct vm_gk20a *vm, u32 class, | ||
86 | u32 graphics_preempt_mode, | ||
87 | u32 compute_preempt_mode); | ||
88 | int gr_gp10b_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_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, | ||
93 | struct gr_ctx_desc *gr_ctx); | ||
94 | void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g, | ||
95 | struct channel_ctx_gk20a *ch_ctx, | ||
96 | struct nvgpu_mem *mem); | ||
97 | int gr_gp10b_dump_gr_status_regs(struct gk20a *g, | ||
98 | struct gk20a_debug_output *o); | ||
99 | int gr_gp10b_wait_empty(struct gk20a *g, unsigned long duration_ms, | ||
100 | u32 expect_delay); | ||
101 | void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, | ||
102 | struct channel_ctx_gk20a *ch_ctx, | ||
103 | u64 addr, bool patch); | ||
104 | void gr_gp10b_commit_global_bundle_cb(struct gk20a *g, | ||
105 | struct channel_ctx_gk20a *ch_ctx, | ||
106 | u64 addr, u64 size, bool patch); | ||
107 | int gr_gp10b_load_smid_config(struct gk20a *g); | ||
108 | void gr_gp10b_init_cyclestats(struct gk20a *g); | ||
109 | void gr_gp10b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index); | ||
110 | void gr_gp10b_get_access_map(struct gk20a *g, | ||
111 | u32 **whitelist, int *num_entries); | ||
112 | int gr_gp10b_pre_process_sm_exception(struct gk20a *g, | ||
113 | u32 gpc, u32 tpc, u32 sm, u32 global_esr, u32 warp_esr, | ||
114 | bool sm_debugger_attached, struct channel_gk20a *fault_ch, | ||
115 | bool *early_exit, bool *ignore_debugger); | ||
116 | u32 gp10b_gr_get_sm_hww_warp_esr(struct gk20a *g, | ||
117 | u32 gpc, u32 tpc, u32 sm); | ||
118 | u32 get_ecc_override_val(struct gk20a *g); | ||
119 | int gr_gp10b_suspend_contexts(struct gk20a *g, | ||
120 | struct dbg_session_gk20a *dbg_s, | ||
121 | int *ctx_resident_ch_fd); | ||
122 | int gr_gp10b_set_boosted_ctx(struct channel_gk20a *ch, | ||
123 | bool boost); | ||
124 | void gr_gp10b_update_boosted_ctx(struct gk20a *g, struct nvgpu_mem *mem, | ||
125 | struct gr_ctx_desc *gr_ctx); | ||
126 | int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, | ||
127 | u32 graphics_preempt_mode, | ||
128 | u32 compute_preempt_mode); | ||
129 | int gr_gp10b_get_preemption_mode_flags(struct gk20a *g, | ||
130 | struct nvgpu_preemption_modes_rec *preemption_modes_rec); | ||
131 | int gp10b_gr_fuse_override(struct gk20a *g); | ||
132 | int gr_gp10b_init_preemption_state(struct gk20a *g); | ||
133 | void gr_gp10b_set_preemption_buffer_va(struct gk20a *g, | ||
134 | struct nvgpu_mem *mem, u64 gpu_va); | ||
135 | int gr_gp10b_set_czf_bypass(struct gk20a *g, struct channel_gk20a *ch); | ||
136 | |||
53 | struct gr_t18x { | 137 | struct gr_t18x { |
54 | struct { | 138 | struct { |
55 | u32 preempt_image_size; | 139 | u32 preempt_image_size; |