1 | /* $NetBSD: nouveau_engine_graph_ctxnvc0.c,v 1.1.1.1 2014/08/06 12:36:25 riastradh Exp $ */ |
2 | |
3 | /* |
4 | * Copyright 2010 Red Hat Inc. |
5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), |
8 | * to deal in the Software without restriction, including without limitation |
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
10 | * and/or sell copies of the Software, and to permit persons to whom the |
11 | * Software is furnished to do so, subject to the following conditions: |
12 | * |
13 | * The above copyright notice and this permission notice shall be included in |
14 | * all copies or substantial portions of the Software. |
15 | * |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
19 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
22 | * OTHER DEALINGS IN THE SOFTWARE. |
23 | * |
24 | * Authors: Ben Skeggs |
25 | */ |
26 | |
27 | #include <sys/cdefs.h> |
28 | __KERNEL_RCSID(0, "$NetBSD: nouveau_engine_graph_ctxnvc0.c,v 1.1.1.1 2014/08/06 12:36:25 riastradh Exp $" ); |
29 | |
30 | #include "ctxnvc0.h" |
31 | |
32 | /******************************************************************************* |
33 | * PGRAPH context register lists |
34 | ******************************************************************************/ |
35 | |
36 | static const struct nvc0_graph_init |
37 | nvc0_grctx_init_icmd_0[] = { |
38 | { 0x001000, 1, 0x01, 0x00000004 }, |
39 | { 0x0000a9, 1, 0x01, 0x0000ffff }, |
40 | { 0x000038, 1, 0x01, 0x0fac6881 }, |
41 | { 0x00003d, 1, 0x01, 0x00000001 }, |
42 | { 0x0000e8, 8, 0x01, 0x00000400 }, |
43 | { 0x000078, 8, 0x01, 0x00000300 }, |
44 | { 0x000050, 1, 0x01, 0x00000011 }, |
45 | { 0x000058, 8, 0x01, 0x00000008 }, |
46 | { 0x000208, 8, 0x01, 0x00000001 }, |
47 | { 0x000081, 1, 0x01, 0x00000001 }, |
48 | { 0x000085, 1, 0x01, 0x00000004 }, |
49 | { 0x000088, 1, 0x01, 0x00000400 }, |
50 | { 0x000090, 1, 0x01, 0x00000300 }, |
51 | { 0x000098, 1, 0x01, 0x00001001 }, |
52 | { 0x0000e3, 1, 0x01, 0x00000001 }, |
53 | { 0x0000da, 1, 0x01, 0x00000001 }, |
54 | { 0x0000f8, 1, 0x01, 0x00000003 }, |
55 | { 0x0000fa, 1, 0x01, 0x00000001 }, |
56 | { 0x00009f, 4, 0x01, 0x0000ffff }, |
57 | { 0x0000b1, 1, 0x01, 0x00000001 }, |
58 | { 0x0000b2, 40, 0x01, 0x00000000 }, |
59 | { 0x000210, 8, 0x01, 0x00000040 }, |
60 | { 0x000218, 8, 0x01, 0x0000c080 }, |
61 | { 0x0000ad, 1, 0x01, 0x0000013e }, |
62 | { 0x0000e1, 1, 0x01, 0x00000010 }, |
63 | { 0x000290, 16, 0x01, 0x00000000 }, |
64 | { 0x0003b0, 16, 0x01, 0x00000000 }, |
65 | { 0x0002a0, 16, 0x01, 0x00000000 }, |
66 | { 0x000420, 16, 0x01, 0x00000000 }, |
67 | { 0x0002b0, 16, 0x01, 0x00000000 }, |
68 | { 0x000430, 16, 0x01, 0x00000000 }, |
69 | { 0x0002c0, 16, 0x01, 0x00000000 }, |
70 | { 0x0004d0, 16, 0x01, 0x00000000 }, |
71 | { 0x000720, 16, 0x01, 0x00000000 }, |
72 | { 0x0008c0, 16, 0x01, 0x00000000 }, |
73 | { 0x000890, 16, 0x01, 0x00000000 }, |
74 | { 0x0008e0, 16, 0x01, 0x00000000 }, |
75 | { 0x0008a0, 16, 0x01, 0x00000000 }, |
76 | { 0x0008f0, 16, 0x01, 0x00000000 }, |
77 | { 0x00094c, 1, 0x01, 0x000000ff }, |
78 | { 0x00094d, 1, 0x01, 0xffffffff }, |
79 | { 0x00094e, 1, 0x01, 0x00000002 }, |
80 | { 0x0002ec, 1, 0x01, 0x00000001 }, |
81 | { 0x000303, 1, 0x01, 0x00000001 }, |
82 | { 0x0002e6, 1, 0x01, 0x00000001 }, |
83 | { 0x000466, 1, 0x01, 0x00000052 }, |
84 | { 0x000301, 1, 0x01, 0x3f800000 }, |
85 | { 0x000304, 1, 0x01, 0x30201000 }, |
86 | { 0x000305, 1, 0x01, 0x70605040 }, |
87 | { 0x000306, 1, 0x01, 0xb8a89888 }, |
88 | { 0x000307, 1, 0x01, 0xf8e8d8c8 }, |
89 | { 0x00030a, 1, 0x01, 0x00ffff00 }, |
90 | { 0x00030b, 1, 0x01, 0x0000001a }, |
91 | { 0x00030c, 1, 0x01, 0x00000001 }, |
92 | { 0x000318, 1, 0x01, 0x00000001 }, |
93 | { 0x000340, 1, 0x01, 0x00000000 }, |
94 | { 0x000375, 1, 0x01, 0x00000001 }, |
95 | { 0x000351, 1, 0x01, 0x00000100 }, |
96 | { 0x00037d, 1, 0x01, 0x00000006 }, |
97 | { 0x0003a0, 1, 0x01, 0x00000002 }, |
98 | { 0x0003aa, 1, 0x01, 0x00000001 }, |
99 | { 0x0003a9, 1, 0x01, 0x00000001 }, |
100 | { 0x000380, 1, 0x01, 0x00000001 }, |
101 | { 0x000360, 1, 0x01, 0x00000040 }, |
102 | { 0x000366, 2, 0x01, 0x00000000 }, |
103 | { 0x000368, 1, 0x01, 0x00001fff }, |
104 | { 0x000370, 2, 0x01, 0x00000000 }, |
105 | { 0x000372, 1, 0x01, 0x003fffff }, |
106 | { 0x00037a, 1, 0x01, 0x00000012 }, |
107 | { 0x0005e0, 5, 0x01, 0x00000022 }, |
108 | { 0x000619, 1, 0x01, 0x00000003 }, |
109 | { 0x000811, 1, 0x01, 0x00000003 }, |
110 | { 0x000812, 1, 0x01, 0x00000004 }, |
111 | { 0x000813, 1, 0x01, 0x00000006 }, |
112 | { 0x000814, 1, 0x01, 0x00000008 }, |
113 | { 0x000815, 1, 0x01, 0x0000000b }, |
114 | { 0x000800, 6, 0x01, 0x00000001 }, |
115 | { 0x000632, 1, 0x01, 0x00000001 }, |
116 | { 0x000633, 1, 0x01, 0x00000002 }, |
117 | { 0x000634, 1, 0x01, 0x00000003 }, |
118 | { 0x000635, 1, 0x01, 0x00000004 }, |
119 | { 0x000654, 1, 0x01, 0x3f800000 }, |
120 | { 0x000657, 1, 0x01, 0x3f800000 }, |
121 | { 0x000655, 2, 0x01, 0x3f800000 }, |
122 | { 0x0006cd, 1, 0x01, 0x3f800000 }, |
123 | { 0x0007f5, 1, 0x01, 0x3f800000 }, |
124 | { 0x0007dc, 1, 0x01, 0x39291909 }, |
125 | { 0x0007dd, 1, 0x01, 0x79695949 }, |
126 | { 0x0007de, 1, 0x01, 0xb9a99989 }, |
127 | { 0x0007df, 1, 0x01, 0xf9e9d9c9 }, |
128 | { 0x0007e8, 1, 0x01, 0x00003210 }, |
129 | { 0x0007e9, 1, 0x01, 0x00007654 }, |
130 | { 0x0007ea, 1, 0x01, 0x00000098 }, |
131 | { 0x0007ec, 1, 0x01, 0x39291909 }, |
132 | { 0x0007ed, 1, 0x01, 0x79695949 }, |
133 | { 0x0007ee, 1, 0x01, 0xb9a99989 }, |
134 | { 0x0007ef, 1, 0x01, 0xf9e9d9c9 }, |
135 | { 0x0007f0, 1, 0x01, 0x00003210 }, |
136 | { 0x0007f1, 1, 0x01, 0x00007654 }, |
137 | { 0x0007f2, 1, 0x01, 0x00000098 }, |
138 | { 0x0005a5, 1, 0x01, 0x00000001 }, |
139 | { 0x000980, 128, 0x01, 0x00000000 }, |
140 | { 0x000468, 1, 0x01, 0x00000004 }, |
141 | { 0x00046c, 1, 0x01, 0x00000001 }, |
142 | { 0x000470, 96, 0x01, 0x00000000 }, |
143 | { 0x000510, 16, 0x01, 0x3f800000 }, |
144 | { 0x000520, 1, 0x01, 0x000002b6 }, |
145 | { 0x000529, 1, 0x01, 0x00000001 }, |
146 | { 0x000530, 16, 0x01, 0xffff0000 }, |
147 | { 0x000585, 1, 0x01, 0x0000003f }, |
148 | { 0x000576, 1, 0x01, 0x00000003 }, |
149 | { 0x000586, 1, 0x01, 0x00000040 }, |
150 | { 0x000582, 2, 0x01, 0x00000080 }, |
151 | { 0x0005c2, 1, 0x01, 0x00000001 }, |
152 | { 0x000638, 2, 0x01, 0x00000001 }, |
153 | { 0x00063a, 1, 0x01, 0x00000002 }, |
154 | { 0x00063b, 2, 0x01, 0x00000001 }, |
155 | { 0x00063d, 1, 0x01, 0x00000002 }, |
156 | { 0x00063e, 1, 0x01, 0x00000001 }, |
157 | { 0x0008b8, 8, 0x01, 0x00000001 }, |
158 | { 0x000900, 8, 0x01, 0x00000001 }, |
159 | { 0x000908, 8, 0x01, 0x00000002 }, |
160 | { 0x000910, 16, 0x01, 0x00000001 }, |
161 | { 0x000920, 8, 0x01, 0x00000002 }, |
162 | { 0x000928, 8, 0x01, 0x00000001 }, |
163 | { 0x000648, 9, 0x01, 0x00000001 }, |
164 | { 0x000658, 1, 0x01, 0x0000000f }, |
165 | { 0x0007ff, 1, 0x01, 0x0000000a }, |
166 | { 0x00066a, 1, 0x01, 0x40000000 }, |
167 | { 0x00066b, 1, 0x01, 0x10000000 }, |
168 | { 0x00066c, 2, 0x01, 0xffff0000 }, |
169 | { 0x0007af, 2, 0x01, 0x00000008 }, |
170 | { 0x0007f6, 1, 0x01, 0x00000001 }, |
171 | { 0x0006b2, 1, 0x01, 0x00000055 }, |
172 | { 0x0007ad, 1, 0x01, 0x00000003 }, |
173 | { 0x000937, 1, 0x01, 0x00000001 }, |
174 | { 0x000971, 1, 0x01, 0x00000008 }, |
175 | { 0x000972, 1, 0x01, 0x00000040 }, |
176 | { 0x000973, 1, 0x01, 0x0000012c }, |
177 | { 0x00097c, 1, 0x01, 0x00000040 }, |
178 | { 0x000979, 1, 0x01, 0x00000003 }, |
179 | { 0x000975, 1, 0x01, 0x00000020 }, |
180 | { 0x000976, 1, 0x01, 0x00000001 }, |
181 | { 0x000977, 1, 0x01, 0x00000020 }, |
182 | { 0x000978, 1, 0x01, 0x00000001 }, |
183 | { 0x000957, 1, 0x01, 0x00000003 }, |
184 | { 0x00095e, 1, 0x01, 0x20164010 }, |
185 | { 0x00095f, 1, 0x01, 0x00000020 }, |
186 | { 0x000683, 1, 0x01, 0x00000006 }, |
187 | { 0x000685, 1, 0x01, 0x003fffff }, |
188 | { 0x000687, 1, 0x01, 0x00000c48 }, |
189 | { 0x0006a0, 1, 0x01, 0x00000005 }, |
190 | { 0x000840, 1, 0x01, 0x00300008 }, |
191 | { 0x000841, 1, 0x01, 0x04000080 }, |
192 | { 0x000842, 1, 0x01, 0x00300008 }, |
193 | { 0x000843, 1, 0x01, 0x04000080 }, |
194 | { 0x000818, 8, 0x01, 0x00000000 }, |
195 | { 0x000848, 16, 0x01, 0x00000000 }, |
196 | { 0x000738, 1, 0x01, 0x00000000 }, |
197 | { 0x0006aa, 1, 0x01, 0x00000001 }, |
198 | { 0x0006ab, 1, 0x01, 0x00000002 }, |
199 | { 0x0006ac, 1, 0x01, 0x00000080 }, |
200 | { 0x0006ad, 2, 0x01, 0x00000100 }, |
201 | { 0x0006b1, 1, 0x01, 0x00000011 }, |
202 | { 0x0006bb, 1, 0x01, 0x000000cf }, |
203 | { 0x0006ce, 1, 0x01, 0x2a712488 }, |
204 | { 0x000739, 1, 0x01, 0x4085c000 }, |
205 | { 0x00073a, 1, 0x01, 0x00000080 }, |
206 | { 0x000786, 1, 0x01, 0x80000100 }, |
207 | { 0x00073c, 1, 0x01, 0x00010100 }, |
208 | { 0x00073d, 1, 0x01, 0x02800000 }, |
209 | { 0x000787, 1, 0x01, 0x000000cf }, |
210 | { 0x00078c, 1, 0x01, 0x00000008 }, |
211 | { 0x000792, 1, 0x01, 0x00000001 }, |
212 | { 0x000794, 3, 0x01, 0x00000001 }, |
213 | { 0x000797, 1, 0x01, 0x000000cf }, |
214 | { 0x000836, 1, 0x01, 0x00000001 }, |
215 | { 0x00079a, 1, 0x01, 0x00000002 }, |
216 | { 0x000833, 1, 0x01, 0x04444480 }, |
217 | { 0x0007a1, 1, 0x01, 0x00000001 }, |
218 | { 0x0007a3, 3, 0x01, 0x00000001 }, |
219 | { 0x000831, 1, 0x01, 0x00000004 }, |
220 | { 0x00080c, 1, 0x01, 0x00000002 }, |
221 | { 0x00080d, 2, 0x01, 0x00000100 }, |
222 | { 0x00080f, 1, 0x01, 0x00000001 }, |
223 | { 0x000823, 1, 0x01, 0x00000002 }, |
224 | { 0x000824, 2, 0x01, 0x00000100 }, |
225 | { 0x000826, 1, 0x01, 0x00000001 }, |
226 | { 0x00095d, 1, 0x01, 0x00000001 }, |
227 | { 0x00082b, 1, 0x01, 0x00000004 }, |
228 | { 0x000942, 1, 0x01, 0x00010001 }, |
229 | { 0x000943, 1, 0x01, 0x00000001 }, |
230 | { 0x000944, 1, 0x01, 0x00000022 }, |
231 | { 0x0007c5, 1, 0x01, 0x00010001 }, |
232 | { 0x000834, 1, 0x01, 0x00000001 }, |
233 | { 0x0007c7, 1, 0x01, 0x00000001 }, |
234 | { 0x00c1b0, 8, 0x01, 0x0000000f }, |
235 | { 0x00c1b8, 1, 0x01, 0x0fac6881 }, |
236 | { 0x00c1b9, 1, 0x01, 0x00fac688 }, |
237 | { 0x01e100, 1, 0x01, 0x00000001 }, |
238 | { 0x001000, 1, 0x01, 0x00000002 }, |
239 | { 0x0006aa, 1, 0x01, 0x00000001 }, |
240 | { 0x0006ad, 2, 0x01, 0x00000100 }, |
241 | { 0x0006b1, 1, 0x01, 0x00000011 }, |
242 | { 0x00078c, 1, 0x01, 0x00000008 }, |
243 | { 0x000792, 1, 0x01, 0x00000001 }, |
244 | { 0x000794, 3, 0x01, 0x00000001 }, |
245 | { 0x000797, 1, 0x01, 0x000000cf }, |
246 | { 0x00079a, 1, 0x01, 0x00000002 }, |
247 | { 0x000833, 1, 0x01, 0x04444480 }, |
248 | { 0x0007a1, 1, 0x01, 0x00000001 }, |
249 | { 0x0007a3, 3, 0x01, 0x00000001 }, |
250 | { 0x000831, 1, 0x01, 0x00000004 }, |
251 | { 0x01e100, 1, 0x01, 0x00000001 }, |
252 | { 0x001000, 1, 0x01, 0x00000014 }, |
253 | { 0x000351, 1, 0x01, 0x00000100 }, |
254 | { 0x000957, 1, 0x01, 0x00000003 }, |
255 | { 0x00095d, 1, 0x01, 0x00000001 }, |
256 | { 0x00082b, 1, 0x01, 0x00000004 }, |
257 | { 0x000942, 1, 0x01, 0x00010001 }, |
258 | { 0x000943, 1, 0x01, 0x00000001 }, |
259 | { 0x0007c5, 1, 0x01, 0x00010001 }, |
260 | { 0x000834, 1, 0x01, 0x00000001 }, |
261 | { 0x0007c7, 1, 0x01, 0x00000001 }, |
262 | { 0x01e100, 1, 0x01, 0x00000001 }, |
263 | { 0x001000, 1, 0x01, 0x00000001 }, |
264 | { 0x00080c, 1, 0x01, 0x00000002 }, |
265 | { 0x00080d, 2, 0x01, 0x00000100 }, |
266 | { 0x00080f, 1, 0x01, 0x00000001 }, |
267 | { 0x000823, 1, 0x01, 0x00000002 }, |
268 | { 0x000824, 2, 0x01, 0x00000100 }, |
269 | { 0x000826, 1, 0x01, 0x00000001 }, |
270 | { 0x01e100, 1, 0x01, 0x00000001 }, |
271 | {} |
272 | }; |
273 | |
274 | const struct nvc0_graph_pack |
275 | nvc0_grctx_pack_icmd[] = { |
276 | { nvc0_grctx_init_icmd_0 }, |
277 | {} |
278 | }; |
279 | |
280 | static const struct nvc0_graph_init |
281 | nvc0_grctx_init_9097_0[] = { |
282 | { 0x000800, 8, 0x40, 0x00000000 }, |
283 | { 0x000804, 8, 0x40, 0x00000000 }, |
284 | { 0x000808, 8, 0x40, 0x00000400 }, |
285 | { 0x00080c, 8, 0x40, 0x00000300 }, |
286 | { 0x000810, 1, 0x04, 0x000000cf }, |
287 | { 0x000850, 7, 0x40, 0x00000000 }, |
288 | { 0x000814, 8, 0x40, 0x00000040 }, |
289 | { 0x000818, 8, 0x40, 0x00000001 }, |
290 | { 0x00081c, 8, 0x40, 0x00000000 }, |
291 | { 0x000820, 8, 0x40, 0x00000000 }, |
292 | { 0x002700, 8, 0x20, 0x00000000 }, |
293 | { 0x002704, 8, 0x20, 0x00000000 }, |
294 | { 0x002708, 8, 0x20, 0x00000000 }, |
295 | { 0x00270c, 8, 0x20, 0x00000000 }, |
296 | { 0x002710, 8, 0x20, 0x00014000 }, |
297 | { 0x002714, 8, 0x20, 0x00000040 }, |
298 | { 0x001c00, 16, 0x10, 0x00000000 }, |
299 | { 0x001c04, 16, 0x10, 0x00000000 }, |
300 | { 0x001c08, 16, 0x10, 0x00000000 }, |
301 | { 0x001c0c, 16, 0x10, 0x00000000 }, |
302 | { 0x001d00, 16, 0x10, 0x00000000 }, |
303 | { 0x001d04, 16, 0x10, 0x00000000 }, |
304 | { 0x001d08, 16, 0x10, 0x00000000 }, |
305 | { 0x001d0c, 16, 0x10, 0x00000000 }, |
306 | { 0x001f00, 16, 0x08, 0x00000000 }, |
307 | { 0x001f04, 16, 0x08, 0x00000000 }, |
308 | { 0x001f80, 16, 0x08, 0x00000000 }, |
309 | { 0x001f84, 16, 0x08, 0x00000000 }, |
310 | { 0x002200, 5, 0x10, 0x00000022 }, |
311 | { 0x002000, 1, 0x04, 0x00000000 }, |
312 | { 0x002040, 1, 0x04, 0x00000011 }, |
313 | { 0x002080, 1, 0x04, 0x00000020 }, |
314 | { 0x0020c0, 1, 0x04, 0x00000030 }, |
315 | { 0x002100, 1, 0x04, 0x00000040 }, |
316 | { 0x002140, 1, 0x04, 0x00000051 }, |
317 | { 0x00200c, 6, 0x40, 0x00000001 }, |
318 | { 0x002010, 1, 0x04, 0x00000000 }, |
319 | { 0x002050, 1, 0x04, 0x00000000 }, |
320 | { 0x002090, 1, 0x04, 0x00000001 }, |
321 | { 0x0020d0, 1, 0x04, 0x00000002 }, |
322 | { 0x002110, 1, 0x04, 0x00000003 }, |
323 | { 0x002150, 1, 0x04, 0x00000004 }, |
324 | { 0x000380, 4, 0x20, 0x00000000 }, |
325 | { 0x000384, 4, 0x20, 0x00000000 }, |
326 | { 0x000388, 4, 0x20, 0x00000000 }, |
327 | { 0x00038c, 4, 0x20, 0x00000000 }, |
328 | { 0x000700, 4, 0x10, 0x00000000 }, |
329 | { 0x000704, 4, 0x10, 0x00000000 }, |
330 | { 0x000708, 4, 0x10, 0x00000000 }, |
331 | { 0x002800, 128, 0x04, 0x00000000 }, |
332 | { 0x000a00, 16, 0x20, 0x00000000 }, |
333 | { 0x000a04, 16, 0x20, 0x00000000 }, |
334 | { 0x000a08, 16, 0x20, 0x00000000 }, |
335 | { 0x000a0c, 16, 0x20, 0x00000000 }, |
336 | { 0x000a10, 16, 0x20, 0x00000000 }, |
337 | { 0x000a14, 16, 0x20, 0x00000000 }, |
338 | { 0x000c00, 16, 0x10, 0x00000000 }, |
339 | { 0x000c04, 16, 0x10, 0x00000000 }, |
340 | { 0x000c08, 16, 0x10, 0x00000000 }, |
341 | { 0x000c0c, 16, 0x10, 0x3f800000 }, |
342 | { 0x000d00, 8, 0x08, 0xffff0000 }, |
343 | { 0x000d04, 8, 0x08, 0xffff0000 }, |
344 | { 0x000e00, 16, 0x10, 0x00000000 }, |
345 | { 0x000e04, 16, 0x10, 0xffff0000 }, |
346 | { 0x000e08, 16, 0x10, 0xffff0000 }, |
347 | { 0x000d40, 4, 0x08, 0x00000000 }, |
348 | { 0x000d44, 4, 0x08, 0x00000000 }, |
349 | { 0x001e00, 8, 0x20, 0x00000001 }, |
350 | { 0x001e04, 8, 0x20, 0x00000001 }, |
351 | { 0x001e08, 8, 0x20, 0x00000002 }, |
352 | { 0x001e0c, 8, 0x20, 0x00000001 }, |
353 | { 0x001e10, 8, 0x20, 0x00000001 }, |
354 | { 0x001e14, 8, 0x20, 0x00000002 }, |
355 | { 0x001e18, 8, 0x20, 0x00000001 }, |
356 | { 0x003400, 128, 0x04, 0x00000000 }, |
357 | { 0x00030c, 1, 0x04, 0x00000001 }, |
358 | { 0x001944, 1, 0x04, 0x00000000 }, |
359 | { 0x001514, 1, 0x04, 0x00000000 }, |
360 | { 0x000d68, 1, 0x04, 0x0000ffff }, |
361 | { 0x00121c, 1, 0x04, 0x0fac6881 }, |
362 | { 0x000fac, 1, 0x04, 0x00000001 }, |
363 | { 0x001538, 1, 0x04, 0x00000001 }, |
364 | { 0x000fe0, 2, 0x04, 0x00000000 }, |
365 | { 0x000fe8, 1, 0x04, 0x00000014 }, |
366 | { 0x000fec, 1, 0x04, 0x00000040 }, |
367 | { 0x000ff0, 1, 0x04, 0x00000000 }, |
368 | { 0x00179c, 1, 0x04, 0x00000000 }, |
369 | { 0x001228, 1, 0x04, 0x00000400 }, |
370 | { 0x00122c, 1, 0x04, 0x00000300 }, |
371 | { 0x001230, 1, 0x04, 0x00010001 }, |
372 | { 0x0007f8, 1, 0x04, 0x00000000 }, |
373 | { 0x0015b4, 1, 0x04, 0x00000001 }, |
374 | { 0x0015cc, 1, 0x04, 0x00000000 }, |
375 | { 0x001534, 1, 0x04, 0x00000000 }, |
376 | { 0x000fb0, 1, 0x04, 0x00000000 }, |
377 | { 0x0015d0, 1, 0x04, 0x00000000 }, |
378 | { 0x00153c, 1, 0x04, 0x00000000 }, |
379 | { 0x0016b4, 1, 0x04, 0x00000003 }, |
380 | { 0x000fbc, 4, 0x04, 0x0000ffff }, |
381 | { 0x000df8, 2, 0x04, 0x00000000 }, |
382 | { 0x001948, 1, 0x04, 0x00000000 }, |
383 | { 0x001970, 1, 0x04, 0x00000001 }, |
384 | { 0x00161c, 1, 0x04, 0x000009f0 }, |
385 | { 0x000dcc, 1, 0x04, 0x00000010 }, |
386 | { 0x00163c, 1, 0x04, 0x00000000 }, |
387 | { 0x0015e4, 1, 0x04, 0x00000000 }, |
388 | { 0x001160, 32, 0x04, 0x25e00040 }, |
389 | { 0x001880, 32, 0x04, 0x00000000 }, |
390 | { 0x000f84, 2, 0x04, 0x00000000 }, |
391 | { 0x0017c8, 2, 0x04, 0x00000000 }, |
392 | { 0x0017d0, 1, 0x04, 0x000000ff }, |
393 | { 0x0017d4, 1, 0x04, 0xffffffff }, |
394 | { 0x0017d8, 1, 0x04, 0x00000002 }, |
395 | { 0x0017dc, 1, 0x04, 0x00000000 }, |
396 | { 0x0015f4, 2, 0x04, 0x00000000 }, |
397 | { 0x001434, 2, 0x04, 0x00000000 }, |
398 | { 0x000d74, 1, 0x04, 0x00000000 }, |
399 | { 0x000dec, 1, 0x04, 0x00000001 }, |
400 | { 0x0013a4, 1, 0x04, 0x00000000 }, |
401 | { 0x001318, 1, 0x04, 0x00000001 }, |
402 | { 0x001644, 1, 0x04, 0x00000000 }, |
403 | { 0x000748, 1, 0x04, 0x00000000 }, |
404 | { 0x000de8, 1, 0x04, 0x00000000 }, |
405 | { 0x001648, 1, 0x04, 0x00000000 }, |
406 | { 0x0012a4, 1, 0x04, 0x00000000 }, |
407 | { 0x001120, 4, 0x04, 0x00000000 }, |
408 | { 0x001118, 1, 0x04, 0x00000000 }, |
409 | { 0x00164c, 1, 0x04, 0x00000000 }, |
410 | { 0x001658, 1, 0x04, 0x00000000 }, |
411 | { 0x001910, 1, 0x04, 0x00000290 }, |
412 | { 0x001518, 1, 0x04, 0x00000000 }, |
413 | { 0x00165c, 1, 0x04, 0x00000001 }, |
414 | { 0x001520, 1, 0x04, 0x00000000 }, |
415 | { 0x001604, 1, 0x04, 0x00000000 }, |
416 | { 0x001570, 1, 0x04, 0x00000000 }, |
417 | { 0x0013b0, 2, 0x04, 0x3f800000 }, |
418 | { 0x00020c, 1, 0x04, 0x00000000 }, |
419 | { 0x001670, 1, 0x04, 0x30201000 }, |
420 | { 0x001674, 1, 0x04, 0x70605040 }, |
421 | { 0x001678, 1, 0x04, 0xb8a89888 }, |
422 | { 0x00167c, 1, 0x04, 0xf8e8d8c8 }, |
423 | { 0x00166c, 1, 0x04, 0x00000000 }, |
424 | { 0x001680, 1, 0x04, 0x00ffff00 }, |
425 | { 0x0012d0, 1, 0x04, 0x00000003 }, |
426 | { 0x0012d4, 1, 0x04, 0x00000002 }, |
427 | { 0x001684, 2, 0x04, 0x00000000 }, |
428 | { 0x000dac, 2, 0x04, 0x00001b02 }, |
429 | { 0x000db4, 1, 0x04, 0x00000000 }, |
430 | { 0x00168c, 1, 0x04, 0x00000000 }, |
431 | { 0x0015bc, 1, 0x04, 0x00000000 }, |
432 | { 0x00156c, 1, 0x04, 0x00000000 }, |
433 | { 0x00187c, 1, 0x04, 0x00000000 }, |
434 | { 0x001110, 1, 0x04, 0x00000001 }, |
435 | { 0x000dc0, 3, 0x04, 0x00000000 }, |
436 | { 0x001234, 1, 0x04, 0x00000000 }, |
437 | { 0x001690, 1, 0x04, 0x00000000 }, |
438 | { 0x0012ac, 1, 0x04, 0x00000001 }, |
439 | { 0x0002c4, 1, 0x04, 0x00000000 }, |
440 | { 0x000790, 5, 0x04, 0x00000000 }, |
441 | { 0x00077c, 1, 0x04, 0x00000000 }, |
442 | { 0x001000, 1, 0x04, 0x00000010 }, |
443 | { 0x0010fc, 1, 0x04, 0x00000000 }, |
444 | { 0x001290, 1, 0x04, 0x00000000 }, |
445 | { 0x000218, 1, 0x04, 0x00000010 }, |
446 | { 0x0012d8, 1, 0x04, 0x00000000 }, |
447 | { 0x0012dc, 1, 0x04, 0x00000010 }, |
448 | { 0x000d94, 1, 0x04, 0x00000001 }, |
449 | { 0x00155c, 2, 0x04, 0x00000000 }, |
450 | { 0x001564, 1, 0x04, 0x00001fff }, |
451 | { 0x001574, 2, 0x04, 0x00000000 }, |
452 | { 0x00157c, 1, 0x04, 0x003fffff }, |
453 | { 0x001354, 1, 0x04, 0x00000000 }, |
454 | { 0x001664, 1, 0x04, 0x00000000 }, |
455 | { 0x001610, 1, 0x04, 0x00000012 }, |
456 | { 0x001608, 2, 0x04, 0x00000000 }, |
457 | { 0x00162c, 1, 0x04, 0x00000003 }, |
458 | { 0x000210, 1, 0x04, 0x00000000 }, |
459 | { 0x000320, 1, 0x04, 0x00000000 }, |
460 | { 0x000324, 6, 0x04, 0x3f800000 }, |
461 | { 0x000750, 1, 0x04, 0x00000000 }, |
462 | { 0x000760, 1, 0x04, 0x39291909 }, |
463 | { 0x000764, 1, 0x04, 0x79695949 }, |
464 | { 0x000768, 1, 0x04, 0xb9a99989 }, |
465 | { 0x00076c, 1, 0x04, 0xf9e9d9c9 }, |
466 | { 0x000770, 1, 0x04, 0x30201000 }, |
467 | { 0x000774, 1, 0x04, 0x70605040 }, |
468 | { 0x000778, 1, 0x04, 0x00009080 }, |
469 | { 0x000780, 1, 0x04, 0x39291909 }, |
470 | { 0x000784, 1, 0x04, 0x79695949 }, |
471 | { 0x000788, 1, 0x04, 0xb9a99989 }, |
472 | { 0x00078c, 1, 0x04, 0xf9e9d9c9 }, |
473 | { 0x0007d0, 1, 0x04, 0x30201000 }, |
474 | { 0x0007d4, 1, 0x04, 0x70605040 }, |
475 | { 0x0007d8, 1, 0x04, 0x00009080 }, |
476 | { 0x00037c, 1, 0x04, 0x00000001 }, |
477 | { 0x000740, 2, 0x04, 0x00000000 }, |
478 | { 0x002600, 1, 0x04, 0x00000000 }, |
479 | { 0x001918, 1, 0x04, 0x00000000 }, |
480 | { 0x00191c, 1, 0x04, 0x00000900 }, |
481 | { 0x001920, 1, 0x04, 0x00000405 }, |
482 | { 0x001308, 1, 0x04, 0x00000001 }, |
483 | { 0x001924, 1, 0x04, 0x00000000 }, |
484 | { 0x0013ac, 1, 0x04, 0x00000000 }, |
485 | { 0x00192c, 1, 0x04, 0x00000001 }, |
486 | { 0x00193c, 1, 0x04, 0x00002c1c }, |
487 | { 0x000d7c, 1, 0x04, 0x00000000 }, |
488 | { 0x000f8c, 1, 0x04, 0x00000000 }, |
489 | { 0x0002c0, 1, 0x04, 0x00000001 }, |
490 | { 0x001510, 1, 0x04, 0x00000000 }, |
491 | { 0x001940, 1, 0x04, 0x00000000 }, |
492 | { 0x000ff4, 2, 0x04, 0x00000000 }, |
493 | { 0x00194c, 2, 0x04, 0x00000000 }, |
494 | { 0x001968, 1, 0x04, 0x00000000 }, |
495 | { 0x001590, 1, 0x04, 0x0000003f }, |
496 | { 0x0007e8, 4, 0x04, 0x00000000 }, |
497 | { 0x00196c, 1, 0x04, 0x00000011 }, |
498 | { 0x00197c, 1, 0x04, 0x00000000 }, |
499 | { 0x000fcc, 2, 0x04, 0x00000000 }, |
500 | { 0x0002d8, 1, 0x04, 0x00000040 }, |
501 | { 0x001980, 1, 0x04, 0x00000080 }, |
502 | { 0x001504, 1, 0x04, 0x00000080 }, |
503 | { 0x001984, 1, 0x04, 0x00000000 }, |
504 | { 0x000300, 1, 0x04, 0x00000001 }, |
505 | { 0x0013a8, 1, 0x04, 0x00000000 }, |
506 | { 0x0012ec, 1, 0x04, 0x00000000 }, |
507 | { 0x001310, 1, 0x04, 0x00000000 }, |
508 | { 0x001314, 1, 0x04, 0x00000001 }, |
509 | { 0x001380, 1, 0x04, 0x00000000 }, |
510 | { 0x001384, 4, 0x04, 0x00000001 }, |
511 | { 0x001394, 1, 0x04, 0x00000000 }, |
512 | { 0x00139c, 1, 0x04, 0x00000000 }, |
513 | { 0x001398, 1, 0x04, 0x00000000 }, |
514 | { 0x001594, 1, 0x04, 0x00000000 }, |
515 | { 0x001598, 4, 0x04, 0x00000001 }, |
516 | { 0x000f54, 3, 0x04, 0x00000000 }, |
517 | { 0x0019bc, 1, 0x04, 0x00000000 }, |
518 | { 0x000f9c, 2, 0x04, 0x00000000 }, |
519 | { 0x0012cc, 1, 0x04, 0x00000000 }, |
520 | { 0x0012e8, 1, 0x04, 0x00000000 }, |
521 | { 0x00130c, 1, 0x04, 0x00000001 }, |
522 | { 0x001360, 8, 0x04, 0x00000000 }, |
523 | { 0x00133c, 2, 0x04, 0x00000001 }, |
524 | { 0x001344, 1, 0x04, 0x00000002 }, |
525 | { 0x001348, 2, 0x04, 0x00000001 }, |
526 | { 0x001350, 1, 0x04, 0x00000002 }, |
527 | { 0x001358, 1, 0x04, 0x00000001 }, |
528 | { 0x0012e4, 1, 0x04, 0x00000000 }, |
529 | { 0x00131c, 4, 0x04, 0x00000000 }, |
530 | { 0x0019c0, 1, 0x04, 0x00000000 }, |
531 | { 0x001140, 1, 0x04, 0x00000000 }, |
532 | { 0x0019c4, 1, 0x04, 0x00000000 }, |
533 | { 0x0019c8, 1, 0x04, 0x00001500 }, |
534 | { 0x00135c, 1, 0x04, 0x00000000 }, |
535 | { 0x000f90, 1, 0x04, 0x00000000 }, |
536 | { 0x0019e0, 8, 0x04, 0x00000001 }, |
537 | { 0x0019cc, 1, 0x04, 0x00000001 }, |
538 | { 0x0015b8, 1, 0x04, 0x00000000 }, |
539 | { 0x001a00, 1, 0x04, 0x00001111 }, |
540 | { 0x001a04, 7, 0x04, 0x00000000 }, |
541 | { 0x000d6c, 2, 0x04, 0xffff0000 }, |
542 | { 0x0010f8, 1, 0x04, 0x00001010 }, |
543 | { 0x000d80, 5, 0x04, 0x00000000 }, |
544 | { 0x000da0, 1, 0x04, 0x00000000 }, |
545 | { 0x001508, 1, 0x04, 0x80000000 }, |
546 | { 0x00150c, 1, 0x04, 0x40000000 }, |
547 | { 0x001668, 1, 0x04, 0x00000000 }, |
548 | { 0x000318, 2, 0x04, 0x00000008 }, |
549 | { 0x000d9c, 1, 0x04, 0x00000001 }, |
550 | { 0x0007dc, 1, 0x04, 0x00000000 }, |
551 | { 0x00074c, 1, 0x04, 0x00000055 }, |
552 | { 0x001420, 1, 0x04, 0x00000003 }, |
553 | { 0x0017bc, 2, 0x04, 0x00000000 }, |
554 | { 0x0017c4, 1, 0x04, 0x00000001 }, |
555 | { 0x001008, 1, 0x04, 0x00000008 }, |
556 | { 0x00100c, 1, 0x04, 0x00000040 }, |
557 | { 0x001010, 1, 0x04, 0x0000012c }, |
558 | { 0x000d60, 1, 0x04, 0x00000040 }, |
559 | { 0x00075c, 1, 0x04, 0x00000003 }, |
560 | { 0x001018, 1, 0x04, 0x00000020 }, |
561 | { 0x00101c, 1, 0x04, 0x00000001 }, |
562 | { 0x001020, 1, 0x04, 0x00000020 }, |
563 | { 0x001024, 1, 0x04, 0x00000001 }, |
564 | { 0x001444, 3, 0x04, 0x00000000 }, |
565 | { 0x000360, 1, 0x04, 0x20164010 }, |
566 | { 0x000364, 1, 0x04, 0x00000020 }, |
567 | { 0x000368, 1, 0x04, 0x00000000 }, |
568 | { 0x000de4, 1, 0x04, 0x00000000 }, |
569 | { 0x000204, 1, 0x04, 0x00000006 }, |
570 | { 0x000208, 1, 0x04, 0x00000000 }, |
571 | { 0x0002cc, 1, 0x04, 0x003fffff }, |
572 | { 0x0002d0, 1, 0x04, 0x00000c48 }, |
573 | { 0x001220, 1, 0x04, 0x00000005 }, |
574 | { 0x000fdc, 1, 0x04, 0x00000000 }, |
575 | { 0x000f98, 1, 0x04, 0x00300008 }, |
576 | { 0x001284, 1, 0x04, 0x04000080 }, |
577 | { 0x001450, 1, 0x04, 0x00300008 }, |
578 | { 0x001454, 1, 0x04, 0x04000080 }, |
579 | { 0x000214, 1, 0x04, 0x00000000 }, |
580 | {} |
581 | }; |
582 | |
583 | const struct nvc0_graph_init |
584 | nvc0_grctx_init_902d_0[] = { |
585 | { 0x000200, 1, 0x04, 0x000000cf }, |
586 | { 0x000204, 1, 0x04, 0x00000001 }, |
587 | { 0x000208, 1, 0x04, 0x00000020 }, |
588 | { 0x00020c, 1, 0x04, 0x00000001 }, |
589 | { 0x000210, 1, 0x04, 0x00000000 }, |
590 | { 0x000214, 1, 0x04, 0x00000080 }, |
591 | { 0x000218, 2, 0x04, 0x00000100 }, |
592 | { 0x000220, 2, 0x04, 0x00000000 }, |
593 | { 0x000230, 1, 0x04, 0x000000cf }, |
594 | { 0x000234, 1, 0x04, 0x00000001 }, |
595 | { 0x000238, 1, 0x04, 0x00000020 }, |
596 | { 0x00023c, 1, 0x04, 0x00000001 }, |
597 | { 0x000244, 1, 0x04, 0x00000080 }, |
598 | { 0x000248, 2, 0x04, 0x00000100 }, |
599 | {} |
600 | }; |
601 | |
602 | const struct nvc0_graph_init |
603 | nvc0_grctx_init_9039_0[] = { |
604 | { 0x00030c, 3, 0x04, 0x00000000 }, |
605 | { 0x000320, 1, 0x04, 0x00000000 }, |
606 | { 0x000238, 2, 0x04, 0x00000000 }, |
607 | { 0x000318, 2, 0x04, 0x00000000 }, |
608 | {} |
609 | }; |
610 | |
611 | const struct nvc0_graph_init |
612 | nvc0_grctx_init_90c0_0[] = { |
613 | { 0x00270c, 8, 0x20, 0x00000000 }, |
614 | { 0x00030c, 1, 0x04, 0x00000001 }, |
615 | { 0x001944, 1, 0x04, 0x00000000 }, |
616 | { 0x000758, 1, 0x04, 0x00000100 }, |
617 | { 0x0002c4, 1, 0x04, 0x00000000 }, |
618 | { 0x000790, 5, 0x04, 0x00000000 }, |
619 | { 0x00077c, 1, 0x04, 0x00000000 }, |
620 | { 0x000204, 3, 0x04, 0x00000000 }, |
621 | { 0x000214, 1, 0x04, 0x00000000 }, |
622 | { 0x00024c, 1, 0x04, 0x00000000 }, |
623 | { 0x000d94, 1, 0x04, 0x00000001 }, |
624 | { 0x001608, 2, 0x04, 0x00000000 }, |
625 | { 0x001664, 1, 0x04, 0x00000000 }, |
626 | {} |
627 | }; |
628 | |
629 | const struct nvc0_graph_pack |
630 | nvc0_grctx_pack_mthd[] = { |
631 | { nvc0_grctx_init_9097_0, 0x9097 }, |
632 | { nvc0_grctx_init_902d_0, 0x902d }, |
633 | { nvc0_grctx_init_9039_0, 0x9039 }, |
634 | { nvc0_grctx_init_90c0_0, 0x90c0 }, |
635 | {} |
636 | }; |
637 | |
638 | const struct nvc0_graph_init |
639 | nvc0_grctx_init_main_0[] = { |
640 | { 0x400204, 2, 0x04, 0x00000000 }, |
641 | {} |
642 | }; |
643 | |
644 | const struct nvc0_graph_init |
645 | nvc0_grctx_init_fe_0[] = { |
646 | { 0x404004, 11, 0x04, 0x00000000 }, |
647 | { 0x404044, 1, 0x04, 0x00000000 }, |
648 | { 0x404094, 13, 0x04, 0x00000000 }, |
649 | { 0x4040c8, 1, 0x04, 0xf0000087 }, |
650 | { 0x4040d0, 6, 0x04, 0x00000000 }, |
651 | { 0x4040e8, 1, 0x04, 0x00001000 }, |
652 | { 0x4040f8, 1, 0x04, 0x00000000 }, |
653 | { 0x404130, 2, 0x04, 0x00000000 }, |
654 | { 0x404138, 1, 0x04, 0x20000040 }, |
655 | { 0x404150, 1, 0x04, 0x0000002e }, |
656 | { 0x404154, 1, 0x04, 0x00000400 }, |
657 | { 0x404158, 1, 0x04, 0x00000200 }, |
658 | { 0x404164, 1, 0x04, 0x00000055 }, |
659 | { 0x404168, 1, 0x04, 0x00000000 }, |
660 | { 0x404174, 3, 0x04, 0x00000000 }, |
661 | { 0x404200, 8, 0x04, 0x00000000 }, |
662 | {} |
663 | }; |
664 | |
665 | const struct nvc0_graph_init |
666 | nvc0_grctx_init_pri_0[] = { |
667 | { 0x404404, 14, 0x04, 0x00000000 }, |
668 | { 0x404460, 2, 0x04, 0x00000000 }, |
669 | { 0x404468, 1, 0x04, 0x00ffffff }, |
670 | { 0x40446c, 1, 0x04, 0x00000000 }, |
671 | { 0x404480, 1, 0x04, 0x00000001 }, |
672 | { 0x404498, 1, 0x04, 0x00000001 }, |
673 | {} |
674 | }; |
675 | |
676 | const struct nvc0_graph_init |
677 | nvc0_grctx_init_memfmt_0[] = { |
678 | { 0x404604, 1, 0x04, 0x00000015 }, |
679 | { 0x404608, 1, 0x04, 0x00000000 }, |
680 | { 0x40460c, 1, 0x04, 0x00002e00 }, |
681 | { 0x404610, 1, 0x04, 0x00000100 }, |
682 | { 0x404618, 8, 0x04, 0x00000000 }, |
683 | { 0x404638, 1, 0x04, 0x00000004 }, |
684 | { 0x40463c, 8, 0x04, 0x00000000 }, |
685 | { 0x40465c, 1, 0x04, 0x007f0100 }, |
686 | { 0x404660, 7, 0x04, 0x00000000 }, |
687 | { 0x40467c, 1, 0x04, 0x00000002 }, |
688 | { 0x404680, 8, 0x04, 0x00000000 }, |
689 | { 0x4046a0, 1, 0x04, 0x007f0080 }, |
690 | { 0x4046a4, 18, 0x04, 0x00000000 }, |
691 | { 0x4046f0, 2, 0x04, 0x00000000 }, |
692 | { 0x404700, 13, 0x04, 0x00000000 }, |
693 | { 0x404734, 1, 0x04, 0x00000100 }, |
694 | { 0x404738, 8, 0x04, 0x00000000 }, |
695 | {} |
696 | }; |
697 | |
698 | static const struct nvc0_graph_init |
699 | nvc0_grctx_init_ds_0[] = { |
700 | { 0x405800, 1, 0x04, 0x078000bf }, |
701 | { 0x405830, 1, 0x04, 0x02180000 }, |
702 | { 0x405834, 2, 0x04, 0x00000000 }, |
703 | { 0x405854, 1, 0x04, 0x00000000 }, |
704 | { 0x405870, 4, 0x04, 0x00000001 }, |
705 | { 0x405a00, 2, 0x04, 0x00000000 }, |
706 | { 0x405a18, 1, 0x04, 0x00000000 }, |
707 | {} |
708 | }; |
709 | |
710 | static const struct nvc0_graph_init |
711 | nvc0_grctx_init_pd_0[] = { |
712 | { 0x406020, 1, 0x04, 0x000103c1 }, |
713 | { 0x406028, 4, 0x04, 0x00000001 }, |
714 | { 0x4064a8, 1, 0x04, 0x00000000 }, |
715 | { 0x4064ac, 1, 0x04, 0x00003fff }, |
716 | { 0x4064b4, 2, 0x04, 0x00000000 }, |
717 | {} |
718 | }; |
719 | |
720 | const struct nvc0_graph_init |
721 | nvc0_grctx_init_rstr2d_0[] = { |
722 | { 0x407804, 1, 0x04, 0x00000023 }, |
723 | { 0x40780c, 1, 0x04, 0x0a418820 }, |
724 | { 0x407810, 1, 0x04, 0x062080e6 }, |
725 | { 0x407814, 1, 0x04, 0x020398a4 }, |
726 | { 0x407818, 1, 0x04, 0x0e629062 }, |
727 | { 0x40781c, 1, 0x04, 0x0a418820 }, |
728 | { 0x407820, 1, 0x04, 0x000000e6 }, |
729 | { 0x4078bc, 1, 0x04, 0x00000103 }, |
730 | {} |
731 | }; |
732 | |
733 | const struct nvc0_graph_init |
734 | nvc0_grctx_init_scc_0[] = { |
735 | { 0x408000, 2, 0x04, 0x00000000 }, |
736 | { 0x408008, 1, 0x04, 0x00000018 }, |
737 | { 0x40800c, 2, 0x04, 0x00000000 }, |
738 | { 0x408014, 1, 0x04, 0x00000069 }, |
739 | { 0x408018, 1, 0x04, 0xe100e100 }, |
740 | { 0x408064, 1, 0x04, 0x00000000 }, |
741 | {} |
742 | }; |
743 | |
744 | static const struct nvc0_graph_init |
745 | nvc0_grctx_init_be_0[] = { |
746 | { 0x408800, 1, 0x04, 0x02802a3c }, |
747 | { 0x408804, 1, 0x04, 0x00000040 }, |
748 | { 0x408808, 1, 0x04, 0x0003e00d }, |
749 | { 0x408900, 1, 0x04, 0x3080b801 }, |
750 | { 0x408904, 1, 0x04, 0x02000001 }, |
751 | { 0x408908, 1, 0x04, 0x00c80929 }, |
752 | { 0x408980, 1, 0x04, 0x0000011d }, |
753 | {} |
754 | }; |
755 | |
756 | const struct nvc0_graph_pack |
757 | nvc0_grctx_pack_hub[] = { |
758 | { nvc0_grctx_init_main_0 }, |
759 | { nvc0_grctx_init_fe_0 }, |
760 | { nvc0_grctx_init_pri_0 }, |
761 | { nvc0_grctx_init_memfmt_0 }, |
762 | { nvc0_grctx_init_ds_0 }, |
763 | { nvc0_grctx_init_pd_0 }, |
764 | { nvc0_grctx_init_rstr2d_0 }, |
765 | { nvc0_grctx_init_scc_0 }, |
766 | { nvc0_grctx_init_be_0 }, |
767 | {} |
768 | }; |
769 | |
770 | const struct nvc0_graph_init |
771 | nvc0_grctx_init_gpc_unk_0[] = { |
772 | { 0x418380, 1, 0x04, 0x00000016 }, |
773 | {} |
774 | }; |
775 | |
776 | const struct nvc0_graph_init |
777 | nvc0_grctx_init_prop_0[] = { |
778 | { 0x418400, 1, 0x04, 0x38004e00 }, |
779 | { 0x418404, 1, 0x04, 0x71e0ffff }, |
780 | { 0x418408, 1, 0x04, 0x00000000 }, |
781 | { 0x41840c, 1, 0x04, 0x00001008 }, |
782 | { 0x418410, 1, 0x04, 0x0fff0fff }, |
783 | { 0x418414, 1, 0x04, 0x00200fff }, |
784 | { 0x418450, 6, 0x04, 0x00000000 }, |
785 | { 0x418468, 1, 0x04, 0x00000001 }, |
786 | { 0x41846c, 2, 0x04, 0x00000000 }, |
787 | {} |
788 | }; |
789 | |
790 | const struct nvc0_graph_init |
791 | nvc0_grctx_init_gpc_unk_1[] = { |
792 | { 0x418600, 1, 0x04, 0x0000001f }, |
793 | { 0x418684, 1, 0x04, 0x0000000f }, |
794 | { 0x418700, 1, 0x04, 0x00000002 }, |
795 | { 0x418704, 1, 0x04, 0x00000080 }, |
796 | { 0x418708, 1, 0x04, 0x00000000 }, |
797 | { 0x41870c, 1, 0x04, 0x07c80000 }, |
798 | { 0x418710, 1, 0x04, 0x00000000 }, |
799 | {} |
800 | }; |
801 | |
802 | static const struct nvc0_graph_init |
803 | nvc0_grctx_init_setup_0[] = { |
804 | { 0x418800, 1, 0x04, 0x0006860a }, |
805 | { 0x418808, 3, 0x04, 0x00000000 }, |
806 | { 0x418828, 1, 0x04, 0x00008442 }, |
807 | { 0x418830, 1, 0x04, 0x00000001 }, |
808 | { 0x4188d8, 1, 0x04, 0x00000008 }, |
809 | { 0x4188e0, 1, 0x04, 0x01000000 }, |
810 | { 0x4188e8, 5, 0x04, 0x00000000 }, |
811 | { 0x4188fc, 1, 0x04, 0x00100000 }, |
812 | {} |
813 | }; |
814 | |
815 | const struct nvc0_graph_init |
816 | nvc0_grctx_init_zcull_0[] = { |
817 | { 0x41891c, 1, 0x04, 0x00ff00ff }, |
818 | { 0x418924, 1, 0x04, 0x00000000 }, |
819 | { 0x418928, 1, 0x04, 0x00ffff00 }, |
820 | { 0x41892c, 1, 0x04, 0x0000ff00 }, |
821 | {} |
822 | }; |
823 | |
824 | const struct nvc0_graph_init |
825 | nvc0_grctx_init_crstr_0[] = { |
826 | { 0x418b00, 1, 0x04, 0x00000000 }, |
827 | { 0x418b08, 1, 0x04, 0x0a418820 }, |
828 | { 0x418b0c, 1, 0x04, 0x062080e6 }, |
829 | { 0x418b10, 1, 0x04, 0x020398a4 }, |
830 | { 0x418b14, 1, 0x04, 0x0e629062 }, |
831 | { 0x418b18, 1, 0x04, 0x0a418820 }, |
832 | { 0x418b1c, 1, 0x04, 0x000000e6 }, |
833 | { 0x418bb8, 1, 0x04, 0x00000103 }, |
834 | {} |
835 | }; |
836 | |
837 | const struct nvc0_graph_init |
838 | nvc0_grctx_init_gpm_0[] = { |
839 | { 0x418c08, 1, 0x04, 0x00000001 }, |
840 | { 0x418c10, 8, 0x04, 0x00000000 }, |
841 | { 0x418c80, 1, 0x04, 0x20200004 }, |
842 | { 0x418c8c, 1, 0x04, 0x00000001 }, |
843 | {} |
844 | }; |
845 | |
846 | const struct nvc0_graph_init |
847 | nvc0_grctx_init_gcc_0[] = { |
848 | { 0x419000, 1, 0x04, 0x00000780 }, |
849 | { 0x419004, 2, 0x04, 0x00000000 }, |
850 | { 0x419014, 1, 0x04, 0x00000004 }, |
851 | {} |
852 | }; |
853 | |
854 | const struct nvc0_graph_pack |
855 | nvc0_grctx_pack_gpc[] = { |
856 | { nvc0_grctx_init_gpc_unk_0 }, |
857 | { nvc0_grctx_init_prop_0 }, |
858 | { nvc0_grctx_init_gpc_unk_1 }, |
859 | { nvc0_grctx_init_setup_0 }, |
860 | { nvc0_grctx_init_zcull_0 }, |
861 | { nvc0_grctx_init_crstr_0 }, |
862 | { nvc0_grctx_init_gpm_0 }, |
863 | { nvc0_grctx_init_gcc_0 }, |
864 | {} |
865 | }; |
866 | |
867 | static const struct nvc0_graph_init |
868 | nvc0_grctx_init_zcullr_0[] = { |
869 | { 0x418a00, 3, 0x04, 0x00000000 }, |
870 | { 0x418a0c, 1, 0x04, 0x00010000 }, |
871 | { 0x418a10, 3, 0x04, 0x00000000 }, |
872 | { 0x418a20, 3, 0x04, 0x00000000 }, |
873 | { 0x418a2c, 1, 0x04, 0x00010000 }, |
874 | { 0x418a30, 3, 0x04, 0x00000000 }, |
875 | { 0x418a40, 3, 0x04, 0x00000000 }, |
876 | { 0x418a4c, 1, 0x04, 0x00010000 }, |
877 | { 0x418a50, 3, 0x04, 0x00000000 }, |
878 | { 0x418a60, 3, 0x04, 0x00000000 }, |
879 | { 0x418a6c, 1, 0x04, 0x00010000 }, |
880 | { 0x418a70, 3, 0x04, 0x00000000 }, |
881 | { 0x418a80, 3, 0x04, 0x00000000 }, |
882 | { 0x418a8c, 1, 0x04, 0x00010000 }, |
883 | { 0x418a90, 3, 0x04, 0x00000000 }, |
884 | { 0x418aa0, 3, 0x04, 0x00000000 }, |
885 | { 0x418aac, 1, 0x04, 0x00010000 }, |
886 | { 0x418ab0, 3, 0x04, 0x00000000 }, |
887 | { 0x418ac0, 3, 0x04, 0x00000000 }, |
888 | { 0x418acc, 1, 0x04, 0x00010000 }, |
889 | { 0x418ad0, 3, 0x04, 0x00000000 }, |
890 | { 0x418ae0, 3, 0x04, 0x00000000 }, |
891 | { 0x418aec, 1, 0x04, 0x00010000 }, |
892 | { 0x418af0, 3, 0x04, 0x00000000 }, |
893 | {} |
894 | }; |
895 | |
896 | const struct nvc0_graph_pack |
897 | nvc0_grctx_pack_zcull[] = { |
898 | { nvc0_grctx_init_zcullr_0 }, |
899 | {} |
900 | }; |
901 | |
902 | const struct nvc0_graph_init |
903 | nvc0_grctx_init_pe_0[] = { |
904 | { 0x419818, 1, 0x04, 0x00000000 }, |
905 | { 0x41983c, 1, 0x04, 0x00038bc7 }, |
906 | { 0x419848, 1, 0x04, 0x00000000 }, |
907 | { 0x419864, 1, 0x04, 0x0000012a }, |
908 | { 0x419888, 1, 0x04, 0x00000000 }, |
909 | {} |
910 | }; |
911 | |
912 | static const struct nvc0_graph_init |
913 | nvc0_grctx_init_tex_0[] = { |
914 | { 0x419a00, 1, 0x04, 0x000001f0 }, |
915 | { 0x419a04, 1, 0x04, 0x00000001 }, |
916 | { 0x419a08, 1, 0x04, 0x00000023 }, |
917 | { 0x419a0c, 1, 0x04, 0x00020000 }, |
918 | { 0x419a10, 1, 0x04, 0x00000000 }, |
919 | { 0x419a14, 1, 0x04, 0x00000200 }, |
920 | {} |
921 | }; |
922 | |
923 | const struct nvc0_graph_init |
924 | nvc0_grctx_init_wwdx_0[] = { |
925 | { 0x419b00, 1, 0x04, 0x0a418820 }, |
926 | { 0x419b04, 1, 0x04, 0x062080e6 }, |
927 | { 0x419b08, 1, 0x04, 0x020398a4 }, |
928 | { 0x419b0c, 1, 0x04, 0x0e629062 }, |
929 | { 0x419b10, 1, 0x04, 0x0a418820 }, |
930 | { 0x419b14, 1, 0x04, 0x000000e6 }, |
931 | { 0x419bd0, 1, 0x04, 0x00900103 }, |
932 | { 0x419be0, 1, 0x04, 0x00000001 }, |
933 | { 0x419be4, 1, 0x04, 0x00000000 }, |
934 | {} |
935 | }; |
936 | |
937 | const struct nvc0_graph_init |
938 | nvc0_grctx_init_mpc_0[] = { |
939 | { 0x419c00, 1, 0x04, 0x00000002 }, |
940 | { 0x419c04, 1, 0x04, 0x00000006 }, |
941 | { 0x419c08, 1, 0x04, 0x00000002 }, |
942 | { 0x419c20, 1, 0x04, 0x00000000 }, |
943 | {} |
944 | }; |
945 | |
946 | static const struct nvc0_graph_init |
947 | nvc0_grctx_init_l1c_0[] = { |
948 | { 0x419cb0, 1, 0x04, 0x00060048 }, |
949 | { 0x419ce8, 1, 0x04, 0x00000000 }, |
950 | { 0x419cf4, 1, 0x04, 0x00000183 }, |
951 | {} |
952 | }; |
953 | |
954 | const struct nvc0_graph_init |
955 | nvc0_grctx_init_tpccs_0[] = { |
956 | { 0x419d20, 1, 0x04, 0x02180000 }, |
957 | { 0x419d24, 1, 0x04, 0x00001fff }, |
958 | {} |
959 | }; |
960 | |
961 | static const struct nvc0_graph_init |
962 | nvc0_grctx_init_sm_0[] = { |
963 | { 0x419e04, 3, 0x04, 0x00000000 }, |
964 | { 0x419e10, 1, 0x04, 0x00000002 }, |
965 | { 0x419e44, 1, 0x04, 0x001beff2 }, |
966 | { 0x419e48, 1, 0x04, 0x00000000 }, |
967 | { 0x419e4c, 1, 0x04, 0x0000000f }, |
968 | { 0x419e50, 17, 0x04, 0x00000000 }, |
969 | { 0x419e98, 1, 0x04, 0x00000000 }, |
970 | { 0x419f50, 2, 0x04, 0x00000000 }, |
971 | {} |
972 | }; |
973 | |
974 | const struct nvc0_graph_pack |
975 | nvc0_grctx_pack_tpc[] = { |
976 | { nvc0_grctx_init_pe_0 }, |
977 | { nvc0_grctx_init_tex_0 }, |
978 | { nvc0_grctx_init_wwdx_0 }, |
979 | { nvc0_grctx_init_mpc_0 }, |
980 | { nvc0_grctx_init_l1c_0 }, |
981 | { nvc0_grctx_init_tpccs_0 }, |
982 | { nvc0_grctx_init_sm_0 }, |
983 | {} |
984 | }; |
985 | |
986 | /******************************************************************************* |
987 | * PGRAPH context implementation |
988 | ******************************************************************************/ |
989 | |
990 | void |
991 | nvc0_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) |
992 | { |
993 | int gpc, tpc; |
994 | u32 offset; |
995 | |
996 | mmio_data(0x002000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); |
997 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); |
998 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
999 | |
1000 | mmio_list(0x408004, 0x00000000, 8, 0); |
1001 | mmio_list(0x408008, 0x80000018, 0, 0); |
1002 | mmio_list(0x40800c, 0x00000000, 8, 1); |
1003 | mmio_list(0x408010, 0x80000000, 0, 0); |
1004 | mmio_list(0x418810, 0x80000000, 12, 2); |
1005 | mmio_list(0x419848, 0x10000000, 12, 2); |
1006 | mmio_list(0x419004, 0x00000000, 8, 1); |
1007 | mmio_list(0x419008, 0x00000000, 0, 0); |
1008 | mmio_list(0x418808, 0x00000000, 8, 0); |
1009 | mmio_list(0x41880c, 0x80000018, 0, 0); |
1010 | |
1011 | mmio_list(0x405830, 0x02180000, 0, 0); |
1012 | |
1013 | for (gpc = 0, offset = 0; gpc < priv->gpc_nr; gpc++) { |
1014 | for (tpc = 0; tpc < priv->tpc_nr[gpc]; tpc++) { |
1015 | u32 addr = TPC_UNIT(gpc, tpc, 0x0520); |
1016 | mmio_list(addr, 0x02180000 | offset, 0, 0); |
1017 | offset += 0x0324; |
1018 | } |
1019 | } |
1020 | } |
1021 | |
1022 | void |
1023 | nvc0_grctx_generate_unkn(struct nvc0_graph_priv *priv) |
1024 | { |
1025 | } |
1026 | |
1027 | void |
1028 | nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *priv) |
1029 | { |
1030 | int gpc, tpc, id; |
1031 | |
1032 | for (tpc = 0, id = 0; tpc < 4; tpc++) { |
1033 | for (gpc = 0; gpc < priv->gpc_nr; gpc++) { |
1034 | if (tpc < priv->tpc_nr[gpc]) { |
1035 | nv_wr32(priv, TPC_UNIT(gpc, tpc, 0x698), id); |
1036 | nv_wr32(priv, TPC_UNIT(gpc, tpc, 0x4e8), id); |
1037 | nv_wr32(priv, GPC_UNIT(gpc, 0x0c10 + tpc * 4), id); |
1038 | nv_wr32(priv, TPC_UNIT(gpc, tpc, 0x088), id); |
1039 | id++; |
1040 | } |
1041 | |
1042 | nv_wr32(priv, GPC_UNIT(gpc, 0x0c08), priv->tpc_nr[gpc]); |
1043 | nv_wr32(priv, GPC_UNIT(gpc, 0x0c8c), priv->tpc_nr[gpc]); |
1044 | } |
1045 | } |
1046 | } |
1047 | |
1048 | void |
1049 | nvc0_grctx_generate_r406028(struct nvc0_graph_priv *priv) |
1050 | { |
1051 | u32 tmp[GPC_MAX / 8] = {}, i = 0; |
1052 | for (i = 0; i < priv->gpc_nr; i++) |
1053 | tmp[i / 8] |= priv->tpc_nr[i] << ((i % 8) * 4); |
1054 | for (i = 0; i < 4; i++) { |
1055 | nv_wr32(priv, 0x406028 + (i * 4), tmp[i]); |
1056 | nv_wr32(priv, 0x405870 + (i * 4), tmp[i]); |
1057 | } |
1058 | } |
1059 | |
1060 | void |
1061 | nvc0_grctx_generate_r4060a8(struct nvc0_graph_priv *priv) |
1062 | { |
1063 | u8 tpcnr[GPC_MAX], data[TPC_MAX]; |
1064 | int gpc, tpc, i; |
1065 | |
1066 | memcpy(tpcnr, priv->tpc_nr, sizeof(priv->tpc_nr)); |
1067 | memset(data, 0x1f, sizeof(data)); |
1068 | |
1069 | gpc = -1; |
1070 | for (tpc = 0; tpc < priv->tpc_total; tpc++) { |
1071 | do { |
1072 | gpc = (gpc + 1) % priv->gpc_nr; |
1073 | } while (!tpcnr[gpc]); |
1074 | tpcnr[gpc]--; |
1075 | data[tpc] = gpc; |
1076 | } |
1077 | |
1078 | for (i = 0; i < 4; i++) |
1079 | nv_wr32(priv, 0x4060a8 + (i * 4), ((u32 *)data)[i]); |
1080 | } |
1081 | |
1082 | void |
1083 | nvc0_grctx_generate_r418bb8(struct nvc0_graph_priv *priv) |
1084 | { |
1085 | u32 data[6] = {}, data2[2] = {}; |
1086 | u8 tpcnr[GPC_MAX]; |
1087 | u8 shift, ntpcv; |
1088 | int gpc, tpc, i; |
1089 | |
1090 | /* calculate first set of magics */ |
1091 | memcpy(tpcnr, priv->tpc_nr, sizeof(priv->tpc_nr)); |
1092 | |
1093 | gpc = -1; |
1094 | for (tpc = 0; tpc < priv->tpc_total; tpc++) { |
1095 | do { |
1096 | gpc = (gpc + 1) % priv->gpc_nr; |
1097 | } while (!tpcnr[gpc]); |
1098 | tpcnr[gpc]--; |
1099 | |
1100 | data[tpc / 6] |= gpc << ((tpc % 6) * 5); |
1101 | } |
1102 | |
1103 | for (; tpc < 32; tpc++) |
1104 | data[tpc / 6] |= 7 << ((tpc % 6) * 5); |
1105 | |
1106 | /* and the second... */ |
1107 | shift = 0; |
1108 | ntpcv = priv->tpc_total; |
1109 | while (!(ntpcv & (1 << 4))) { |
1110 | ntpcv <<= 1; |
1111 | shift++; |
1112 | } |
1113 | |
1114 | data2[0] = (ntpcv << 16); |
1115 | data2[0] |= (shift << 21); |
1116 | data2[0] |= (((1 << (0 + 5)) % ntpcv) << 24); |
1117 | for (i = 1; i < 7; i++) |
1118 | data2[1] |= ((1 << (i + 5)) % ntpcv) << ((i - 1) * 5); |
1119 | |
1120 | /* GPC_BROADCAST */ |
1121 | nv_wr32(priv, 0x418bb8, (priv->tpc_total << 8) | |
1122 | priv->magic_not_rop_nr); |
1123 | for (i = 0; i < 6; i++) |
1124 | nv_wr32(priv, 0x418b08 + (i * 4), data[i]); |
1125 | |
1126 | /* GPC_BROADCAST.TP_BROADCAST */ |
1127 | nv_wr32(priv, 0x419bd0, (priv->tpc_total << 8) | |
1128 | priv->magic_not_rop_nr | data2[0]); |
1129 | nv_wr32(priv, 0x419be4, data2[1]); |
1130 | for (i = 0; i < 6; i++) |
1131 | nv_wr32(priv, 0x419b00 + (i * 4), data[i]); |
1132 | |
1133 | /* UNK78xx */ |
1134 | nv_wr32(priv, 0x4078bc, (priv->tpc_total << 8) | |
1135 | priv->magic_not_rop_nr); |
1136 | for (i = 0; i < 6; i++) |
1137 | nv_wr32(priv, 0x40780c + (i * 4), data[i]); |
1138 | } |
1139 | |
1140 | void |
1141 | nvc0_grctx_generate_r406800(struct nvc0_graph_priv *priv) |
1142 | { |
1143 | u64 tpc_mask = 0, tpc_set = 0; |
1144 | u8 tpcnr[GPC_MAX]; |
1145 | int gpc, tpc; |
1146 | int i, a, b; |
1147 | |
1148 | memcpy(tpcnr, priv->tpc_nr, sizeof(priv->tpc_nr)); |
1149 | for (gpc = 0; gpc < priv->gpc_nr; gpc++) |
1150 | tpc_mask |= ((1ULL << priv->tpc_nr[gpc]) - 1) << (gpc * 8); |
1151 | |
1152 | for (i = 0, gpc = -1, b = -1; i < 32; i++) { |
1153 | a = (i * (priv->tpc_total - 1)) / 32; |
1154 | if (a != b) { |
1155 | b = a; |
1156 | do { |
1157 | gpc = (gpc + 1) % priv->gpc_nr; |
1158 | } while (!tpcnr[gpc]); |
1159 | tpc = priv->tpc_nr[gpc] - tpcnr[gpc]--; |
1160 | |
1161 | tpc_set |= 1ULL << ((gpc * 8) + tpc); |
1162 | } |
1163 | |
1164 | nv_wr32(priv, 0x406800 + (i * 0x20), lower_32_bits(tpc_set)); |
1165 | nv_wr32(priv, 0x406c00 + (i * 0x20), lower_32_bits(tpc_set ^ tpc_mask)); |
1166 | if (priv->gpc_nr > 4) { |
1167 | nv_wr32(priv, 0x406804 + (i * 0x20), upper_32_bits(tpc_set)); |
1168 | nv_wr32(priv, 0x406c04 + (i * 0x20), upper_32_bits(tpc_set ^ tpc_mask)); |
1169 | } |
1170 | } |
1171 | } |
1172 | |
1173 | void |
1174 | nvc0_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) |
1175 | { |
1176 | struct nvc0_grctx_oclass *oclass = (void *)nv_engine(priv)->cclass; |
1177 | |
1178 | nv_mask(priv, 0x000260, 0x00000001, 0x00000000); |
1179 | |
1180 | nvc0_graph_mmio(priv, oclass->hub); |
1181 | nvc0_graph_mmio(priv, oclass->gpc); |
1182 | nvc0_graph_mmio(priv, oclass->zcull); |
1183 | nvc0_graph_mmio(priv, oclass->tpc); |
1184 | nvc0_graph_mmio(priv, oclass->ppc); |
1185 | |
1186 | nv_wr32(priv, 0x404154, 0x00000000); |
1187 | |
1188 | oclass->mods(priv, info); |
1189 | oclass->unkn(priv); |
1190 | |
1191 | nvc0_grctx_generate_tpcid(priv); |
1192 | nvc0_grctx_generate_r406028(priv); |
1193 | nvc0_grctx_generate_r4060a8(priv); |
1194 | nvc0_grctx_generate_r418bb8(priv); |
1195 | nvc0_grctx_generate_r406800(priv); |
1196 | |
1197 | nvc0_graph_icmd(priv, oclass->icmd); |
1198 | nv_wr32(priv, 0x404154, 0x00000400); |
1199 | nvc0_graph_mthd(priv, oclass->mthd); |
1200 | nv_mask(priv, 0x000260, 0x00000001, 0x00000001); |
1201 | } |
1202 | |
1203 | int |
1204 | nvc0_grctx_generate(struct nvc0_graph_priv *priv) |
1205 | { |
1206 | struct nvc0_grctx_oclass *oclass = (void *)nv_engine(priv)->cclass; |
1207 | struct nouveau_bar *bar = nouveau_bar(priv); |
1208 | struct nouveau_gpuobj *chan; |
1209 | struct nvc0_grctx info; |
1210 | int ret, i; |
1211 | |
1212 | /* allocate memory to for a "channel", which we'll use to generate |
1213 | * the default context values |
1214 | */ |
1215 | ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x80000 + priv->size, |
1216 | 0x1000, NVOBJ_FLAG_ZERO_ALLOC, &chan); |
1217 | if (ret) { |
1218 | nv_error(priv, "failed to allocate channel memory, %d\n" , ret); |
1219 | return ret; |
1220 | } |
1221 | |
1222 | /* PGD pointer */ |
1223 | nv_wo32(chan, 0x0200, lower_32_bits(chan->addr + 0x1000)); |
1224 | nv_wo32(chan, 0x0204, upper_32_bits(chan->addr + 0x1000)); |
1225 | nv_wo32(chan, 0x0208, 0xffffffff); |
1226 | nv_wo32(chan, 0x020c, 0x000000ff); |
1227 | |
1228 | /* PGT[0] pointer */ |
1229 | nv_wo32(chan, 0x1000, 0x00000000); |
1230 | nv_wo32(chan, 0x1004, 0x00000001 | (chan->addr + 0x2000) >> 8); |
1231 | |
1232 | /* identity-map the whole "channel" into its own vm */ |
1233 | for (i = 0; i < chan->size / 4096; i++) { |
1234 | u64 addr = ((chan->addr + (i * 4096)) >> 8) | 1; |
1235 | nv_wo32(chan, 0x2000 + (i * 8), lower_32_bits(addr)); |
1236 | nv_wo32(chan, 0x2004 + (i * 8), upper_32_bits(addr)); |
1237 | } |
1238 | |
1239 | /* context pointer (virt) */ |
1240 | nv_wo32(chan, 0x0210, 0x00080004); |
1241 | nv_wo32(chan, 0x0214, 0x00000000); |
1242 | |
1243 | bar->flush(bar); |
1244 | |
1245 | nv_wr32(priv, 0x100cb8, (chan->addr + 0x1000) >> 8); |
1246 | nv_wr32(priv, 0x100cbc, 0x80000001); |
1247 | nv_wait(priv, 0x100c80, 0x00008000, 0x00008000); |
1248 | |
1249 | /* setup default state for mmio list construction */ |
1250 | info.priv = priv; |
1251 | info.data = priv->mmio_data; |
1252 | info.mmio = priv->mmio_list; |
1253 | info.addr = 0x2000 + (i * 8); |
1254 | info.buffer_nr = 0; |
1255 | |
1256 | /* make channel current */ |
1257 | if (priv->firmware) { |
1258 | nv_wr32(priv, 0x409840, 0x00000030); |
1259 | nv_wr32(priv, 0x409500, 0x80000000 | chan->addr >> 12); |
1260 | nv_wr32(priv, 0x409504, 0x00000003); |
1261 | if (!nv_wait(priv, 0x409800, 0x00000010, 0x00000010)) |
1262 | nv_error(priv, "load_ctx timeout\n" ); |
1263 | |
1264 | nv_wo32(chan, 0x8001c, 1); |
1265 | nv_wo32(chan, 0x80020, 0); |
1266 | nv_wo32(chan, 0x80028, 0); |
1267 | nv_wo32(chan, 0x8002c, 0); |
1268 | bar->flush(bar); |
1269 | } else { |
1270 | nv_wr32(priv, 0x409840, 0x80000000); |
1271 | nv_wr32(priv, 0x409500, 0x80000000 | chan->addr >> 12); |
1272 | nv_wr32(priv, 0x409504, 0x00000001); |
1273 | if (!nv_wait(priv, 0x409800, 0x80000000, 0x80000000)) |
1274 | nv_error(priv, "HUB_SET_CHAN timeout\n" ); |
1275 | } |
1276 | |
1277 | oclass->main(priv, &info); |
1278 | |
1279 | /* trigger a context unload by unsetting the "next channel valid" bit |
1280 | * and faking a context switch interrupt |
1281 | */ |
1282 | nv_mask(priv, 0x409b04, 0x80000000, 0x00000000); |
1283 | nv_wr32(priv, 0x409000, 0x00000100); |
1284 | if (!nv_wait(priv, 0x409b00, 0x80000000, 0x00000000)) { |
1285 | nv_error(priv, "grctx template channel unload timeout\n" ); |
1286 | ret = -EBUSY; |
1287 | goto done; |
1288 | } |
1289 | |
1290 | priv->data = kmalloc(priv->size, GFP_KERNEL); |
1291 | if (priv->data) { |
1292 | for (i = 0; i < priv->size; i += 4) |
1293 | priv->data[i / 4] = nv_ro32(chan, 0x80000 + i); |
1294 | ret = 0; |
1295 | } else { |
1296 | ret = -ENOMEM; |
1297 | } |
1298 | |
1299 | done: |
1300 | nouveau_gpuobj_ref(NULL, &chan); |
1301 | return ret; |
1302 | } |
1303 | |
1304 | struct nouveau_oclass * |
1305 | nvc0_grctx_oclass = &(struct nvc0_grctx_oclass) { |
1306 | .base.handle = NV_ENGCTX(GR, 0xc0), |
1307 | .base.ofuncs = &(struct nouveau_ofuncs) { |
1308 | .ctor = nvc0_graph_context_ctor, |
1309 | .dtor = nvc0_graph_context_dtor, |
1310 | .init = _nouveau_graph_context_init, |
1311 | .fini = _nouveau_graph_context_fini, |
1312 | .rd32 = _nouveau_graph_context_rd32, |
1313 | .wr32 = _nouveau_graph_context_wr32, |
1314 | }, |
1315 | .main = nvc0_grctx_generate_main, |
1316 | .mods = nvc0_grctx_generate_mods, |
1317 | .unkn = nvc0_grctx_generate_unkn, |
1318 | .hub = nvc0_grctx_pack_hub, |
1319 | .gpc = nvc0_grctx_pack_gpc, |
1320 | .zcull = nvc0_grctx_pack_zcull, |
1321 | .tpc = nvc0_grctx_pack_tpc, |
1322 | .icmd = nvc0_grctx_pack_icmd, |
1323 | .mthd = nvc0_grctx_pack_mthd, |
1324 | }.base; |
1325 | |