]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
Merge tag 'mac80211-for-davem-2016-06-29-v2' of git://git.kernel.org/pub/scm/linux...
[mirror_ubuntu-focal-kernel.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 {
bfee3f3d 6 struct gf100_gr *gr;
e3c71eb2
BS
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
27f3d6cf 22struct gf100_grctx_func {
e3c71eb2 23 /* main context generation function */
bfee3f3d 24 void (*main)(struct gf100_gr *, struct gf100_grctx *);
e3c71eb2 25 /* context-specific modify-on-first-load list generation function */
bfee3f3d 26 void (*unkn)(struct gf100_gr *);
e3c71eb2
BS
27 /* mmio context data */
28 const struct gf100_gr_pack *hub;
29 const struct gf100_gr_pack *gpc;
30 const struct gf100_gr_pack *zcull;
31 const struct gf100_gr_pack *tpc;
32 const struct gf100_gr_pack *ppc;
33 /* indirect context data, generated with icmds/mthds */
34 const struct gf100_gr_pack *icmd;
35 const struct gf100_gr_pack *mthd;
36 /* bundle circular buffer */
37 void (*bundle)(struct gf100_grctx *);
38 u32 bundle_size;
39 u32 bundle_min_gpm_fifo_depth;
40 u32 bundle_token_limit;
41 /* pagepool */
42 void (*pagepool)(struct gf100_grctx *);
43 u32 pagepool_size;
44 /* attribute(/alpha) circular buffer */
45 void (*attrib)(struct gf100_grctx *);
46 u32 attrib_nr_max;
47 u32 attrib_nr;
48 u32 alpha_nr_max;
49 u32 alpha_nr;
50};
51
27f3d6cf 52extern const struct gf100_grctx_func gf100_grctx;
bfee3f3d
BS
53int gf100_grctx_generate(struct gf100_gr *);
54void gf100_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
e3c71eb2
BS
55void gf100_grctx_generate_bundle(struct gf100_grctx *);
56void gf100_grctx_generate_pagepool(struct gf100_grctx *);
57void gf100_grctx_generate_attrib(struct gf100_grctx *);
bfee3f3d
BS
58void gf100_grctx_generate_unkn(struct gf100_gr *);
59void gf100_grctx_generate_tpcid(struct gf100_gr *);
60void gf100_grctx_generate_r406028(struct gf100_gr *);
61void gf100_grctx_generate_r4060a8(struct gf100_gr *);
62void gf100_grctx_generate_r418bb8(struct gf100_gr *);
63void gf100_grctx_generate_r406800(struct gf100_gr *);
e3c71eb2 64
27f3d6cf 65extern const struct gf100_grctx_func gf108_grctx;
e3c71eb2 66void gf108_grctx_generate_attrib(struct gf100_grctx *);
bfee3f3d 67void gf108_grctx_generate_unkn(struct gf100_gr *);
e3c71eb2 68
27f3d6cf
BS
69extern const struct gf100_grctx_func gf104_grctx;
70extern const struct gf100_grctx_func gf110_grctx;
e3c71eb2 71
27f3d6cf 72extern const struct gf100_grctx_func gf117_grctx;
e3c71eb2
BS
73void gf117_grctx_generate_attrib(struct gf100_grctx *);
74
27f3d6cf 75extern const struct gf100_grctx_func gf119_grctx;
e3c71eb2 76
27f3d6cf
BS
77extern const struct gf100_grctx_func gk104_grctx;
78extern const struct gf100_grctx_func gk20a_grctx;
bfee3f3d 79void gk104_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
e3c71eb2
BS
80void gk104_grctx_generate_bundle(struct gf100_grctx *);
81void gk104_grctx_generate_pagepool(struct gf100_grctx *);
bfee3f3d
BS
82void gk104_grctx_generate_unkn(struct gf100_gr *);
83void gk104_grctx_generate_r418bb8(struct gf100_gr *);
3fed3ea9 84
a032fb9d
AC
85void gm107_grctx_generate_bundle(struct gf100_grctx *);
86void gm107_grctx_generate_pagepool(struct gf100_grctx *);
87void gm107_grctx_generate_attrib(struct gf100_grctx *);
88
27f3d6cf
BS
89extern const struct gf100_grctx_func gk110_grctx;
90extern const struct gf100_grctx_func gk110b_grctx;
91extern const struct gf100_grctx_func gk208_grctx;
3fed3ea9 92
27f3d6cf 93extern const struct gf100_grctx_func gm107_grctx;
3fed3ea9
BS
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
9ec28052 98extern const struct gf100_grctx_func gm200_grctx;
9ec28052
BS
99void gm200_grctx_generate_tpcid(struct gf100_gr *);
100void gm200_grctx_generate_405b60(struct gf100_gr *);
426b20e4 101
27f3d6cf 102extern const struct gf100_grctx_func gm20b_grctx;
e3c71eb2
BS
103
104/* context init value lists */
105
106extern const struct gf100_gr_pack gf100_grctx_pack_icmd[];
107
108extern const struct gf100_gr_pack gf100_grctx_pack_mthd[];
109extern const struct gf100_gr_init gf100_grctx_init_902d_0[];
110extern const struct gf100_gr_init gf100_grctx_init_9039_0[];
111extern const struct gf100_gr_init gf100_grctx_init_90c0_0[];
112
113extern const struct gf100_gr_pack gf100_grctx_pack_hub[];
114extern const struct gf100_gr_init gf100_grctx_init_main_0[];
115extern const struct gf100_gr_init gf100_grctx_init_fe_0[];
116extern const struct gf100_gr_init gf100_grctx_init_pri_0[];
117extern const struct gf100_gr_init gf100_grctx_init_memfmt_0[];
118extern const struct gf100_gr_init gf100_grctx_init_rstr2d_0[];
119extern const struct gf100_gr_init gf100_grctx_init_scc_0[];
120
121extern const struct gf100_gr_pack gf100_grctx_pack_gpc[];
122extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_0[];
123extern const struct gf100_gr_init gf100_grctx_init_prop_0[];
124extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_1[];
125extern const struct gf100_gr_init gf100_grctx_init_zcull_0[];
126extern const struct gf100_gr_init gf100_grctx_init_crstr_0[];
127extern const struct gf100_gr_init gf100_grctx_init_gpm_0[];
128extern const struct gf100_gr_init gf100_grctx_init_gcc_0[];
129
130extern const struct gf100_gr_pack gf100_grctx_pack_zcull[];
131
132extern const struct gf100_gr_pack gf100_grctx_pack_tpc[];
133extern const struct gf100_gr_init gf100_grctx_init_pe_0[];
134extern const struct gf100_gr_init gf100_grctx_init_wwdx_0[];
135extern const struct gf100_gr_init gf100_grctx_init_mpc_0[];
136extern const struct gf100_gr_init gf100_grctx_init_tpccs_0[];
137
138extern const struct gf100_gr_init gf104_grctx_init_tex_0[];
139extern const struct gf100_gr_init gf104_grctx_init_l1c_0[];
140extern const struct gf100_gr_init gf104_grctx_init_sm_0[];
141
142extern const struct gf100_gr_init gf108_grctx_init_9097_0[];
143
144extern const struct gf100_gr_init gf108_grctx_init_gpm_0[];
145
146extern const struct gf100_gr_init gf108_grctx_init_pe_0[];
147extern const struct gf100_gr_init gf108_grctx_init_wwdx_0[];
148extern const struct gf100_gr_init gf108_grctx_init_tpccs_0[];
149
150extern const struct gf100_gr_init gf110_grctx_init_9197_0[];
151extern const struct gf100_gr_init gf110_grctx_init_9297_0[];
152
153extern const struct gf100_gr_pack gf119_grctx_pack_icmd[];
154
155extern const struct gf100_gr_pack gf119_grctx_pack_mthd[];
156
157extern const struct gf100_gr_init gf119_grctx_init_fe_0[];
158extern const struct gf100_gr_init gf119_grctx_init_be_0[];
159
160extern const struct gf100_gr_init gf119_grctx_init_prop_0[];
161extern const struct gf100_gr_init gf119_grctx_init_gpc_unk_1[];
162extern const struct gf100_gr_init gf119_grctx_init_crstr_0[];
163
164extern const struct gf100_gr_init gf119_grctx_init_sm_0[];
165
166extern const struct gf100_gr_init gf117_grctx_init_pe_0[];
167
168extern const struct gf100_gr_init gf117_grctx_init_wwdx_0[];
169
170extern const struct gf100_gr_init gk104_grctx_init_memfmt_0[];
171extern const struct gf100_gr_init gk104_grctx_init_ds_0[];
172extern const struct gf100_gr_init gk104_grctx_init_scc_0[];
173
174extern const struct gf100_gr_init gk104_grctx_init_gpm_0[];
175
176extern const struct gf100_gr_init gk104_grctx_init_pes_0[];
177
178extern const struct gf100_gr_pack gk104_grctx_pack_hub[];
179extern const struct gf100_gr_pack gk104_grctx_pack_gpc[];
180extern const struct gf100_gr_pack gk104_grctx_pack_tpc[];
181extern const struct gf100_gr_pack gk104_grctx_pack_ppc[];
182extern const struct gf100_gr_pack gk104_grctx_pack_icmd[];
183extern const struct gf100_gr_init gk104_grctx_init_a097_0[];
184
185extern const struct gf100_gr_pack gk110_grctx_pack_icmd[];
186
187extern const struct gf100_gr_pack gk110_grctx_pack_mthd[];
188
189extern const struct gf100_gr_pack gk110_grctx_pack_hub[];
190extern const struct gf100_gr_init gk110_grctx_init_pri_0[];
191extern const struct gf100_gr_init gk110_grctx_init_cwd_0[];
192
193extern const struct gf100_gr_pack gk110_grctx_pack_gpc[];
194extern const struct gf100_gr_init gk110_grctx_init_gpc_unk_2[];
195
196extern const struct gf100_gr_init gk110_grctx_init_tex_0[];
197extern const struct gf100_gr_init gk110_grctx_init_mpc_0[];
198extern const struct gf100_gr_init gk110_grctx_init_l1c_0[];
199
200extern const struct gf100_gr_pack gk110_grctx_pack_ppc[];
201
202extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[];
203
204extern const struct gf100_gr_init gk208_grctx_init_prop_0[];
205extern const struct gf100_gr_init gk208_grctx_init_crstr_0[];
3fed3ea9
BS
206
207extern const struct gf100_gr_init gm107_grctx_init_gpc_unk_0[];
208extern const struct gf100_gr_init gm107_grctx_init_wwdx_0[];
e3c71eb2 209#endif