1254885Sdumbbell/*
2254885Sdumbbell * Copyright 2009 Advanced Micro Devices, Inc.
3254885Sdumbbell *
4254885Sdumbbell * Permission is hereby granted, free of charge, to any person obtaining a
5254885Sdumbbell * copy of this software and associated documentation files (the "Software"),
6254885Sdumbbell * to deal in the Software without restriction, including without limitation
7254885Sdumbbell * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8254885Sdumbbell * and/or sell copies of the Software, and to permit persons to whom the
9254885Sdumbbell * Software is furnished to do so, subject to the following conditions:
10254885Sdumbbell *
11254885Sdumbbell * The above copyright notice and this permission notice (including the next
12254885Sdumbbell * paragraph) shall be included in all copies or substantial portions of the
13254885Sdumbbell * Software.
14254885Sdumbbell *
15254885Sdumbbell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16254885Sdumbbell * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17254885Sdumbbell * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18254885Sdumbbell * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19254885Sdumbbell * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20254885Sdumbbell * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21254885Sdumbbell * DEALINGS IN THE SOFTWARE.
22254885Sdumbbell *
23254885Sdumbbell * Authors:
24254885Sdumbbell *     Alex Deucher <alexander.deucher@amd.com>
25254885Sdumbbell */
26254885Sdumbbell
27254885Sdumbbell#include <sys/cdefs.h>
28254885Sdumbbell__FBSDID("$FreeBSD$");
29254885Sdumbbell
30254885Sdumbbell#include <dev/drm2/drmP.h>
31254885Sdumbbell
32254885Sdumbbell/*
33254885Sdumbbell * R6xx+ cards need to use the 3D engine to blit data which requires
34254885Sdumbbell * quite a bit of hw state setup.  Rather than pull the whole 3D driver
35254885Sdumbbell * (which normally generates the 3D state) into the DRM, we opt to use
36254885Sdumbbell * statically generated state tables.  The regsiter state and shaders
37254885Sdumbbell * were hand generated to support blitting functionality.  See the 3D
38254885Sdumbbell * driver or documentation for descriptions of the registers and
39254885Sdumbbell * shader instructions.
40254885Sdumbbell */
41254885Sdumbbell
42254885Sdumbbellconst u32 r6xx_default_state[] =
43254885Sdumbbell{
44254885Sdumbbell	0xc0002400, /* START_3D_CMDBUF */
45254885Sdumbbell	0x00000000,
46254885Sdumbbell
47254885Sdumbbell	0xc0012800, /* CONTEXT_CONTROL */
48254885Sdumbbell	0x80000000,
49254885Sdumbbell	0x80000000,
50254885Sdumbbell
51254885Sdumbbell	0xc0016800,
52254885Sdumbbell	0x00000010,
53254885Sdumbbell	0x00008000, /* WAIT_UNTIL */
54254885Sdumbbell
55254885Sdumbbell	0xc0016800,
56254885Sdumbbell	0x00000542,
57254885Sdumbbell	0x07000003, /* TA_CNTL_AUX */
58254885Sdumbbell
59254885Sdumbbell	0xc0016800,
60254885Sdumbbell	0x000005c5,
61254885Sdumbbell	0x00000000, /* VC_ENHANCE */
62254885Sdumbbell
63254885Sdumbbell	0xc0016800,
64254885Sdumbbell	0x00000363,
65254885Sdumbbell	0x00000000, /* SQ_DYN_GPR_CNTL_PS_FLUSH_REQ */
66254885Sdumbbell
67254885Sdumbbell	0xc0016800,
68254885Sdumbbell	0x0000060c,
69254885Sdumbbell	0x82000000, /* DB_DEBUG */
70254885Sdumbbell
71254885Sdumbbell	0xc0016800,
72254885Sdumbbell	0x0000060e,
73254885Sdumbbell	0x01020204, /* DB_WATERMARKS */
74254885Sdumbbell
75254885Sdumbbell	0xc0026f00,
76254885Sdumbbell	0x00000000,
77254885Sdumbbell	0x00000000, /* SQ_VTX_BASE_VTX_LOC */
78254885Sdumbbell	0x00000000, /* SQ_VTX_START_INST_LOC */
79254885Sdumbbell
80254885Sdumbbell	0xc0096900,
81254885Sdumbbell	0x0000022a,
82254885Sdumbbell	0x00000000, /* SQ_ESGS_RING_ITEMSIZE */
83254885Sdumbbell	0x00000000,
84254885Sdumbbell	0x00000000,
85254885Sdumbbell	0x00000000,
86254885Sdumbbell	0x00000000,
87254885Sdumbbell	0x00000000,
88254885Sdumbbell	0x00000000,
89254885Sdumbbell	0x00000000,
90254885Sdumbbell	0x00000000,
91254885Sdumbbell
92254885Sdumbbell	0xc0016900,
93254885Sdumbbell	0x00000004,
94254885Sdumbbell	0x00000000, /* DB_DEPTH_INFO */
95254885Sdumbbell
96254885Sdumbbell	0xc0026900,
97254885Sdumbbell	0x0000000a,
98254885Sdumbbell	0x00000000, /* DB_STENCIL_CLEAR */
99254885Sdumbbell	0x00000000, /* DB_DEPTH_CLEAR */
100254885Sdumbbell
101254885Sdumbbell	0xc0016900,
102254885Sdumbbell	0x00000200,
103254885Sdumbbell	0x00000000, /* DB_DEPTH_CONTROL */
104254885Sdumbbell
105254885Sdumbbell	0xc0026900,
106254885Sdumbbell	0x00000343,
107254885Sdumbbell	0x00000060, /* DB_RENDER_CONTROL */
108254885Sdumbbell	0x00000040, /* DB_RENDER_OVERRIDE */
109254885Sdumbbell
110254885Sdumbbell	0xc0016900,
111254885Sdumbbell	0x00000351,
112254885Sdumbbell	0x0000aa00, /* DB_ALPHA_TO_MASK */
113254885Sdumbbell
114254885Sdumbbell	0xc00f6900,
115254885Sdumbbell	0x00000100,
116254885Sdumbbell	0x00000800, /* VGT_MAX_VTX_INDX */
117254885Sdumbbell	0x00000000, /* VGT_MIN_VTX_INDX */
118254885Sdumbbell	0x00000000, /* VGT_INDX_OFFSET */
119254885Sdumbbell	0x00000000, /* VGT_MULTI_PRIM_IB_RESET_INDX */
120254885Sdumbbell	0x00000000, /* SX_ALPHA_TEST_CONTROL */
121254885Sdumbbell	0x00000000, /* CB_BLEND_RED */
122254885Sdumbbell	0x00000000,
123254885Sdumbbell	0x00000000,
124254885Sdumbbell	0x00000000,
125254885Sdumbbell	0x00000000, /* CB_FOG_RED */
126254885Sdumbbell	0x00000000,
127254885Sdumbbell	0x00000000,
128254885Sdumbbell	0x00000000, /* DB_STENCILREFMASK */
129254885Sdumbbell	0x00000000, /* DB_STENCILREFMASK_BF */
130254885Sdumbbell	0x00000000, /* SX_ALPHA_REF */
131254885Sdumbbell
132254885Sdumbbell	0xc0046900,
133254885Sdumbbell	0x0000030c,
134254885Sdumbbell	0x01000000, /* CB_CLRCMP_CNTL */
135254885Sdumbbell	0x00000000,
136254885Sdumbbell	0x00000000,
137254885Sdumbbell	0x00000000,
138254885Sdumbbell
139254885Sdumbbell	0xc0046900,
140254885Sdumbbell	0x00000048,
141254885Sdumbbell	0x3f800000, /* CB_CLEAR_RED */
142254885Sdumbbell	0x00000000,
143254885Sdumbbell	0x3f800000,
144254885Sdumbbell	0x3f800000,
145254885Sdumbbell
146254885Sdumbbell	0xc0016900,
147254885Sdumbbell	0x00000080,
148254885Sdumbbell	0x00000000, /* PA_SC_WINDOW_OFFSET */
149254885Sdumbbell
150254885Sdumbbell	0xc00a6900,
151254885Sdumbbell	0x00000083,
152254885Sdumbbell	0x0000ffff, /* PA_SC_CLIP_RECT_RULE */
153254885Sdumbbell	0x00000000, /* PA_SC_CLIPRECT_0_TL */
154254885Sdumbbell	0x20002000,
155254885Sdumbbell	0x00000000,
156254885Sdumbbell	0x20002000,
157254885Sdumbbell	0x00000000,
158254885Sdumbbell	0x20002000,
159254885Sdumbbell	0x00000000,
160254885Sdumbbell	0x20002000,
161254885Sdumbbell	0x00000000, /* PA_SC_EDGERULE */
162254885Sdumbbell
163254885Sdumbbell	0xc0406900,
164254885Sdumbbell	0x00000094,
165254885Sdumbbell	0x80000000, /* PA_SC_VPORT_SCISSOR_0_TL */
166254885Sdumbbell	0x20002000, /* PA_SC_VPORT_SCISSOR_0_BR */
167254885Sdumbbell	0x80000000, /* PA_SC_VPORT_SCISSOR_1_TL */
168254885Sdumbbell	0x20002000,
169254885Sdumbbell	0x80000000,
170254885Sdumbbell	0x20002000,
171254885Sdumbbell	0x80000000,
172254885Sdumbbell	0x20002000,
173254885Sdumbbell	0x80000000,
174254885Sdumbbell	0x20002000,
175254885Sdumbbell	0x80000000,
176254885Sdumbbell	0x20002000,
177254885Sdumbbell	0x80000000,
178254885Sdumbbell	0x20002000,
179254885Sdumbbell	0x80000000,
180254885Sdumbbell	0x20002000,
181254885Sdumbbell	0x80000000,
182254885Sdumbbell	0x20002000,
183254885Sdumbbell	0x80000000,
184254885Sdumbbell	0x20002000,
185254885Sdumbbell	0x80000000,
186254885Sdumbbell	0x20002000,
187254885Sdumbbell	0x80000000,
188254885Sdumbbell	0x20002000,
189254885Sdumbbell	0x80000000,
190254885Sdumbbell	0x20002000,
191254885Sdumbbell	0x80000000,
192254885Sdumbbell	0x20002000,
193254885Sdumbbell	0x80000000,
194254885Sdumbbell	0x20002000,
195254885Sdumbbell	0x80000000,
196254885Sdumbbell	0x20002000,
197254885Sdumbbell	0x00000000, /* PA_SC_VPORT_ZMIN_0 */
198254885Sdumbbell	0x3f800000,
199254885Sdumbbell	0x00000000,
200254885Sdumbbell	0x3f800000,
201254885Sdumbbell	0x00000000,
202254885Sdumbbell	0x3f800000,
203254885Sdumbbell	0x00000000,
204254885Sdumbbell	0x3f800000,
205254885Sdumbbell	0x00000000,
206254885Sdumbbell	0x3f800000,
207254885Sdumbbell	0x00000000,
208254885Sdumbbell	0x3f800000,
209254885Sdumbbell	0x00000000,
210254885Sdumbbell	0x3f800000,
211254885Sdumbbell	0x00000000,
212254885Sdumbbell	0x3f800000,
213254885Sdumbbell	0x00000000,
214254885Sdumbbell	0x3f800000,
215254885Sdumbbell	0x00000000,
216254885Sdumbbell	0x3f800000,
217254885Sdumbbell	0x00000000,
218254885Sdumbbell	0x3f800000,
219254885Sdumbbell	0x00000000,
220254885Sdumbbell	0x3f800000,
221254885Sdumbbell	0x00000000,
222254885Sdumbbell	0x3f800000,
223254885Sdumbbell	0x00000000,
224254885Sdumbbell	0x3f800000,
225254885Sdumbbell	0x00000000,
226254885Sdumbbell	0x3f800000,
227254885Sdumbbell	0x00000000,
228254885Sdumbbell	0x3f800000,
229254885Sdumbbell
230254885Sdumbbell	0xc0026900,
231254885Sdumbbell	0x00000292,
232254885Sdumbbell	0x00000000, /* PA_SC_MPASS_PS_CNTL */
233254885Sdumbbell	0x00004010, /* PA_SC_MODE_CNTL */
234254885Sdumbbell
235254885Sdumbbell	0xc0096900,
236254885Sdumbbell	0x00000300,
237254885Sdumbbell	0x00000000, /* PA_SC_LINE_CNTL */
238254885Sdumbbell	0x00000000, /* PA_SC_AA_CONFIG */
239254885Sdumbbell	0x0000002d, /* PA_SU_VTX_CNTL */
240254885Sdumbbell	0x3f800000, /* PA_CL_GB_VERT_CLIP_ADJ */
241254885Sdumbbell	0x3f800000,
242254885Sdumbbell	0x3f800000,
243254885Sdumbbell	0x3f800000,
244254885Sdumbbell	0x00000000, /* PA_SC_SAMPLE_LOCS_MCTX */
245254885Sdumbbell	0x00000000,
246254885Sdumbbell
247254885Sdumbbell	0xc0016900,
248254885Sdumbbell	0x00000312,
249254885Sdumbbell	0xffffffff, /* PA_SC_AA_MASK */
250254885Sdumbbell
251254885Sdumbbell	0xc0066900,
252254885Sdumbbell	0x0000037e,
253254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_DB_FMT_CNTL */
254254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_CLAMP */
255254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_FRONT_SCALE */
256254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_FRONT_OFFSET */
257254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_BACK_SCALE */
258254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_BACK_OFFSET */
259254885Sdumbbell
260254885Sdumbbell	0xc0046900,
261254885Sdumbbell	0x000001b6,
262254885Sdumbbell	0x00000000, /* SPI_INPUT_Z */
263254885Sdumbbell	0x00000000, /* SPI_FOG_CNTL */
264254885Sdumbbell	0x00000000, /* SPI_FOG_FUNC_SCALE */
265254885Sdumbbell	0x00000000, /* SPI_FOG_FUNC_BIAS */
266254885Sdumbbell
267254885Sdumbbell	0xc0016900,
268254885Sdumbbell	0x00000225,
269254885Sdumbbell	0x00000000, /* SQ_PGM_START_FS */
270254885Sdumbbell
271254885Sdumbbell	0xc0016900,
272254885Sdumbbell	0x00000229,
273254885Sdumbbell	0x00000000, /* SQ_PGM_RESOURCES_FS */
274254885Sdumbbell
275254885Sdumbbell	0xc0016900,
276254885Sdumbbell	0x00000237,
277254885Sdumbbell	0x00000000, /* SQ_PGM_CF_OFFSET_FS */
278254885Sdumbbell
279254885Sdumbbell	0xc0026900,
280254885Sdumbbell	0x000002a8,
281254885Sdumbbell	0x00000000, /* VGT_INSTANCE_STEP_RATE_0 */
282254885Sdumbbell	0x00000000, /* VGT_INSTANCE_STEP_RATE_1 */
283254885Sdumbbell
284254885Sdumbbell	0xc0116900,
285254885Sdumbbell	0x00000280,
286254885Sdumbbell	0x00000000, /* PA_SU_POINT_SIZE */
287254885Sdumbbell	0x00000000, /* PA_SU_POINT_MINMAX */
288254885Sdumbbell	0x00000008, /* PA_SU_LINE_CNTL */
289254885Sdumbbell	0x00000000, /* PA_SC_LINE_STIPPLE */
290254885Sdumbbell	0x00000000, /* VGT_OUTPUT_PATH_CNTL */
291254885Sdumbbell	0x00000000, /* VGT_HOS_CNTL */
292254885Sdumbbell	0x00000000, /* VGT_HOS_MAX_TESS_LEVEL */
293254885Sdumbbell	0x00000000, /* VGT_HOS_MIN_TESS_LEVEL */
294254885Sdumbbell	0x00000000, /* VGT_HOS_REUSE_DEPTH */
295254885Sdumbbell	0x00000000, /* VGT_GROUP_PRIM_TYPE */
296254885Sdumbbell	0x00000000, /* VGT_GROUP_FIRST_DECR */
297254885Sdumbbell	0x00000000, /* VGT_GROUP_DECR */
298254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_0_CNTL */
299254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_1_CNTL */
300254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_0_FMT_CNTL */
301254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_1_FMT_CNTL */
302254885Sdumbbell	0x00000000, /* VGT_GS_MODE */
303254885Sdumbbell
304254885Sdumbbell	0xc0016900,
305254885Sdumbbell	0x000002a1,
306254885Sdumbbell	0x00000000, /* VGT_PRIMITIVEID_EN */
307254885Sdumbbell
308254885Sdumbbell	0xc0016900,
309254885Sdumbbell	0x000002a5,
310254885Sdumbbell	0x00000000, /* VGT_MULTI_PRIM_ID_RESET_EN */
311254885Sdumbbell
312254885Sdumbbell	0xc0036900,
313254885Sdumbbell	0x000002ac,
314254885Sdumbbell	0x00000000, /* VGT_STRMOUT_EN */
315254885Sdumbbell	0x00000000, /* VGT_REUSE_OFF */
316254885Sdumbbell	0x00000000, /* VGT_VTX_CNT_EN */
317254885Sdumbbell
318254885Sdumbbell	0xc0016900,
319254885Sdumbbell	0x000000d4,
320254885Sdumbbell	0x00000000, /* SX_MISC */
321254885Sdumbbell
322254885Sdumbbell	0xc0016900,
323254885Sdumbbell	0x000002c8,
324254885Sdumbbell	0x00000000, /* VGT_STRMOUT_BUFFER_EN */
325254885Sdumbbell
326254885Sdumbbell	0xc0076900,
327254885Sdumbbell	0x00000202,
328254885Sdumbbell	0x00cc0000, /* CB_COLOR_CONTROL */
329254885Sdumbbell	0x00000210, /* DB_SHADER_CNTL */
330254885Sdumbbell	0x00010000, /* PA_CL_CLIP_CNTL */
331254885Sdumbbell	0x00000244, /* PA_SU_SC_MODE_CNTL */
332254885Sdumbbell	0x00000100, /* PA_CL_VTE_CNTL */
333254885Sdumbbell	0x00000000, /* PA_CL_VS_OUT_CNTL */
334254885Sdumbbell	0x00000000, /* PA_CL_NANINF_CNTL */
335254885Sdumbbell
336254885Sdumbbell	0xc0026900,
337254885Sdumbbell	0x0000008e,
338254885Sdumbbell	0x0000000f, /* CB_TARGET_MASK */
339254885Sdumbbell	0x0000000f, /* CB_SHADER_MASK */
340254885Sdumbbell
341254885Sdumbbell	0xc0016900,
342254885Sdumbbell	0x000001e8,
343254885Sdumbbell	0x00000001, /* CB_SHADER_CONTROL */
344254885Sdumbbell
345254885Sdumbbell	0xc0016900,
346254885Sdumbbell	0x00000185,
347254885Sdumbbell	0x00000000, /* SPI_VS_OUT_ID_0 */
348254885Sdumbbell
349254885Sdumbbell	0xc0016900,
350254885Sdumbbell	0x00000191,
351254885Sdumbbell	0x00000b00, /* SPI_PS_INPUT_CNTL_0 */
352254885Sdumbbell
353254885Sdumbbell	0xc0056900,
354254885Sdumbbell	0x000001b1,
355254885Sdumbbell	0x00000000, /* SPI_VS_OUT_CONFIG */
356254885Sdumbbell	0x00000000, /* SPI_THREAD_GROUPING */
357254885Sdumbbell	0x00000001, /* SPI_PS_IN_CONTROL_0 */
358254885Sdumbbell	0x00000000, /* SPI_PS_IN_CONTROL_1 */
359254885Sdumbbell	0x00000000, /* SPI_INTERP_CONTROL_0 */
360254885Sdumbbell
361254885Sdumbbell	0xc0036e00, /* SET_SAMPLER */
362254885Sdumbbell	0x00000000,
363254885Sdumbbell	0x00000012,
364254885Sdumbbell	0x00000000,
365254885Sdumbbell	0x00000000,
366254885Sdumbbell};
367254885Sdumbbell
368254885Sdumbbellconst u32 r7xx_default_state[] =
369254885Sdumbbell{
370254885Sdumbbell	0xc0012800, /* CONTEXT_CONTROL */
371254885Sdumbbell	0x80000000,
372254885Sdumbbell	0x80000000,
373254885Sdumbbell
374254885Sdumbbell	0xc0016800,
375254885Sdumbbell	0x00000010,
376254885Sdumbbell	0x00008000, /* WAIT_UNTIL */
377254885Sdumbbell
378254885Sdumbbell	0xc0016800,
379254885Sdumbbell	0x00000542,
380254885Sdumbbell	0x07000002, /* TA_CNTL_AUX */
381254885Sdumbbell
382254885Sdumbbell	0xc0016800,
383254885Sdumbbell	0x000005c5,
384254885Sdumbbell	0x00000000, /* VC_ENHANCE */
385254885Sdumbbell
386254885Sdumbbell	0xc0016800,
387254885Sdumbbell	0x00000363,
388254885Sdumbbell	0x00004000, /* SQ_DYN_GPR_CNTL_PS_FLUSH_REQ */
389254885Sdumbbell
390254885Sdumbbell	0xc0016800,
391254885Sdumbbell	0x0000060c,
392254885Sdumbbell	0x00000000, /* DB_DEBUG */
393254885Sdumbbell
394254885Sdumbbell	0xc0016800,
395254885Sdumbbell	0x0000060e,
396254885Sdumbbell	0x00420204, /* DB_WATERMARKS */
397254885Sdumbbell
398254885Sdumbbell	0xc0026f00,
399254885Sdumbbell	0x00000000,
400254885Sdumbbell	0x00000000, /* SQ_VTX_BASE_VTX_LOC */
401254885Sdumbbell	0x00000000, /* SQ_VTX_START_INST_LOC */
402254885Sdumbbell
403254885Sdumbbell	0xc0096900,
404254885Sdumbbell	0x0000022a,
405254885Sdumbbell	0x00000000, /* SQ_ESGS_RING_ITEMSIZE */
406254885Sdumbbell	0x00000000,
407254885Sdumbbell	0x00000000,
408254885Sdumbbell	0x00000000,
409254885Sdumbbell	0x00000000,
410254885Sdumbbell	0x00000000,
411254885Sdumbbell	0x00000000,
412254885Sdumbbell	0x00000000,
413254885Sdumbbell	0x00000000,
414254885Sdumbbell
415254885Sdumbbell	0xc0016900,
416254885Sdumbbell	0x00000004,
417254885Sdumbbell	0x00000000, /* DB_DEPTH_INFO */
418254885Sdumbbell
419254885Sdumbbell	0xc0026900,
420254885Sdumbbell	0x0000000a,
421254885Sdumbbell	0x00000000, /* DB_STENCIL_CLEAR */
422254885Sdumbbell	0x00000000, /* DB_DEPTH_CLEAR */
423254885Sdumbbell
424254885Sdumbbell	0xc0016900,
425254885Sdumbbell	0x00000200,
426254885Sdumbbell	0x00000000, /* DB_DEPTH_CONTROL */
427254885Sdumbbell
428254885Sdumbbell	0xc0026900,
429254885Sdumbbell	0x00000343,
430254885Sdumbbell	0x00000060, /* DB_RENDER_CONTROL */
431254885Sdumbbell	0x00000000, /* DB_RENDER_OVERRIDE */
432254885Sdumbbell
433254885Sdumbbell	0xc0016900,
434254885Sdumbbell	0x00000351,
435254885Sdumbbell	0x0000aa00, /* DB_ALPHA_TO_MASK */
436254885Sdumbbell
437254885Sdumbbell	0xc0096900,
438254885Sdumbbell	0x00000100,
439254885Sdumbbell	0x00000800, /* VGT_MAX_VTX_INDX */
440254885Sdumbbell	0x00000000, /* VGT_MIN_VTX_INDX */
441254885Sdumbbell	0x00000000, /* VGT_INDX_OFFSET */
442254885Sdumbbell	0x00000000, /* VGT_MULTI_PRIM_IB_RESET_INDX */
443254885Sdumbbell	0x00000000, /* SX_ALPHA_TEST_CONTROL */
444254885Sdumbbell	0x00000000, /* CB_BLEND_RED */
445254885Sdumbbell	0x00000000,
446254885Sdumbbell	0x00000000,
447254885Sdumbbell	0x00000000,
448254885Sdumbbell
449254885Sdumbbell	0xc0036900,
450254885Sdumbbell	0x0000010c,
451254885Sdumbbell	0x00000000, /* DB_STENCILREFMASK */
452254885Sdumbbell	0x00000000, /* DB_STENCILREFMASK_BF */
453254885Sdumbbell	0x00000000, /* SX_ALPHA_REF */
454254885Sdumbbell
455254885Sdumbbell	0xc0046900,
456254885Sdumbbell	0x0000030c, /* CB_CLRCMP_CNTL */
457254885Sdumbbell	0x01000000,
458254885Sdumbbell	0x00000000,
459254885Sdumbbell	0x00000000,
460254885Sdumbbell	0x00000000,
461254885Sdumbbell
462254885Sdumbbell	0xc0016900,
463254885Sdumbbell	0x00000080,
464254885Sdumbbell	0x00000000, /* PA_SC_WINDOW_OFFSET */
465254885Sdumbbell
466254885Sdumbbell	0xc00a6900,
467254885Sdumbbell	0x00000083,
468254885Sdumbbell	0x0000ffff, /* PA_SC_CLIP_RECT_RULE */
469254885Sdumbbell	0x00000000, /* PA_SC_CLIPRECT_0_TL */
470254885Sdumbbell	0x20002000,
471254885Sdumbbell	0x00000000,
472254885Sdumbbell	0x20002000,
473254885Sdumbbell	0x00000000,
474254885Sdumbbell	0x20002000,
475254885Sdumbbell	0x00000000,
476254885Sdumbbell	0x20002000,
477254885Sdumbbell	0xaaaaaaaa, /* PA_SC_EDGERULE */
478254885Sdumbbell
479254885Sdumbbell	0xc0406900,
480254885Sdumbbell	0x00000094,
481254885Sdumbbell	0x80000000, /* PA_SC_VPORT_SCISSOR_0_TL */
482254885Sdumbbell	0x20002000, /* PA_SC_VPORT_SCISSOR_0_BR */
483254885Sdumbbell	0x80000000, /* PA_SC_VPORT_SCISSOR_1_TL */
484254885Sdumbbell	0x20002000,
485254885Sdumbbell	0x80000000,
486254885Sdumbbell	0x20002000,
487254885Sdumbbell	0x80000000,
488254885Sdumbbell	0x20002000,
489254885Sdumbbell	0x80000000,
490254885Sdumbbell	0x20002000,
491254885Sdumbbell	0x80000000,
492254885Sdumbbell	0x20002000,
493254885Sdumbbell	0x80000000,
494254885Sdumbbell	0x20002000,
495254885Sdumbbell	0x80000000,
496254885Sdumbbell	0x20002000,
497254885Sdumbbell	0x80000000,
498254885Sdumbbell	0x20002000,
499254885Sdumbbell	0x80000000,
500254885Sdumbbell	0x20002000,
501254885Sdumbbell	0x80000000,
502254885Sdumbbell	0x20002000,
503254885Sdumbbell	0x80000000,
504254885Sdumbbell	0x20002000,
505254885Sdumbbell	0x80000000,
506254885Sdumbbell	0x20002000,
507254885Sdumbbell	0x80000000,
508254885Sdumbbell	0x20002000,
509254885Sdumbbell	0x80000000,
510254885Sdumbbell	0x20002000,
511254885Sdumbbell	0x80000000,
512254885Sdumbbell	0x20002000,
513254885Sdumbbell	0x00000000, /* PA_SC_VPORT_ZMIN_0 */
514254885Sdumbbell	0x3f800000,
515254885Sdumbbell	0x00000000,
516254885Sdumbbell	0x3f800000,
517254885Sdumbbell	0x00000000,
518254885Sdumbbell	0x3f800000,
519254885Sdumbbell	0x00000000,
520254885Sdumbbell	0x3f800000,
521254885Sdumbbell	0x00000000,
522254885Sdumbbell	0x3f800000,
523254885Sdumbbell	0x00000000,
524254885Sdumbbell	0x3f800000,
525254885Sdumbbell	0x00000000,
526254885Sdumbbell	0x3f800000,
527254885Sdumbbell	0x00000000,
528254885Sdumbbell	0x3f800000,
529254885Sdumbbell	0x00000000,
530254885Sdumbbell	0x3f800000,
531254885Sdumbbell	0x00000000,
532254885Sdumbbell	0x3f800000,
533254885Sdumbbell	0x00000000,
534254885Sdumbbell	0x3f800000,
535254885Sdumbbell	0x00000000,
536254885Sdumbbell	0x3f800000,
537254885Sdumbbell	0x00000000,
538254885Sdumbbell	0x3f800000,
539254885Sdumbbell	0x00000000,
540254885Sdumbbell	0x3f800000,
541254885Sdumbbell	0x00000000,
542254885Sdumbbell	0x3f800000,
543254885Sdumbbell	0x00000000,
544254885Sdumbbell	0x3f800000,
545254885Sdumbbell
546254885Sdumbbell	0xc0026900,
547254885Sdumbbell	0x00000292,
548254885Sdumbbell	0x00000000, /* PA_SC_MPASS_PS_CNTL */
549254885Sdumbbell	0x00514000, /* PA_SC_MODE_CNTL */
550254885Sdumbbell
551254885Sdumbbell	0xc0096900,
552254885Sdumbbell	0x00000300,
553254885Sdumbbell	0x00000000, /* PA_SC_LINE_CNTL */
554254885Sdumbbell	0x00000000, /* PA_SC_AA_CONFIG */
555254885Sdumbbell	0x0000002d, /* PA_SU_VTX_CNTL */
556254885Sdumbbell	0x3f800000, /* PA_CL_GB_VERT_CLIP_ADJ */
557254885Sdumbbell	0x3f800000,
558254885Sdumbbell	0x3f800000,
559254885Sdumbbell	0x3f800000,
560254885Sdumbbell	0x00000000, /* PA_SC_SAMPLE_LOCS_MCTX */
561254885Sdumbbell	0x00000000,
562254885Sdumbbell
563254885Sdumbbell	0xc0016900,
564254885Sdumbbell	0x00000312,
565254885Sdumbbell	0xffffffff, /* PA_SC_AA_MASK */
566254885Sdumbbell
567254885Sdumbbell	0xc0066900,
568254885Sdumbbell	0x0000037e,
569254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_DB_FMT_CNTL */
570254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_CLAMP */
571254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_FRONT_SCALE */
572254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_FRONT_OFFSET */
573254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_BACK_SCALE */
574254885Sdumbbell	0x00000000, /* PA_SU_POLY_OFFSET_BACK_OFFSET */
575254885Sdumbbell
576254885Sdumbbell	0xc0046900,
577254885Sdumbbell	0x000001b6,
578254885Sdumbbell	0x00000000, /* SPI_INPUT_Z */
579254885Sdumbbell	0x00000000, /* SPI_FOG_CNTL */
580254885Sdumbbell	0x00000000, /* SPI_FOG_FUNC_SCALE */
581254885Sdumbbell	0x00000000, /* SPI_FOG_FUNC_BIAS */
582254885Sdumbbell
583254885Sdumbbell	0xc0016900,
584254885Sdumbbell	0x00000225,
585254885Sdumbbell	0x00000000, /* SQ_PGM_START_FS */
586254885Sdumbbell
587254885Sdumbbell	0xc0016900,
588254885Sdumbbell	0x00000229,
589254885Sdumbbell	0x00000000, /* SQ_PGM_RESOURCES_FS */
590254885Sdumbbell
591254885Sdumbbell	0xc0016900,
592254885Sdumbbell	0x00000237,
593254885Sdumbbell	0x00000000, /* SQ_PGM_CF_OFFSET_FS */
594254885Sdumbbell
595254885Sdumbbell	0xc0026900,
596254885Sdumbbell	0x000002a8,
597254885Sdumbbell	0x00000000, /* VGT_INSTANCE_STEP_RATE_0 */
598254885Sdumbbell	0x00000000, /* VGT_INSTANCE_STEP_RATE_1 */
599254885Sdumbbell
600254885Sdumbbell	0xc0116900,
601254885Sdumbbell	0x00000280,
602254885Sdumbbell	0x00000000, /* PA_SU_POINT_SIZE */
603254885Sdumbbell	0x00000000, /* PA_SU_POINT_MINMAX */
604254885Sdumbbell	0x00000008, /* PA_SU_LINE_CNTL */
605254885Sdumbbell	0x00000000, /* PA_SC_LINE_STIPPLE */
606254885Sdumbbell	0x00000000, /* VGT_OUTPUT_PATH_CNTL */
607254885Sdumbbell	0x00000000, /* VGT_HOS_CNTL */
608254885Sdumbbell	0x00000000, /* VGT_HOS_MAX_TESS_LEVEL */
609254885Sdumbbell	0x00000000, /* VGT_HOS_MIN_TESS_LEVEL */
610254885Sdumbbell	0x00000000, /* VGT_HOS_REUSE_DEPTH */
611254885Sdumbbell	0x00000000, /* VGT_GROUP_PRIM_TYPE */
612254885Sdumbbell	0x00000000, /* VGT_GROUP_FIRST_DECR */
613254885Sdumbbell	0x00000000, /* VGT_GROUP_DECR */
614254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_0_CNTL */
615254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_1_CNTL */
616254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_0_FMT_CNTL */
617254885Sdumbbell	0x00000000, /* VGT_GROUP_VECT_1_FMT_CNTL */
618254885Sdumbbell	0x00000000, /* VGT_GS_MODE */
619254885Sdumbbell
620254885Sdumbbell	0xc0016900,
621254885Sdumbbell	0x000002a1,
622254885Sdumbbell	0x00000000, /* VGT_PRIMITIVEID_EN */
623254885Sdumbbell
624254885Sdumbbell	0xc0016900,
625254885Sdumbbell	0x000002a5,
626254885Sdumbbell	0x00000000, /* VGT_MULTI_PRIM_ID_RESET_EN */
627254885Sdumbbell
628254885Sdumbbell	0xc0036900,
629254885Sdumbbell	0x000002ac,
630254885Sdumbbell	0x00000000, /* VGT_STRMOUT_EN */
631254885Sdumbbell	0x00000000, /* VGT_REUSE_OFF */
632254885Sdumbbell	0x00000000, /* VGT_VTX_CNT_EN */
633254885Sdumbbell
634254885Sdumbbell	0xc0016900,
635254885Sdumbbell	0x000000d4,
636254885Sdumbbell	0x00000000, /* SX_MISC */
637254885Sdumbbell
638254885Sdumbbell	0xc0016900,
639254885Sdumbbell	0x000002c8,
640254885Sdumbbell	0x00000000, /* VGT_STRMOUT_BUFFER_EN */
641254885Sdumbbell
642254885Sdumbbell	0xc0076900,
643254885Sdumbbell	0x00000202,
644254885Sdumbbell	0x00cc0000, /* CB_COLOR_CONTROL */
645254885Sdumbbell	0x00000210, /* DB_SHADER_CNTL */
646254885Sdumbbell	0x00010000, /* PA_CL_CLIP_CNTL */
647254885Sdumbbell	0x00000244, /* PA_SU_SC_MODE_CNTL */
648254885Sdumbbell	0x00000100, /* PA_CL_VTE_CNTL */
649254885Sdumbbell	0x00000000, /* PA_CL_VS_OUT_CNTL */
650254885Sdumbbell	0x00000000, /* PA_CL_NANINF_CNTL */
651254885Sdumbbell
652254885Sdumbbell	0xc0026900,
653254885Sdumbbell	0x0000008e,
654254885Sdumbbell	0x0000000f, /* CB_TARGET_MASK */
655254885Sdumbbell	0x0000000f, /* CB_SHADER_MASK */
656254885Sdumbbell
657254885Sdumbbell	0xc0016900,
658254885Sdumbbell	0x000001e8,
659254885Sdumbbell	0x00000001, /* CB_SHADER_CONTROL */
660254885Sdumbbell
661254885Sdumbbell	0xc0016900,
662254885Sdumbbell	0x00000185,
663254885Sdumbbell	0x00000000, /* SPI_VS_OUT_ID_0 */
664254885Sdumbbell
665254885Sdumbbell	0xc0016900,
666254885Sdumbbell	0x00000191,
667254885Sdumbbell	0x00000b00, /* SPI_PS_INPUT_CNTL_0 */
668254885Sdumbbell
669254885Sdumbbell	0xc0056900,
670254885Sdumbbell	0x000001b1,
671254885Sdumbbell	0x00000000, /* SPI_VS_OUT_CONFIG */
672254885Sdumbbell	0x00000001, /* SPI_THREAD_GROUPING */
673254885Sdumbbell	0x00000001, /* SPI_PS_IN_CONTROL_0 */
674254885Sdumbbell	0x00000000, /* SPI_PS_IN_CONTROL_1 */
675254885Sdumbbell	0x00000000, /* SPI_INTERP_CONTROL_0 */
676254885Sdumbbell
677254885Sdumbbell	0xc0036e00, /* SET_SAMPLER */
678254885Sdumbbell	0x00000000,
679254885Sdumbbell	0x00000012,
680254885Sdumbbell	0x00000000,
681254885Sdumbbell	0x00000000,
682254885Sdumbbell};
683254885Sdumbbell
684254885Sdumbbell/* same for r6xx/r7xx */
685254885Sdumbbellconst u32 r6xx_vs[] =
686254885Sdumbbell{
687254885Sdumbbell	0x00000004,
688254885Sdumbbell	0x81000000,
689254885Sdumbbell	0x0000203c,
690254885Sdumbbell	0x94000b08,
691254885Sdumbbell	0x00004000,
692254885Sdumbbell	0x14200b1a,
693254885Sdumbbell	0x00000000,
694254885Sdumbbell	0x00000000,
695254885Sdumbbell	0x3c000000,
696254885Sdumbbell	0x68cd1000,
697254885Sdumbbell#ifdef __BIG_ENDIAN
698254885Sdumbbell	0x000a0000,
699254885Sdumbbell#else
700254885Sdumbbell	0x00080000,
701254885Sdumbbell#endif
702254885Sdumbbell	0x00000000,
703254885Sdumbbell};
704254885Sdumbbell
705254885Sdumbbellconst u32 r6xx_ps[] =
706254885Sdumbbell{
707254885Sdumbbell	0x00000002,
708254885Sdumbbell	0x80800000,
709254885Sdumbbell	0x00000000,
710254885Sdumbbell	0x94200688,
711254885Sdumbbell	0x00000010,
712254885Sdumbbell	0x000d1000,
713254885Sdumbbell	0xb0800000,
714254885Sdumbbell	0x00000000,
715254885Sdumbbell};
716254885Sdumbbell
717254885Sdumbbellconst u32 r6xx_ps_size = DRM_ARRAY_SIZE(r6xx_ps);
718254885Sdumbbellconst u32 r6xx_vs_size = DRM_ARRAY_SIZE(r6xx_vs);
719254885Sdumbbellconst u32 r6xx_default_size = DRM_ARRAY_SIZE(r6xx_default_state);
720254885Sdumbbellconst u32 r7xx_default_size = DRM_ARRAY_SIZE(r7xx_default_state);
721