1 #ifndef __NVKM_GRCTX_NVC0_H__
2 #define __NVKM_GRCTX_NVC0_H__
7 struct nvc0_gr_priv *priv;
8 struct nvc0_gr_data *data;
9 struct nvc0_gr_mmio *mmio;
15 int nvc0_grctx_mmio_data(struct nvc0_grctx *, u32 size, u32 align, u32 access);
16 void nvc0_grctx_mmio_item(struct nvc0_grctx *, u32 addr, u32 data, int s, int);
18 #define mmio_vram(a,b,c,d) nvc0_grctx_mmio_data((a), (b), (c), (d))
19 #define mmio_refn(a,b,c,d,e) nvc0_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)
23 struct nvc0_grctx_oclass {
24 struct nouveau_oclass base;
25 /* main context generation function */
26 void (*main)(struct nvc0_gr_priv *, struct nvc0_grctx *);
27 /* context-specific modify-on-first-load list generation function */
28 void (*unkn)(struct nvc0_gr_priv *);
29 /* mmio context data */
30 const struct nvc0_gr_pack *hub;
31 const struct nvc0_gr_pack *gpc;
32 const struct nvc0_gr_pack *zcull;
33 const struct nvc0_gr_pack *tpc;
34 const struct nvc0_gr_pack *ppc;
35 /* indirect context data, generated with icmds/mthds */
36 const struct nvc0_gr_pack *icmd;
37 const struct nvc0_gr_pack *mthd;
38 /* bundle circular buffer */
39 void (*bundle)(struct nvc0_grctx *);
41 u32 bundle_min_gpm_fifo_depth;
42 u32 bundle_token_limit;
44 void (*pagepool)(struct nvc0_grctx *);
46 /* attribute(/alpha) circular buffer */
47 void (*attrib)(struct nvc0_grctx *);
54 static inline const struct nvc0_grctx_oclass *
55 nvc0_grctx_impl(struct nvc0_gr_priv *priv)
57 return (void *)nv_engine(priv)->cclass;
60 extern struct nouveau_oclass *nvc0_grctx_oclass;
61 int nvc0_grctx_generate(struct nvc0_gr_priv *);
62 void nvc0_grctx_generate_main(struct nvc0_gr_priv *, struct nvc0_grctx *);
63 void nvc0_grctx_generate_bundle(struct nvc0_grctx *);
64 void nvc0_grctx_generate_pagepool(struct nvc0_grctx *);
65 void nvc0_grctx_generate_attrib(struct nvc0_grctx *);
66 void nvc0_grctx_generate_unkn(struct nvc0_gr_priv *);
67 void nvc0_grctx_generate_tpcid(struct nvc0_gr_priv *);
68 void nvc0_grctx_generate_r406028(struct nvc0_gr_priv *);
69 void nvc0_grctx_generate_r4060a8(struct nvc0_gr_priv *);
70 void nvc0_grctx_generate_r418bb8(struct nvc0_gr_priv *);
71 void nvc0_grctx_generate_r406800(struct nvc0_gr_priv *);
73 extern struct nouveau_oclass *nvc1_grctx_oclass;
74 void nvc1_grctx_generate_attrib(struct nvc0_grctx *);
75 void nvc1_grctx_generate_unkn(struct nvc0_gr_priv *);
77 extern struct nouveau_oclass *nvc4_grctx_oclass;
78 extern struct nouveau_oclass *nvc8_grctx_oclass;
80 extern struct nouveau_oclass *nvd7_grctx_oclass;
81 void nvd7_grctx_generate_attrib(struct nvc0_grctx *);
83 extern struct nouveau_oclass *nvd9_grctx_oclass;
85 extern struct nouveau_oclass *nve4_grctx_oclass;
86 extern struct nouveau_oclass *gk20a_grctx_oclass;
87 void nve4_grctx_generate_main(struct nvc0_gr_priv *, struct nvc0_grctx *);
88 void nve4_grctx_generate_bundle(struct nvc0_grctx *);
89 void nve4_grctx_generate_pagepool(struct nvc0_grctx *);
90 void nve4_grctx_generate_unkn(struct nvc0_gr_priv *);
91 void nve4_grctx_generate_r418bb8(struct nvc0_gr_priv *);
93 extern struct nouveau_oclass *nvf0_grctx_oclass;
94 extern struct nouveau_oclass *gk110b_grctx_oclass;
95 extern struct nouveau_oclass *nv108_grctx_oclass;
96 extern struct nouveau_oclass *gm107_grctx_oclass;
98 /* context init value lists */
100 extern const struct nvc0_gr_pack nvc0_grctx_pack_icmd[];
102 extern const struct nvc0_gr_pack nvc0_grctx_pack_mthd[];
103 extern const struct nvc0_gr_init nvc0_grctx_init_902d_0[];
104 extern const struct nvc0_gr_init nvc0_grctx_init_9039_0[];
105 extern const struct nvc0_gr_init nvc0_grctx_init_90c0_0[];
107 extern const struct nvc0_gr_pack nvc0_grctx_pack_hub[];
108 extern const struct nvc0_gr_init nvc0_grctx_init_main_0[];
109 extern const struct nvc0_gr_init nvc0_grctx_init_fe_0[];
110 extern const struct nvc0_gr_init nvc0_grctx_init_pri_0[];
111 extern const struct nvc0_gr_init nvc0_grctx_init_memfmt_0[];
112 extern const struct nvc0_gr_init nvc0_grctx_init_rstr2d_0[];
113 extern const struct nvc0_gr_init nvc0_grctx_init_scc_0[];
115 extern const struct nvc0_gr_pack nvc0_grctx_pack_gpc[];
116 extern const struct nvc0_gr_init nvc0_grctx_init_gpc_unk_0[];
117 extern const struct nvc0_gr_init nvc0_grctx_init_prop_0[];
118 extern const struct nvc0_gr_init nvc0_grctx_init_gpc_unk_1[];
119 extern const struct nvc0_gr_init nvc0_grctx_init_zcull_0[];
120 extern const struct nvc0_gr_init nvc0_grctx_init_crstr_0[];
121 extern const struct nvc0_gr_init nvc0_grctx_init_gpm_0[];
122 extern const struct nvc0_gr_init nvc0_grctx_init_gcc_0[];
124 extern const struct nvc0_gr_pack nvc0_grctx_pack_zcull[];
126 extern const struct nvc0_gr_pack nvc0_grctx_pack_tpc[];
127 extern const struct nvc0_gr_init nvc0_grctx_init_pe_0[];
128 extern const struct nvc0_gr_init nvc0_grctx_init_wwdx_0[];
129 extern const struct nvc0_gr_init nvc0_grctx_init_mpc_0[];
130 extern const struct nvc0_gr_init nvc0_grctx_init_tpccs_0[];
132 extern const struct nvc0_gr_init nvc4_grctx_init_tex_0[];
133 extern const struct nvc0_gr_init nvc4_grctx_init_l1c_0[];
134 extern const struct nvc0_gr_init nvc4_grctx_init_sm_0[];
136 extern const struct nvc0_gr_init nvc1_grctx_init_9097_0[];
138 extern const struct nvc0_gr_init nvc1_grctx_init_gpm_0[];
140 extern const struct nvc0_gr_init nvc1_grctx_init_pe_0[];
141 extern const struct nvc0_gr_init nvc1_grctx_init_wwdx_0[];
142 extern const struct nvc0_gr_init nvc1_grctx_init_tpccs_0[];
144 extern const struct nvc0_gr_init nvc8_grctx_init_9197_0[];
145 extern const struct nvc0_gr_init nvc8_grctx_init_9297_0[];
147 extern const struct nvc0_gr_pack nvd9_grctx_pack_icmd[];
149 extern const struct nvc0_gr_pack nvd9_grctx_pack_mthd[];
151 extern const struct nvc0_gr_init nvd9_grctx_init_fe_0[];
152 extern const struct nvc0_gr_init nvd9_grctx_init_be_0[];
154 extern const struct nvc0_gr_init nvd9_grctx_init_prop_0[];
155 extern const struct nvc0_gr_init nvd9_grctx_init_gpc_unk_1[];
156 extern const struct nvc0_gr_init nvd9_grctx_init_crstr_0[];
158 extern const struct nvc0_gr_init nvd9_grctx_init_sm_0[];
160 extern const struct nvc0_gr_init nvd7_grctx_init_pe_0[];
162 extern const struct nvc0_gr_init nvd7_grctx_init_wwdx_0[];
164 extern const struct nvc0_gr_init nve4_grctx_init_memfmt_0[];
165 extern const struct nvc0_gr_init nve4_grctx_init_ds_0[];
166 extern const struct nvc0_gr_init nve4_grctx_init_scc_0[];
168 extern const struct nvc0_gr_init nve4_grctx_init_gpm_0[];
170 extern const struct nvc0_gr_init nve4_grctx_init_pes_0[];
172 extern const struct nvc0_gr_pack nve4_grctx_pack_hub[];
173 extern const struct nvc0_gr_pack nve4_grctx_pack_gpc[];
174 extern const struct nvc0_gr_pack nve4_grctx_pack_tpc[];
175 extern const struct nvc0_gr_pack nve4_grctx_pack_ppc[];
176 extern const struct nvc0_gr_pack nve4_grctx_pack_icmd[];
177 extern const struct nvc0_gr_init nve4_grctx_init_a097_0[];
179 extern const struct nvc0_gr_pack nvf0_grctx_pack_icmd[];
181 extern const struct nvc0_gr_pack nvf0_grctx_pack_mthd[];
183 extern const struct nvc0_gr_pack nvf0_grctx_pack_hub[];
184 extern const struct nvc0_gr_init nvf0_grctx_init_pri_0[];
185 extern const struct nvc0_gr_init nvf0_grctx_init_cwd_0[];
187 extern const struct nvc0_gr_pack nvf0_grctx_pack_gpc[];
188 extern const struct nvc0_gr_init nvf0_grctx_init_gpc_unk_2[];
190 extern const struct nvc0_gr_init nvf0_grctx_init_tex_0[];
191 extern const struct nvc0_gr_init nvf0_grctx_init_mpc_0[];
192 extern const struct nvc0_gr_init nvf0_grctx_init_l1c_0[];
194 extern const struct nvc0_gr_pack nvf0_grctx_pack_ppc[];
196 extern const struct nvc0_gr_init nv108_grctx_init_rstr2d_0[];
198 extern const struct nvc0_gr_init nv108_grctx_init_prop_0[];
199 extern const struct nvc0_gr_init nv108_grctx_init_crstr_0[];