drm/gf100-/gr: tidy reg/ctx initval lists, mostly by giving them names
[deliverable/linux.git] / drivers / gpu / drm / nouveau / core / engine / graph / ctxnvc8.c
CommitLineData
30f4e087
BS
1/*
2 * Copyright 2013 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs <bskeggs@redhat.com>
23 */
24
c33b1e8c 25#include "ctxnvc0.h"
30f4e087 26
c33b1e8c
BS
27/*******************************************************************************
28 * PGRAPH context register lists
29 ******************************************************************************/
30
31static const struct nvc0_graph_init
32nvc8_grctx_init_icmd_0[] = {
30f4e087
BS
33 { 0x001000, 1, 0x01, 0x00000004 },
34 { 0x0000a9, 1, 0x01, 0x0000ffff },
35 { 0x000038, 1, 0x01, 0x0fac6881 },
36 { 0x00003d, 1, 0x01, 0x00000001 },
37 { 0x0000e8, 8, 0x01, 0x00000400 },
38 { 0x000078, 8, 0x01, 0x00000300 },
39 { 0x000050, 1, 0x01, 0x00000011 },
40 { 0x000058, 8, 0x01, 0x00000008 },
41 { 0x000208, 8, 0x01, 0x00000001 },
42 { 0x000081, 1, 0x01, 0x00000001 },
43 { 0x000085, 1, 0x01, 0x00000004 },
44 { 0x000088, 1, 0x01, 0x00000400 },
45 { 0x000090, 1, 0x01, 0x00000300 },
46 { 0x000098, 1, 0x01, 0x00001001 },
47 { 0x0000e3, 1, 0x01, 0x00000001 },
48 { 0x0000da, 1, 0x01, 0x00000001 },
49 { 0x0000f8, 1, 0x01, 0x00000003 },
50 { 0x0000fa, 1, 0x01, 0x00000001 },
51 { 0x00009f, 4, 0x01, 0x0000ffff },
52 { 0x0000b1, 1, 0x01, 0x00000001 },
53 { 0x0000b2, 40, 0x01, 0x00000000 },
54 { 0x000210, 8, 0x01, 0x00000040 },
55 { 0x000218, 8, 0x01, 0x0000c080 },
56 { 0x0000ad, 1, 0x01, 0x0000013e },
57 { 0x0000e1, 1, 0x01, 0x00000010 },
58 { 0x000290, 16, 0x01, 0x00000000 },
59 { 0x0003b0, 16, 0x01, 0x00000000 },
60 { 0x0002a0, 16, 0x01, 0x00000000 },
61 { 0x000420, 16, 0x01, 0x00000000 },
62 { 0x0002b0, 16, 0x01, 0x00000000 },
63 { 0x000430, 16, 0x01, 0x00000000 },
64 { 0x0002c0, 16, 0x01, 0x00000000 },
65 { 0x0004d0, 16, 0x01, 0x00000000 },
66 { 0x000720, 16, 0x01, 0x00000000 },
67 { 0x0008c0, 16, 0x01, 0x00000000 },
68 { 0x000890, 16, 0x01, 0x00000000 },
69 { 0x0008e0, 16, 0x01, 0x00000000 },
70 { 0x0008a0, 16, 0x01, 0x00000000 },
71 { 0x0008f0, 16, 0x01, 0x00000000 },
72 { 0x00094c, 1, 0x01, 0x000000ff },
73 { 0x00094d, 1, 0x01, 0xffffffff },
74 { 0x00094e, 1, 0x01, 0x00000002 },
75 { 0x0002ec, 1, 0x01, 0x00000001 },
76 { 0x000303, 1, 0x01, 0x00000001 },
77 { 0x0002e6, 1, 0x01, 0x00000001 },
78 { 0x000466, 1, 0x01, 0x00000052 },
79 { 0x000301, 1, 0x01, 0x3f800000 },
80 { 0x000304, 1, 0x01, 0x30201000 },
81 { 0x000305, 1, 0x01, 0x70605040 },
82 { 0x000306, 1, 0x01, 0xb8a89888 },
83 { 0x000307, 1, 0x01, 0xf8e8d8c8 },
84 { 0x00030a, 1, 0x01, 0x00ffff00 },
85 { 0x00030b, 1, 0x01, 0x0000001a },
86 { 0x00030c, 1, 0x01, 0x00000001 },
87 { 0x000318, 1, 0x01, 0x00000001 },
88 { 0x000340, 1, 0x01, 0x00000000 },
89 { 0x000375, 1, 0x01, 0x00000001 },
90 { 0x000351, 1, 0x01, 0x00000100 },
91 { 0x00037d, 1, 0x01, 0x00000006 },
92 { 0x0003a0, 1, 0x01, 0x00000002 },
93 { 0x0003aa, 1, 0x01, 0x00000001 },
94 { 0x0003a9, 1, 0x01, 0x00000001 },
95 { 0x000380, 1, 0x01, 0x00000001 },
96 { 0x000360, 1, 0x01, 0x00000040 },
97 { 0x000366, 2, 0x01, 0x00000000 },
98 { 0x000368, 1, 0x01, 0x00001fff },
99 { 0x000370, 2, 0x01, 0x00000000 },
100 { 0x000372, 1, 0x01, 0x003fffff },
101 { 0x00037a, 1, 0x01, 0x00000012 },
102 { 0x0005e0, 5, 0x01, 0x00000022 },
103 { 0x000619, 1, 0x01, 0x00000003 },
104 { 0x000811, 1, 0x01, 0x00000003 },
105 { 0x000812, 1, 0x01, 0x00000004 },
106 { 0x000813, 1, 0x01, 0x00000006 },
107 { 0x000814, 1, 0x01, 0x00000008 },
108 { 0x000815, 1, 0x01, 0x0000000b },
109 { 0x000800, 6, 0x01, 0x00000001 },
110 { 0x000632, 1, 0x01, 0x00000001 },
111 { 0x000633, 1, 0x01, 0x00000002 },
112 { 0x000634, 1, 0x01, 0x00000003 },
113 { 0x000635, 1, 0x01, 0x00000004 },
114 { 0x000654, 1, 0x01, 0x3f800000 },
115 { 0x000657, 1, 0x01, 0x3f800000 },
116 { 0x000655, 2, 0x01, 0x3f800000 },
117 { 0x0006cd, 1, 0x01, 0x3f800000 },
118 { 0x0007f5, 1, 0x01, 0x3f800000 },
119 { 0x0007dc, 1, 0x01, 0x39291909 },
120 { 0x0007dd, 1, 0x01, 0x79695949 },
121 { 0x0007de, 1, 0x01, 0xb9a99989 },
122 { 0x0007df, 1, 0x01, 0xf9e9d9c9 },
123 { 0x0007e8, 1, 0x01, 0x00003210 },
124 { 0x0007e9, 1, 0x01, 0x00007654 },
125 { 0x0007ea, 1, 0x01, 0x00000098 },
126 { 0x0007ec, 1, 0x01, 0x39291909 },
127 { 0x0007ed, 1, 0x01, 0x79695949 },
128 { 0x0007ee, 1, 0x01, 0xb9a99989 },
129 { 0x0007ef, 1, 0x01, 0xf9e9d9c9 },
130 { 0x0007f0, 1, 0x01, 0x00003210 },
131 { 0x0007f1, 1, 0x01, 0x00007654 },
132 { 0x0007f2, 1, 0x01, 0x00000098 },
133 { 0x0005a5, 1, 0x01, 0x00000001 },
134 { 0x000980, 128, 0x01, 0x00000000 },
135 { 0x000468, 1, 0x01, 0x00000004 },
136 { 0x00046c, 1, 0x01, 0x00000001 },
137 { 0x000470, 96, 0x01, 0x00000000 },
138 { 0x000510, 16, 0x01, 0x3f800000 },
139 { 0x000520, 1, 0x01, 0x000002b6 },
140 { 0x000529, 1, 0x01, 0x00000001 },
141 { 0x000530, 16, 0x01, 0xffff0000 },
142 { 0x000585, 1, 0x01, 0x0000003f },
143 { 0x000576, 1, 0x01, 0x00000003 },
144 { 0x00057b, 1, 0x01, 0x00000059 },
145 { 0x000586, 1, 0x01, 0x00000040 },
146 { 0x000582, 2, 0x01, 0x00000080 },
147 { 0x0005c2, 1, 0x01, 0x00000001 },
c33b1e8c 148 { 0x000638, 2, 0x01, 0x00000001 },
30f4e087
BS
149 { 0x00063a, 1, 0x01, 0x00000002 },
150 { 0x00063b, 2, 0x01, 0x00000001 },
151 { 0x00063d, 1, 0x01, 0x00000002 },
152 { 0x00063e, 1, 0x01, 0x00000001 },
153 { 0x0008b8, 8, 0x01, 0x00000001 },
154 { 0x000900, 8, 0x01, 0x00000001 },
155 { 0x000908, 8, 0x01, 0x00000002 },
156 { 0x000910, 16, 0x01, 0x00000001 },
157 { 0x000920, 8, 0x01, 0x00000002 },
158 { 0x000928, 8, 0x01, 0x00000001 },
159 { 0x000648, 9, 0x01, 0x00000001 },
160 { 0x000658, 1, 0x01, 0x0000000f },
161 { 0x0007ff, 1, 0x01, 0x0000000a },
162 { 0x00066a, 1, 0x01, 0x40000000 },
163 { 0x00066b, 1, 0x01, 0x10000000 },
164 { 0x00066c, 2, 0x01, 0xffff0000 },
165 { 0x0007af, 2, 0x01, 0x00000008 },
166 { 0x0007f6, 1, 0x01, 0x00000001 },
167 { 0x0006b2, 1, 0x01, 0x00000055 },
168 { 0x0007ad, 1, 0x01, 0x00000003 },
169 { 0x000937, 1, 0x01, 0x00000001 },
170 { 0x000971, 1, 0x01, 0x00000008 },
171 { 0x000972, 1, 0x01, 0x00000040 },
172 { 0x000973, 1, 0x01, 0x0000012c },
173 { 0x00097c, 1, 0x01, 0x00000040 },
174 { 0x000979, 1, 0x01, 0x00000003 },
175 { 0x000975, 1, 0x01, 0x00000020 },
176 { 0x000976, 1, 0x01, 0x00000001 },
177 { 0x000977, 1, 0x01, 0x00000020 },
178 { 0x000978, 1, 0x01, 0x00000001 },
179 { 0x000957, 1, 0x01, 0x00000003 },
180 { 0x00095e, 1, 0x01, 0x20164010 },
181 { 0x00095f, 1, 0x01, 0x00000020 },
182 { 0x00097d, 1, 0x01, 0x00000020 },
183 { 0x000683, 1, 0x01, 0x00000006 },
184 { 0x000685, 1, 0x01, 0x003fffff },
185 { 0x000687, 1, 0x01, 0x00000c48 },
186 { 0x0006a0, 1, 0x01, 0x00000005 },
187 { 0x000840, 1, 0x01, 0x00300008 },
188 { 0x000841, 1, 0x01, 0x04000080 },
189 { 0x000842, 1, 0x01, 0x00300008 },
190 { 0x000843, 1, 0x01, 0x04000080 },
191 { 0x000818, 8, 0x01, 0x00000000 },
192 { 0x000848, 16, 0x01, 0x00000000 },
193 { 0x000738, 1, 0x01, 0x00000000 },
194 { 0x0006aa, 1, 0x01, 0x00000001 },
195 { 0x0006ab, 1, 0x01, 0x00000002 },
196 { 0x0006ac, 1, 0x01, 0x00000080 },
197 { 0x0006ad, 2, 0x01, 0x00000100 },
198 { 0x0006b1, 1, 0x01, 0x00000011 },
199 { 0x0006bb, 1, 0x01, 0x000000cf },
200 { 0x0006ce, 1, 0x01, 0x2a712488 },
201 { 0x000739, 1, 0x01, 0x4085c000 },
202 { 0x00073a, 1, 0x01, 0x00000080 },
203 { 0x000786, 1, 0x01, 0x80000100 },
204 { 0x00073c, 1, 0x01, 0x00010100 },
205 { 0x00073d, 1, 0x01, 0x02800000 },
206 { 0x000787, 1, 0x01, 0x000000cf },
207 { 0x00078c, 1, 0x01, 0x00000008 },
208 { 0x000792, 1, 0x01, 0x00000001 },
c33b1e8c 209 { 0x000794, 3, 0x01, 0x00000001 },
30f4e087
BS
210 { 0x000797, 1, 0x01, 0x000000cf },
211 { 0x000836, 1, 0x01, 0x00000001 },
212 { 0x00079a, 1, 0x01, 0x00000002 },
213 { 0x000833, 1, 0x01, 0x04444480 },
214 { 0x0007a1, 1, 0x01, 0x00000001 },
c33b1e8c 215 { 0x0007a3, 3, 0x01, 0x00000001 },
30f4e087
BS
216 { 0x000831, 1, 0x01, 0x00000004 },
217 { 0x00080c, 1, 0x01, 0x00000002 },
218 { 0x00080d, 2, 0x01, 0x00000100 },
219 { 0x00080f, 1, 0x01, 0x00000001 },
220 { 0x000823, 1, 0x01, 0x00000002 },
221 { 0x000824, 2, 0x01, 0x00000100 },
222 { 0x000826, 1, 0x01, 0x00000001 },
223 { 0x00095d, 1, 0x01, 0x00000001 },
224 { 0x00082b, 1, 0x01, 0x00000004 },
225 { 0x000942, 1, 0x01, 0x00010001 },
226 { 0x000943, 1, 0x01, 0x00000001 },
227 { 0x000944, 1, 0x01, 0x00000022 },
228 { 0x0007c5, 1, 0x01, 0x00010001 },
229 { 0x000834, 1, 0x01, 0x00000001 },
230 { 0x0007c7, 1, 0x01, 0x00000001 },
231 { 0x00c1b0, 8, 0x01, 0x0000000f },
232 { 0x00c1b8, 1, 0x01, 0x0fac6881 },
233 { 0x00c1b9, 1, 0x01, 0x00fac688 },
234 { 0x01e100, 1, 0x01, 0x00000001 },
235 { 0x001000, 1, 0x01, 0x00000002 },
236 { 0x0006aa, 1, 0x01, 0x00000001 },
237 { 0x0006ad, 2, 0x01, 0x00000100 },
238 { 0x0006b1, 1, 0x01, 0x00000011 },
239 { 0x00078c, 1, 0x01, 0x00000008 },
240 { 0x000792, 1, 0x01, 0x00000001 },
c33b1e8c 241 { 0x000794, 3, 0x01, 0x00000001 },
30f4e087
BS
242 { 0x000797, 1, 0x01, 0x000000cf },
243 { 0x00079a, 1, 0x01, 0x00000002 },
244 { 0x000833, 1, 0x01, 0x04444480 },
245 { 0x0007a1, 1, 0x01, 0x00000001 },
c33b1e8c 246 { 0x0007a3, 3, 0x01, 0x00000001 },
30f4e087
BS
247 { 0x000831, 1, 0x01, 0x00000004 },
248 { 0x01e100, 1, 0x01, 0x00000001 },
249 { 0x001000, 1, 0x01, 0x00000014 },
250 { 0x000351, 1, 0x01, 0x00000100 },
251 { 0x000957, 1, 0x01, 0x00000003 },
252 { 0x00095d, 1, 0x01, 0x00000001 },
253 { 0x00082b, 1, 0x01, 0x00000004 },
254 { 0x000942, 1, 0x01, 0x00010001 },
255 { 0x000943, 1, 0x01, 0x00000001 },
256 { 0x0007c5, 1, 0x01, 0x00010001 },
257 { 0x000834, 1, 0x01, 0x00000001 },
258 { 0x0007c7, 1, 0x01, 0x00000001 },
259 { 0x01e100, 1, 0x01, 0x00000001 },
260 { 0x001000, 1, 0x01, 0x00000001 },
261 { 0x00080c, 1, 0x01, 0x00000002 },
262 { 0x00080d, 2, 0x01, 0x00000100 },
263 { 0x00080f, 1, 0x01, 0x00000001 },
264 { 0x000823, 1, 0x01, 0x00000002 },
265 { 0x000824, 2, 0x01, 0x00000100 },
266 { 0x000826, 1, 0x01, 0x00000001 },
267 { 0x01e100, 1, 0x01, 0x00000001 },
268 {}
269};
270
c33b1e8c
BS
271static const struct nvc0_graph_pack
272nvc8_grctx_pack_icmd[] = {
273 { nvc8_grctx_init_icmd_0 },
274 {}
275};
276
277const struct nvc0_graph_init
278nvc8_grctx_init_9197_0[] = {
279 { 0x0002e4, 1, 0x04, 0x0000b001 },
280 {}
281};
282
283const struct nvc0_graph_init
284nvc8_grctx_init_9297_0[] = {
285 { 0x003400, 128, 0x04, 0x00000000 },
286 { 0x00036c, 2, 0x04, 0x00000000 },
287 { 0x0007a4, 2, 0x04, 0x00000000 },
288 { 0x000374, 1, 0x04, 0x00000000 },
289 { 0x000378, 1, 0x04, 0x00000020 },
290 {}
291};
292
293static const struct nvc0_graph_pack
294nvc8_grctx_pack_mthd[] = {
295 { nvc1_grctx_init_9097_0, 0x9097 },
296 { nvc8_grctx_init_9197_0, 0x9197 },
297 { nvc8_grctx_init_9297_0, 0x9297 },
298 { nvc0_grctx_init_902d_0, 0x902d },
299 { nvc0_grctx_init_9039_0, 0x9039 },
300 { nvc0_grctx_init_90c0_0, 0x90c0 },
301 {}
302};
303
304static const struct nvc0_graph_init
e21bfd17
BS
305nvc8_grctx_init_gpc_0[] = {
306 { 0x418380, 1, 0x04, 0x00000016 },
307 { 0x418400, 1, 0x04, 0x38004e00 },
308 { 0x418404, 1, 0x04, 0x71e0ffff },
309 { 0x418408, 1, 0x04, 0x00000000 },
310 { 0x41840c, 1, 0x04, 0x00001008 },
311 { 0x418410, 1, 0x04, 0x0fff0fff },
312 { 0x418414, 1, 0x04, 0x00200fff },
313 { 0x418450, 6, 0x04, 0x00000000 },
314 { 0x418468, 1, 0x04, 0x00000001 },
315 { 0x41846c, 2, 0x04, 0x00000000 },
316 { 0x418600, 1, 0x04, 0x0000001f },
317 { 0x418684, 1, 0x04, 0x0000000f },
318 { 0x418700, 1, 0x04, 0x00000002 },
319 { 0x418704, 1, 0x04, 0x00000080 },
320 { 0x418708, 1, 0x04, 0x00000000 },
321 { 0x41870c, 1, 0x04, 0x07c80000 },
322 { 0x418710, 1, 0x04, 0x00000000 },
323 { 0x418800, 1, 0x04, 0x0006860a },
324 { 0x418808, 3, 0x04, 0x00000000 },
325 { 0x418828, 1, 0x04, 0x00008442 },
326 { 0x418830, 1, 0x04, 0x00000001 },
327 { 0x4188d8, 1, 0x04, 0x00000008 },
328 { 0x4188e0, 1, 0x04, 0x01000000 },
329 { 0x4188e8, 5, 0x04, 0x00000000 },
330 { 0x4188fc, 1, 0x04, 0x20100000 },
331 { 0x41891c, 1, 0x04, 0x00ff00ff },
332 { 0x418924, 1, 0x04, 0x00000000 },
333 { 0x418928, 1, 0x04, 0x00ffff00 },
334 { 0x41892c, 1, 0x04, 0x0000ff00 },
335 { 0x418b00, 1, 0x04, 0x00000000 },
336 { 0x418b08, 1, 0x04, 0x0a418820 },
337 { 0x418b0c, 1, 0x04, 0x062080e6 },
338 { 0x418b10, 1, 0x04, 0x020398a4 },
339 { 0x418b14, 1, 0x04, 0x0e629062 },
340 { 0x418b18, 1, 0x04, 0x0a418820 },
341 { 0x418b1c, 1, 0x04, 0x000000e6 },
342 { 0x418bb8, 1, 0x04, 0x00000103 },
343 { 0x418c08, 1, 0x04, 0x00000001 },
344 { 0x418c10, 8, 0x04, 0x00000000 },
345 { 0x418c80, 1, 0x04, 0x20200004 },
346 { 0x418c8c, 1, 0x04, 0x00000001 },
347 { 0x419000, 1, 0x04, 0x00000780 },
348 { 0x419004, 2, 0x04, 0x00000000 },
349 { 0x419014, 1, 0x04, 0x00000004 },
30f4e087
BS
350 {}
351};
352
c33b1e8c
BS
353static const struct nvc0_graph_pack
354nvc8_grctx_pack_gpc[] = {
355 { nvc8_grctx_init_gpc_0 },
30f4e087
BS
356 {}
357};
358
c33b1e8c
BS
359/*******************************************************************************
360 * PGRAPH context implementation
361 ******************************************************************************/
70f824ac 362
30f4e087
BS
363struct nouveau_oclass *
364nvc8_grctx_oclass = &(struct nvc0_grctx_oclass) {
365 .base.handle = NV_ENGCTX(GR, 0xc8),
366 .base.ofuncs = &(struct nouveau_ofuncs) {
367 .ctor = nvc0_graph_context_ctor,
368 .dtor = nvc0_graph_context_dtor,
369 .init = _nouveau_graph_context_init,
370 .fini = _nouveau_graph_context_fini,
371 .rd32 = _nouveau_graph_context_rd32,
372 .wr32 = _nouveau_graph_context_wr32,
373 },
c33b1e8c
BS
374 .main = nvc0_grctx_generate_main,
375 .mods = nvc0_grctx_generate_mods,
376 .unkn = nvc0_grctx_generate_unkn,
377 .hub = nvc0_grctx_pack_hub,
378 .gpc = nvc8_grctx_pack_gpc,
379 .zcull = nvc0_grctx_pack_zcull,
380 .tpc = nvc0_grctx_pack_tpc,
381 .icmd = nvc8_grctx_pack_icmd,
382 .mthd = nvc8_grctx_pack_mthd,
30f4e087 383}.base;
This page took 0.082369 seconds and 5 git commands to generate.