1
2#ifndef __NVKM_GRCTX_NVC0_H__
3#define __NVKM_GRCTX_NVC0_H__
4#include "gf100.h"
5
6struct gf100_grctx {
7 struct gf100_gr *gr;
8 struct gf100_gr_data *data;
9 struct gf100_gr_mmio *mmio;
10 int buffer_nr;
11 u64 buffer[4];
12 u64 addr;
13};
14
15int gf100_grctx_mmio_data(struct gf100_grctx *, u32 size, u32 align, bool priv);
16void gf100_grctx_mmio_item(struct gf100_grctx *, u32 addr, u32 data, int s, int);
17
18#define mmio_vram(a,b,c,d) gf100_grctx_mmio_data((a), (b), (c), (d))
19#define mmio_refn(a,b,c,d,e) gf100_grctx_mmio_item((a), (b), (c), (d), (e))
20#define mmio_skip(a,b,c) mmio_refn((a), (b), (c), -1, -1)
21#define mmio_wr32(a,b,c) mmio_refn((a), (b), (c), 0, -1)
22
23struct gf100_grctx_func {
24 void (*unkn88c)(struct gf100_gr *, bool on);
25
26 void (*main)(struct gf100_gr *, struct gf100_grctx *);
27
28 void (*unkn)(struct gf100_gr *);
29
30 const struct gf100_gr_pack *hub;
31 const struct gf100_gr_pack *gpc_0;
32 const struct gf100_gr_pack *gpc_1;
33 const struct gf100_gr_pack *zcull;
34 const struct gf100_gr_pack *tpc;
35 const struct gf100_gr_pack *ppc;
36
37 const struct gf100_gr_pack *icmd;
38 const struct gf100_gr_pack *mthd;
39 const struct gf100_gr_pack *sw_veid_bundle_init;
40
41 void (*bundle)(struct gf100_grctx *);
42 u32 bundle_size;
43 u32 bundle_min_gpm_fifo_depth;
44 u32 bundle_token_limit;
45
46 void (*pagepool)(struct gf100_grctx *);
47 u32 pagepool_size;
48
49 void (*attrib)(struct gf100_grctx *);
50 u32 attrib_nr_max;
51 u32 attrib_nr;
52 u32 alpha_nr_max;
53 u32 alpha_nr;
54 u32 gfxp_nr;
55
56 void (*patch_ltc)(struct gf100_grctx *);
57
58 void (*sm_id)(struct gf100_gr *, int gpc, int tpc, int sm);
59 void (*tpc_nr)(struct gf100_gr *, int gpc);
60 void (*r4060a8)(struct gf100_gr *);
61 void (*rop_mapping)(struct gf100_gr *);
62 void (*alpha_beta_tables)(struct gf100_gr *);
63 void (*max_ways_evict)(struct gf100_gr *);
64 void (*dist_skip_table)(struct gf100_gr *);
65 void (*r406500)(struct gf100_gr *);
66 void (*gpc_tpc_nr)(struct gf100_gr *);
67 void (*r419f78)(struct gf100_gr *);
68 void (*tpc_mask)(struct gf100_gr *);
69 void (*smid_config)(struct gf100_gr *);
70
71 void (*r400088)(struct gf100_gr *, bool);
72 void (*r419cb8)(struct gf100_gr *);
73 void (*r418800)(struct gf100_gr *);
74 void (*r419eb0)(struct gf100_gr *);
75 void (*r419e00)(struct gf100_gr *);
76 void (*r418e94)(struct gf100_gr *);
77 void (*r419a3c)(struct gf100_gr *);
78 void (*r408840)(struct gf100_gr *);
79};
80
81extern const struct gf100_grctx_func gf100_grctx;
82int gf100_grctx_generate(struct gf100_gr *);
83void gf100_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
84void gf100_grctx_generate_bundle(struct gf100_grctx *);
85void gf100_grctx_generate_pagepool(struct gf100_grctx *);
86void gf100_grctx_generate_attrib(struct gf100_grctx *);
87void gf100_grctx_generate_unkn(struct gf100_gr *);
88void gf100_grctx_generate_floorsweep(struct gf100_gr *);
89void gf100_grctx_generate_sm_id(struct gf100_gr *, int, int, int);
90void gf100_grctx_generate_tpc_nr(struct gf100_gr *, int);
91void gf100_grctx_generate_r4060a8(struct gf100_gr *);
92void gf100_grctx_generate_rop_mapping(struct gf100_gr *);
93void gf100_grctx_generate_alpha_beta_tables(struct gf100_gr *);
94void gf100_grctx_generate_max_ways_evict(struct gf100_gr *);
95void gf100_grctx_generate_r419cb8(struct gf100_gr *);
96
97extern const struct gf100_grctx_func gf108_grctx;
98void gf108_grctx_generate_attrib(struct gf100_grctx *);
99void gf108_grctx_generate_unkn(struct gf100_gr *);
100
101extern const struct gf100_grctx_func gf104_grctx;
102extern const struct gf100_grctx_func gf110_grctx;
103
104extern const struct gf100_grctx_func gf117_grctx;
105void gf117_grctx_generate_attrib(struct gf100_grctx *);
106void gf117_grctx_generate_rop_mapping(struct gf100_gr *);
107void gf117_grctx_generate_dist_skip_table(struct gf100_gr *);
108
109extern const struct gf100_grctx_func gf119_grctx;
110
111extern const struct gf100_grctx_func gk104_grctx;
112void gk104_grctx_generate_alpha_beta_tables(struct gf100_gr *);
113void gk104_grctx_generate_gpc_tpc_nr(struct gf100_gr *);
114
115extern const struct gf100_grctx_func gk20a_grctx;
116void gk104_grctx_generate_bundle(struct gf100_grctx *);
117void gk104_grctx_generate_pagepool(struct gf100_grctx *);
118void gk104_grctx_generate_patch_ltc(struct gf100_grctx *);
119void gk104_grctx_generate_unkn(struct gf100_gr *);
120void gk104_grctx_generate_r418800(struct gf100_gr *);
121
122extern const struct gf100_grctx_func gk110_grctx;
123void gk110_grctx_generate_r419eb0(struct gf100_gr *);
124
125extern const struct gf100_grctx_func gk110b_grctx;
126extern const struct gf100_grctx_func gk208_grctx;
127
128extern const struct gf100_grctx_func gm107_grctx;
129void gm107_grctx_generate_bundle(struct gf100_grctx *);
130void gm107_grctx_generate_pagepool(struct gf100_grctx *);
131void gm107_grctx_generate_attrib(struct gf100_grctx *);
132void gm107_grctx_generate_sm_id(struct gf100_gr *, int, int, int);
133
134extern const struct gf100_grctx_func gm200_grctx;
135void gm200_grctx_generate_dist_skip_table(struct gf100_gr *);
136void gm200_grctx_generate_r406500(struct gf100_gr *);
137void gm200_grctx_generate_tpc_mask(struct gf100_gr *);
138void gm200_grctx_generate_smid_config(struct gf100_gr *);
139void gm200_grctx_generate_r419a3c(struct gf100_gr *);
140
141extern const struct gf100_grctx_func gm20b_grctx;
142
143extern const struct gf100_grctx_func gp100_grctx;
144void gp100_grctx_generate_pagepool(struct gf100_grctx *);
145void gp100_grctx_generate_smid_config(struct gf100_gr *);
146
147extern const struct gf100_grctx_func gp102_grctx;
148void gp102_grctx_generate_attrib(struct gf100_grctx *);
149
150extern const struct gf100_grctx_func gp104_grctx;
151
152extern const struct gf100_grctx_func gp107_grctx;
153
154extern const struct gf100_grctx_func gv100_grctx;
155
156
157
158extern const struct gf100_gr_pack gf100_grctx_pack_icmd[];
159
160extern const struct gf100_gr_pack gf100_grctx_pack_mthd[];
161extern const struct gf100_gr_init gf100_grctx_init_902d_0[];
162extern const struct gf100_gr_init gf100_grctx_init_9039_0[];
163extern const struct gf100_gr_init gf100_grctx_init_90c0_0[];
164
165extern const struct gf100_gr_pack gf100_grctx_pack_hub[];
166extern const struct gf100_gr_init gf100_grctx_init_main_0[];
167extern const struct gf100_gr_init gf100_grctx_init_fe_0[];
168extern const struct gf100_gr_init gf100_grctx_init_pri_0[];
169extern const struct gf100_gr_init gf100_grctx_init_memfmt_0[];
170extern const struct gf100_gr_init gf100_grctx_init_rstr2d_0[];
171extern const struct gf100_gr_init gf100_grctx_init_scc_0[];
172
173extern const struct gf100_gr_pack gf100_grctx_pack_gpc_0[];
174extern const struct gf100_gr_pack gf100_grctx_pack_gpc_1[];
175extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_0[];
176extern const struct gf100_gr_init gf100_grctx_init_prop_0[];
177extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_1[];
178extern const struct gf100_gr_init gf100_grctx_init_zcull_0[];
179extern const struct gf100_gr_init gf100_grctx_init_crstr_0[];
180extern const struct gf100_gr_init gf100_grctx_init_gpm_0[];
181extern const struct gf100_gr_init gf100_grctx_init_gcc_0[];
182
183extern const struct gf100_gr_pack gf100_grctx_pack_zcull[];
184
185extern const struct gf100_gr_pack gf100_grctx_pack_tpc[];
186extern const struct gf100_gr_init gf100_grctx_init_pe_0[];
187extern const struct gf100_gr_init gf100_grctx_init_wwdx_0[];
188extern const struct gf100_gr_init gf100_grctx_init_mpc_0[];
189extern const struct gf100_gr_init gf100_grctx_init_tpccs_0[];
190
191extern const struct gf100_gr_init gf104_grctx_init_tex_0[];
192extern const struct gf100_gr_init gf104_grctx_init_l1c_0[];
193extern const struct gf100_gr_init gf104_grctx_init_sm_0[];
194
195extern const struct gf100_gr_init gf108_grctx_init_9097_0[];
196
197extern const struct gf100_gr_init gf108_grctx_init_gpm_0[];
198
199extern const struct gf100_gr_init gf108_grctx_init_pe_0[];
200extern const struct gf100_gr_init gf108_grctx_init_wwdx_0[];
201extern const struct gf100_gr_init gf108_grctx_init_tpccs_0[];
202
203extern const struct gf100_gr_init gf110_grctx_init_9197_0[];
204extern const struct gf100_gr_init gf110_grctx_init_9297_0[];
205
206extern const struct gf100_gr_pack gf119_grctx_pack_icmd[];
207
208extern const struct gf100_gr_pack gf119_grctx_pack_mthd[];
209
210extern const struct gf100_gr_init gf119_grctx_init_fe_0[];
211extern const struct gf100_gr_init gf119_grctx_init_be_0[];
212
213extern const struct gf100_gr_init gf119_grctx_init_prop_0[];
214extern const struct gf100_gr_init gf119_grctx_init_gpc_unk_1[];
215extern const struct gf100_gr_init gf119_grctx_init_crstr_0[];
216
217extern const struct gf100_gr_init gf119_grctx_init_sm_0[];
218
219extern const struct gf100_gr_init gf117_grctx_init_pe_0[];
220
221extern const struct gf100_gr_init gf117_grctx_init_wwdx_0[];
222
223extern const struct gf100_gr_pack gf117_grctx_pack_gpc_1[];
224
225extern const struct gf100_gr_init gk104_grctx_init_memfmt_0[];
226extern const struct gf100_gr_init gk104_grctx_init_ds_0[];
227extern const struct gf100_gr_init gk104_grctx_init_scc_0[];
228
229extern const struct gf100_gr_init gk104_grctx_init_gpm_0[];
230
231extern const struct gf100_gr_init gk104_grctx_init_pes_0[];
232
233extern const struct gf100_gr_pack gk104_grctx_pack_hub[];
234extern const struct gf100_gr_pack gk104_grctx_pack_tpc[];
235extern const struct gf100_gr_pack gk104_grctx_pack_ppc[];
236extern const struct gf100_gr_pack gk104_grctx_pack_icmd[];
237extern const struct gf100_gr_init gk104_grctx_init_a097_0[];
238
239extern const struct gf100_gr_pack gk110_grctx_pack_icmd[];
240
241extern const struct gf100_gr_pack gk110_grctx_pack_mthd[];
242
243extern const struct gf100_gr_pack gk110_grctx_pack_hub[];
244extern const struct gf100_gr_init gk110_grctx_init_pri_0[];
245extern const struct gf100_gr_init gk110_grctx_init_cwd_0[];
246
247extern const struct gf100_gr_pack gk110_grctx_pack_gpc_0[];
248extern const struct gf100_gr_pack gk110_grctx_pack_gpc_1[];
249extern const struct gf100_gr_init gk110_grctx_init_gpc_unk_2[];
250
251extern const struct gf100_gr_init gk110_grctx_init_tex_0[];
252extern const struct gf100_gr_init gk110_grctx_init_mpc_0[];
253extern const struct gf100_gr_init gk110_grctx_init_l1c_0[];
254
255extern const struct gf100_gr_pack gk110_grctx_pack_ppc[];
256
257extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[];
258
259extern const struct gf100_gr_init gk208_grctx_init_prop_0[];
260extern const struct gf100_gr_init gk208_grctx_init_crstr_0[];
261
262extern const struct gf100_gr_init gm107_grctx_init_gpc_unk_0[];
263extern const struct gf100_gr_init gm107_grctx_init_wwdx_0[];
264#endif
265