2 * Copyright 2010 Advanced Micro Devices, Inc.
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:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Alex Deucher <alexander.deucher@amd.com>
30 * evergreen cards need to use the 3D engine to blit data which requires
31 * quite a bit of hw state setup. Rather than pull the whole 3D driver
32 * (which normally generates the 3D state) into the DRM, we opt to use
33 * statically generated state tables. The regsiter state and shaders
34 * were hand generated to support blitting functionality. See the 3D
35 * driver or documentation for descriptions of the registers and
36 * shader instructions.
39 const u32 cayman_default_state[] =
43 0x00000060, /* DB_RENDER_CONTROL */
44 0x00000000, /* DB_COUNT_CONTROL */
45 0x00000000, /* DB_DEPTH_VIEW */
46 0x0000002a, /* DB_RENDER_OVERRIDE */
47 0x00000000, /* DB_RENDER_OVERRIDE2 */
48 0x00000000, /* DB_HTILE_DATA_BASE */
52 0x00000000, /* DB_STENCIL_CLEAR */
53 0x00000000, /* DB_DEPTH_CLEAR */
57 0x00000000, /* DB_DEPTH_INFO */
58 0x00000000, /* DB_Z_INFO */
59 0x00000000, /* DB_STENCIL_INFO */
63 0x00000000, /* PA_SC_WINDOW_OFFSET */
67 0x0000ffff, /* PA_SC_CLIPRECT_RULE */
68 0x00000000, /* PA_SC_CLIPRECT_0_TL */
69 0x20002000, /* PA_SC_CLIPRECT_0_BR */
76 0xaaaaaaaa, /* PA_SC_EDGERULE */
77 0x00000000, /* PA_SU_HARDWARE_SCREEN_OFFSET */
78 0x0000000f, /* CB_TARGET_MASK */
79 0x0000000f, /* CB_SHADER_MASK */
83 0x80000000, /* PA_SC_VPORT_SCISSOR_0_TL */
84 0x20002000, /* PA_SC_VPORT_SCISSOR_0_BR */
115 0x00000000, /* PA_SC_VPORT_ZMIN_0 */
116 0x3f800000, /* PA_SC_VPORT_ZMAX_0 */
120 0x00000000, /* SX_MISC */
124 0x00000000, /* CP_RINGID */
125 0x00000000, /* CP_VMID */
129 0x00ffffff, /* VGT_MAX_VTX_INDX */
130 0x00000000, /* VGT_MIN_VTX_INDX */
131 0x00000000, /* VGT_INDX_OFFSET */
132 0x00000000, /* VGT_MULTI_PRIM_IB_RESET_INDX */
133 0x00000000, /* SX_ALPHA_TEST_CONTROL */
134 0x00000000, /* CB_BLEND_RED */
135 0x00000000, /* CB_BLEND_GREEN */
136 0x00000000, /* CB_BLEND_BLUE */
137 0x00000000, /* CB_BLEND_ALPHA */
141 0x00000100, /* SPI_VS_OUT_ID_0 */
145 0x00000100, /* SPI_PS_INPUT_CNTL_0 */
146 0x00000101, /* SPI_PS_INPUT_CNTL_1 */
150 0x00000000, /* SPI_VS_OUT_CONFIG */
154 0x20000001, /* SPI_PS_IN_CONTROL_0 */
155 0x00000000, /* SPI_PS_IN_CONTROL_1 */
156 0x00000000, /* SPI_INTERP_CONTROL_0 */
157 0x00000000, /* SPI_INPUT_Z */
158 0x00000000, /* SPI_FOG_CNTL */
159 0x00100000, /* SPI_BARYC_CNTL */
160 0x00000000, /* SPI_PS_IN_CONTROL_2 */
161 0x00000000, /* SPI_COMPUTE_INPUT_CNTL */
162 0x00000000, /* SPI_COMPUTE_NUM_THREAD_X */
163 0x00000000, /* SPI_COMPUTE_NUM_THREAD_Y */
164 0x00000000, /* SPI_COMPUTE_NUM_THREAD_Z */
165 0x00000000, /* SPI_GPR_MGMT */
166 0x00000000, /* SPI_LDS_MGMT */
167 0x00000000, /* SPI_STACK_MGMT */
168 0x00000000, /* SPI_WAVE_MGMT_1 */
169 0x00000000, /* SPI_WAVE_MGMT_2 */
173 0x00000000, /* CB_BLEND0_CONTROL */
177 0x00000000, /* DB_DEPTH_CONTROL */
178 0x00000000, /* DB_EQAA */
179 0x00cc0010, /* CB_COLOR_CONTROL */
180 0x00000210, /* DB_SHADER_CONTROL */
181 0x00010000, /* PA_CL_CLIP_CNTL */
182 0x00000004, /* PA_SU_SC_MODE_CNTL */
183 0x00000100, /* PA_CL_VTE_CNTL */
184 0x00000000, /* PA_CL_VS_OUT_CNTL */
185 0x00000000, /* PA_CL_NANINF_CNTL */
186 0x00000000, /* PA_SU_LINE_STIPPLE_CNTL */
187 0x00000000, /* PA_SU_LINE_STIPPLE_SCALE */
188 0x00000000, /* PA_SU_PRIM_FILTER_CNTL */
194 0x00000000, /* SQ_PGM_START_FS */
199 0x00000000, /* SQ_LDS_ALLOC_PS */
203 0x00000000, /* SQ_ESGS_RING_ITEMSIZE */
212 0x00000000, /* SQ_GS_VERT_ITEMSIZE */
219 0x00000000, /* PA_SU_POINT_SIZE */
220 0x00000000, /* PA_SU_POINT_MINMAX */
221 0x00000008, /* PA_SU_LINE_CNTL */
222 0x00000000, /* PA_SC_LINE_STIPPLE */
223 0x00000000, /* VGT_OUTPUT_PATH_CNTL */
224 0x00000000, /* VGT_HOS_CNTL */
235 0x00000000, /* VGT_GS_MODE */
239 0x00000000, /* PA_SC_MODE_CNTL_0 */
240 0x00000000, /* PA_SC_MODE_CNTL_1 */
244 0x00000000, /* VGT_PRIMITIVEID_EN */
248 0x00000000, /* VGT_MULTI_PRIM_IB_RESET_EN */
252 0x00000000, /* VGT_INSTANCE_STEP_RATE_0 */
257 0x00000000, /* VGT_REUSE_OFF */
262 0x00000000, /* VGT_SHADER_STAGES_EN */
266 0x0000aa00, /* DB_ALPHA_TO_MASK */
270 0x00000000, /* PA_SU_POLY_OFFSET_DB_FMT_CNTL */
279 0x00000000, /* VGT_STRMOUT_CONFIG */
284 0x76543210, /* PA_SC_CENTROID_PRIORITY_0 */
285 0xfedcba98, /* PA_SC_CENTROID_PRIORITY_1 */
286 0x00000000, /* PA_SC_LINE_CNTL */
287 0x00000000, /* PA_SC_AA_CONFIG */
288 0x00000005, /* PA_SU_VTX_CNTL */
289 0x3f800000, /* PA_CL_GB_VERT_CLIP_ADJ */
290 0x3f800000, /* PA_CL_GB_VERT_DISC_ADJ */
291 0x3f800000, /* PA_CL_GB_HORZ_CLIP_ADJ */
292 0x3f800000, /* PA_CL_GB_HORZ_DISC_ADJ */
293 0x00000000, /* PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 */
309 0xffffffff, /* PA_SC_AA_MASK_X0Y0_X1Y0 */
314 0x0000000e, /* VGT_VERTEX_REUSE_BLOCK_CNTL */
318 const u32 cayman_vs[] =
346 const u32 cayman_ps[] =
370 const u32 cayman_ps_size = DRM_ARRAY_SIZE(cayman_ps);
371 const u32 cayman_vs_size = DRM_ARRAY_SIZE(cayman_vs);
372 const u32 cayman_default_size = DRM_ARRAY_SIZE(cayman_default_state);