drm/nouveau/gr: add GM20B support
[deliverable/linux.git] / drivers / gpu / drm / nouveau / nvkm / engine / gr / ctxgf100.h
CommitLineData
e3c71eb2
BS
1#ifndef __NVKM_GRCTX_NVC0_H__
2#define __NVKM_GRCTX_NVC0_H__
3#include "gf100.h"
4
5struct gf100_grctx {
6 struct gf100_gr_priv *priv;
7 struct gf100_gr_data *data;
8 struct gf100_gr_mmio *mmio;
9 int buffer_nr;
10 u64 buffer[4];
11 u64 addr;
12};
13
14int gf100_grctx_mmio_data(struct gf100_grctx *, u32 size, u32 align, u32 access);
15void gf100_grctx_mmio_item(struct gf100_grctx *, u32 addr, u32 data, int s, int);
16
17#define mmio_vram(a,b,c,d) gf100_grctx_mmio_data((a), (b), (c), (d))
18#define mmio_refn(a,b,c,d,e) gf100_grctx_mmio_item((a), (b), (c), (d), (e))
19#define mmio_skip(a,b,c) mmio_refn((a), (b), (c), -1, -1)
20#define mmio_wr32(a,b,c) mmio_refn((a), (b), (c), 0, -1)
21
22struct gf100_grctx_oclass {
23 struct nvkm_oclass base;
24 /* main context generation function */
25 void (*main)(struct gf100_gr_priv *, struct gf100_grctx *);
26 /* context-specific modify-on-first-load list generation function */
27 void (*unkn)(struct gf100_gr_priv *);
28 /* mmio context data */
29 const struct gf100_gr_pack *hub;
30 const struct gf100_gr_pack *gpc;
31 const struct gf100_gr_pack *zcull;
32 const struct gf100_gr_pack *tpc;
33 const struct gf100_gr_pack *ppc;
34 /* indirect context data, generated with icmds/mthds */
35 const struct gf100_gr_pack *icmd;
36 const struct gf100_gr_pack *mthd;
37 /* bundle circular buffer */
38 void (*bundle)(struct gf100_grctx *);
39 u32 bundle_size;
40 u32 bundle_min_gpm_fifo_depth;
41 u32 bundle_token_limit;
42 /* pagepool */
43 void (*pagepool)(struct gf100_grctx *);
44 u32 pagepool_size;
45 /* attribute(/alpha) circular buffer */
46 void (*attrib)(struct gf100_grctx *);
47 u32 attrib_nr_max;
48 u32 attrib_nr;
49 u32 alpha_nr_max;
50 u32 alpha_nr;
51};
52
53static inline const struct gf100_grctx_oclass *
54gf100_grctx_impl(struct gf100_gr_priv *priv)
55{
56 return (void *)nv_engine(priv)->cclass;
57}
58
59extern struct nvkm_oclass *gf100_grctx_oclass;
60int gf100_grctx_generate(struct gf100_gr_priv *);
61void gf100_grctx_generate_main(struct gf100_gr_priv *, struct gf100_grctx *);
62void gf100_grctx_generate_bundle(struct gf100_grctx *);
63void gf100_grctx_generate_pagepool(struct gf100_grctx *);
64void gf100_grctx_generate_attrib(struct gf100_grctx *);
65void gf100_grctx_generate_unkn(struct gf100_gr_priv *);
66void gf100_grctx_generate_tpcid(struct gf100_gr_priv *);
67void gf100_grctx_generate_r406028(struct gf100_gr_priv *);
68void gf100_grctx_generate_r4060a8(struct gf100_gr_priv *);
69void gf100_grctx_generate_r418bb8(struct gf100_gr_priv *);
70void gf100_grctx_generate_r406800(struct gf100_gr_priv *);
71
72extern struct nvkm_oclass *gf108_grctx_oclass;
73void gf108_grctx_generate_attrib(struct gf100_grctx *);
74void gf108_grctx_generate_unkn(struct gf100_gr_priv *);
75
76extern struct nvkm_oclass *gf104_grctx_oclass;
77extern struct nvkm_oclass *gf110_grctx_oclass;
78
79extern struct nvkm_oclass *gf117_grctx_oclass;
80void gf117_grctx_generate_attrib(struct gf100_grctx *);
81
82extern struct nvkm_oclass *gf119_grctx_oclass;
83
84extern struct nvkm_oclass *gk104_grctx_oclass;
85extern struct nvkm_oclass *gk20a_grctx_oclass;
86void gk104_grctx_generate_main(struct gf100_gr_priv *, struct gf100_grctx *);
87void gk104_grctx_generate_bundle(struct gf100_grctx *);
88void gk104_grctx_generate_pagepool(struct gf100_grctx *);
89void gk104_grctx_generate_unkn(struct gf100_gr_priv *);
90void gk104_grctx_generate_r418bb8(struct gf100_gr_priv *);
6eb70826 91void gk104_grctx_generate_rop_active_fbps(struct gf100_gr_priv *);
e3c71eb2 92
3fed3ea9 93
a032fb9d
AC
94void gm107_grctx_generate_bundle(struct gf100_grctx *);
95void gm107_grctx_generate_pagepool(struct gf100_grctx *);
96void gm107_grctx_generate_attrib(struct gf100_grctx *);
97
e3c71eb2
BS
98extern struct nvkm_oclass *gk110_grctx_oclass;
99extern struct nvkm_oclass *gk110b_grctx_oclass;
100extern struct nvkm_oclass *gk208_grctx_oclass;
3fed3ea9 101
e3c71eb2 102extern struct nvkm_oclass *gm107_grctx_oclass;
3fed3ea9
BS
103void gm107_grctx_generate_bundle(struct gf100_grctx *);
104void gm107_grctx_generate_pagepool(struct gf100_grctx *);
105void gm107_grctx_generate_attrib(struct gf100_grctx *);
106
107extern struct nvkm_oclass *gm204_grctx_oclass;
426b20e4 108void gm204_grctx_generate_main(struct gf100_gr_priv *, struct gf100_grctx *);
a032fb9d
AC
109void gm204_grctx_generate_tpcid(struct gf100_gr_priv *);
110void gm204_grctx_generate_405b60(struct gf100_gr_priv *);
426b20e4
BS
111
112extern struct nvkm_oclass *gm206_grctx_oclass;
a032fb9d 113extern struct nvkm_oclass *gm20b_grctx_oclass;
e3c71eb2
BS
114
115/* context init value lists */
116
117extern const struct gf100_gr_pack gf100_grctx_pack_icmd[];
118
119extern const struct gf100_gr_pack gf100_grctx_pack_mthd[];
120extern const struct gf100_gr_init gf100_grctx_init_902d_0[];
121extern const struct gf100_gr_init gf100_grctx_init_9039_0[];
122extern const struct gf100_gr_init gf100_grctx_init_90c0_0[];
123
124extern const struct gf100_gr_pack gf100_grctx_pack_hub[];
125extern const struct gf100_gr_init gf100_grctx_init_main_0[];
126extern const struct gf100_gr_init gf100_grctx_init_fe_0[];
127extern const struct gf100_gr_init gf100_grctx_init_pri_0[];
128extern const struct gf100_gr_init gf100_grctx_init_memfmt_0[];
129extern const struct gf100_gr_init gf100_grctx_init_rstr2d_0[];
130extern const struct gf100_gr_init gf100_grctx_init_scc_0[];
131
132extern const struct gf100_gr_pack gf100_grctx_pack_gpc[];
133extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_0[];
134extern const struct gf100_gr_init gf100_grctx_init_prop_0[];
135extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_1[];
136extern const struct gf100_gr_init gf100_grctx_init_zcull_0[];
137extern const struct gf100_gr_init gf100_grctx_init_crstr_0[];
138extern const struct gf100_gr_init gf100_grctx_init_gpm_0[];
139extern const struct gf100_gr_init gf100_grctx_init_gcc_0[];
140
141extern const struct gf100_gr_pack gf100_grctx_pack_zcull[];
142
143extern const struct gf100_gr_pack gf100_grctx_pack_tpc[];
144extern const struct gf100_gr_init gf100_grctx_init_pe_0[];
145extern const struct gf100_gr_init gf100_grctx_init_wwdx_0[];
146extern const struct gf100_gr_init gf100_grctx_init_mpc_0[];
147extern const struct gf100_gr_init gf100_grctx_init_tpccs_0[];
148
149extern const struct gf100_gr_init gf104_grctx_init_tex_0[];
150extern const struct gf100_gr_init gf104_grctx_init_l1c_0[];
151extern const struct gf100_gr_init gf104_grctx_init_sm_0[];
152
153extern const struct gf100_gr_init gf108_grctx_init_9097_0[];
154
155extern const struct gf100_gr_init gf108_grctx_init_gpm_0[];
156
157extern const struct gf100_gr_init gf108_grctx_init_pe_0[];
158extern const struct gf100_gr_init gf108_grctx_init_wwdx_0[];
159extern const struct gf100_gr_init gf108_grctx_init_tpccs_0[];
160
161extern const struct gf100_gr_init gf110_grctx_init_9197_0[];
162extern const struct gf100_gr_init gf110_grctx_init_9297_0[];
163
164extern const struct gf100_gr_pack gf119_grctx_pack_icmd[];
165
166extern const struct gf100_gr_pack gf119_grctx_pack_mthd[];
167
168extern const struct gf100_gr_init gf119_grctx_init_fe_0[];
169extern const struct gf100_gr_init gf119_grctx_init_be_0[];
170
171extern const struct gf100_gr_init gf119_grctx_init_prop_0[];
172extern const struct gf100_gr_init gf119_grctx_init_gpc_unk_1[];
173extern const struct gf100_gr_init gf119_grctx_init_crstr_0[];
174
175extern const struct gf100_gr_init gf119_grctx_init_sm_0[];
176
177extern const struct gf100_gr_init gf117_grctx_init_pe_0[];
178
179extern const struct gf100_gr_init gf117_grctx_init_wwdx_0[];
180
181extern const struct gf100_gr_init gk104_grctx_init_memfmt_0[];
182extern const struct gf100_gr_init gk104_grctx_init_ds_0[];
183extern const struct gf100_gr_init gk104_grctx_init_scc_0[];
184
185extern const struct gf100_gr_init gk104_grctx_init_gpm_0[];
186
187extern const struct gf100_gr_init gk104_grctx_init_pes_0[];
188
189extern const struct gf100_gr_pack gk104_grctx_pack_hub[];
190extern const struct gf100_gr_pack gk104_grctx_pack_gpc[];
191extern const struct gf100_gr_pack gk104_grctx_pack_tpc[];
192extern const struct gf100_gr_pack gk104_grctx_pack_ppc[];
193extern const struct gf100_gr_pack gk104_grctx_pack_icmd[];
194extern const struct gf100_gr_init gk104_grctx_init_a097_0[];
195
196extern const struct gf100_gr_pack gk110_grctx_pack_icmd[];
197
198extern const struct gf100_gr_pack gk110_grctx_pack_mthd[];
199
200extern const struct gf100_gr_pack gk110_grctx_pack_hub[];
201extern const struct gf100_gr_init gk110_grctx_init_pri_0[];
202extern const struct gf100_gr_init gk110_grctx_init_cwd_0[];
203
204extern const struct gf100_gr_pack gk110_grctx_pack_gpc[];
205extern const struct gf100_gr_init gk110_grctx_init_gpc_unk_2[];
206
207extern const struct gf100_gr_init gk110_grctx_init_tex_0[];
208extern const struct gf100_gr_init gk110_grctx_init_mpc_0[];
209extern const struct gf100_gr_init gk110_grctx_init_l1c_0[];
210
211extern const struct gf100_gr_pack gk110_grctx_pack_ppc[];
212
213extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[];
214
215extern const struct gf100_gr_init gk208_grctx_init_prop_0[];
216extern const struct gf100_gr_init gk208_grctx_init_crstr_0[];
3fed3ea9
BS
217
218extern const struct gf100_gr_init gm107_grctx_init_gpc_unk_0[];
219extern const struct gf100_gr_init gm107_grctx_init_wwdx_0[];
426b20e4
BS
220
221extern const struct gf100_gr_pack gm204_grctx_pack_icmd[];
222
223extern const struct gf100_gr_pack gm204_grctx_pack_mthd[];
224
225extern const struct gf100_gr_pack gm204_grctx_pack_hub[];
226
227extern const struct gf100_gr_init gm204_grctx_init_prop_0[];
228extern const struct gf100_gr_init gm204_grctx_init_setup_0[];
229extern const struct gf100_gr_init gm204_grctx_init_gpm_0[];
230extern const struct gf100_gr_init gm204_grctx_init_gpc_unk_2[];
231
232extern const struct gf100_gr_pack gm204_grctx_pack_tpc[];
233
234extern const struct gf100_gr_pack gm204_grctx_pack_ppc[];
e3c71eb2 235#endif
This page took 0.081698 seconds and 5 git commands to generate.