blob: 93f9b60ef87158f571336868111385bca6426d04 [file] [log] [blame]
Ben Skeggs30f4e082013-06-09 16:08:22 +10001/*
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
Ben Skeggsc33b1e82014-03-03 16:18:55 +100025#include "ctxnvc0.h"
Ben Skeggs30f4e082013-06-09 16:08:22 +100026
Ben Skeggsc33b1e82014-03-03 16:18:55 +100027/*******************************************************************************
28 * PGRAPH context register lists
29 ******************************************************************************/
30
31static const struct nvc0_graph_init
32nvc8_grctx_init_icmd_0[] = {
Ben Skeggs30f4e082013-06-09 16:08:22 +100033 { 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 },
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000148 { 0x000638, 2, 0x01, 0x00000001 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000149 { 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 },
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000209 { 0x000794, 3, 0x01, 0x00000001 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000210 { 0x000797, 1, 0x01, 0x000000cf },
211 { 0x000836, 1, 0x01, 0x00000001 },
212 { 0x00079a, 1, 0x01, 0x00000002 },
213 { 0x000833, 1, 0x01, 0x04444480 },
214 { 0x0007a1, 1, 0x01, 0x00000001 },
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000215 { 0x0007a3, 3, 0x01, 0x00000001 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000216 { 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 },
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000241 { 0x000794, 3, 0x01, 0x00000001 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000242 { 0x000797, 1, 0x01, 0x000000cf },
243 { 0x00079a, 1, 0x01, 0x00000002 },
244 { 0x000833, 1, 0x01, 0x04444480 },
245 { 0x0007a1, 1, 0x01, 0x00000001 },
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000246 { 0x0007a3, 3, 0x01, 0x00000001 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000247 { 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
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000271static 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
Ben Skeggs97af71f2014-03-03 16:18:56 +1000305nvc8_grctx_init_setup_0[] = {
Ben Skeggse21bfd12014-03-03 16:18:55 +1000306 { 0x418800, 1, 0x04, 0x0006860a },
307 { 0x418808, 3, 0x04, 0x00000000 },
308 { 0x418828, 1, 0x04, 0x00008442 },
309 { 0x418830, 1, 0x04, 0x00000001 },
310 { 0x4188d8, 1, 0x04, 0x00000008 },
311 { 0x4188e0, 1, 0x04, 0x01000000 },
312 { 0x4188e8, 5, 0x04, 0x00000000 },
313 { 0x4188fc, 1, 0x04, 0x20100000 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000314 {}
315};
316
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000317static const struct nvc0_graph_pack
318nvc8_grctx_pack_gpc[] = {
Ben Skeggs97af71f2014-03-03 16:18:56 +1000319 { nvc0_grctx_init_gpc_unk_0 },
320 { nvc0_grctx_init_prop_0 },
321 { nvc0_grctx_init_gpc_unk_1 },
322 { nvc8_grctx_init_setup_0 },
323 { nvc0_grctx_init_zcull_0 },
324 { nvc0_grctx_init_crstr_0 },
325 { nvc0_grctx_init_gpm_0 },
326 { nvc0_grctx_init_gcc_0 },
Ben Skeggs30f4e082013-06-09 16:08:22 +1000327 {}
328};
329
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000330/*******************************************************************************
331 * PGRAPH context implementation
332 ******************************************************************************/
Ben Skeggs70f824a2013-07-01 14:48:33 +1000333
Ben Skeggs30f4e082013-06-09 16:08:22 +1000334struct nouveau_oclass *
335nvc8_grctx_oclass = &(struct nvc0_grctx_oclass) {
336 .base.handle = NV_ENGCTX(GR, 0xc8),
337 .base.ofuncs = &(struct nouveau_ofuncs) {
338 .ctor = nvc0_graph_context_ctor,
339 .dtor = nvc0_graph_context_dtor,
340 .init = _nouveau_graph_context_init,
341 .fini = _nouveau_graph_context_fini,
342 .rd32 = _nouveau_graph_context_rd32,
343 .wr32 = _nouveau_graph_context_wr32,
344 },
Ben Skeggsc33b1e82014-03-03 16:18:55 +1000345 .main = nvc0_grctx_generate_main,
346 .mods = nvc0_grctx_generate_mods,
347 .unkn = nvc0_grctx_generate_unkn,
348 .hub = nvc0_grctx_pack_hub,
349 .gpc = nvc8_grctx_pack_gpc,
350 .zcull = nvc0_grctx_pack_zcull,
351 .tpc = nvc0_grctx_pack_tpc,
352 .icmd = nvc8_grctx_pack_icmd,
353 .mthd = nvc8_grctx_pack_mthd,
Ben Skeggsaa2d58c2014-08-10 04:10:29 +1000354 .bundle = nvc0_grctx_generate_bundle,
355 .bundle_size = 0x1800,
Ben Skeggsf331a152014-08-10 04:10:29 +1000356 .pagepool = nvc0_grctx_generate_pagepool,
357 .pagepool_size = 0x8000,
Ben Skeggs67cfbfd2014-08-10 04:10:30 +1000358 .attrib = nvc0_grctx_generate_attrib,
359 .attrib_nr_max = 0x324,
360 .attrib_nr = 0x218,
Ben Skeggs30f4e082013-06-09 16:08:22 +1000361}.base;