162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright 2010 Advanced Micro Devices, Inc.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * The above copyright notice and this permission notice (including the next
1262306a36Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
1362306a36Sopenharmony_ci * Software.
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1662306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1762306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1862306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
1962306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2062306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2162306a36Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * Authors:
2462306a36Sopenharmony_ci *     Alex Deucher <alexander.deucher@amd.com>
2562306a36Sopenharmony_ci */
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#ifndef CAYMAN_BLIT_SHADERS_H
2862306a36Sopenharmony_ci#define CAYMAN_BLIT_SHADERS_H
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/*
3162306a36Sopenharmony_ci * evergreen cards need to use the 3D engine to blit data which requires
3262306a36Sopenharmony_ci * quite a bit of hw state setup.  Rather than pull the whole 3D driver
3362306a36Sopenharmony_ci * (which normally generates the 3D state) into the DRM, we opt to use
3462306a36Sopenharmony_ci * statically generated state tables.  The register state and shaders
3562306a36Sopenharmony_ci * were hand generated to support blitting functionality.  See the 3D
3662306a36Sopenharmony_ci * driver or documentation for descriptions of the registers and
3762306a36Sopenharmony_ci * shader instructions.
3862306a36Sopenharmony_ci */
3962306a36Sopenharmony_cistatic const u32 cayman_default_state[] = {
4062306a36Sopenharmony_ci	0xc0066900,
4162306a36Sopenharmony_ci	0x00000000,
4262306a36Sopenharmony_ci	0x00000060, /* DB_RENDER_CONTROL */
4362306a36Sopenharmony_ci	0x00000000, /* DB_COUNT_CONTROL */
4462306a36Sopenharmony_ci	0x00000000, /* DB_DEPTH_VIEW */
4562306a36Sopenharmony_ci	0x0000002a, /* DB_RENDER_OVERRIDE */
4662306a36Sopenharmony_ci	0x00000000, /* DB_RENDER_OVERRIDE2 */
4762306a36Sopenharmony_ci	0x00000000, /* DB_HTILE_DATA_BASE */
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci	0xc0026900,
5062306a36Sopenharmony_ci	0x0000000a,
5162306a36Sopenharmony_ci	0x00000000, /* DB_STENCIL_CLEAR */
5262306a36Sopenharmony_ci	0x00000000, /* DB_DEPTH_CLEAR */
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci	0xc0036900,
5562306a36Sopenharmony_ci	0x0000000f,
5662306a36Sopenharmony_ci	0x00000000, /* DB_DEPTH_INFO */
5762306a36Sopenharmony_ci	0x00000000, /* DB_Z_INFO */
5862306a36Sopenharmony_ci	0x00000000, /* DB_STENCIL_INFO */
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci	0xc0016900,
6162306a36Sopenharmony_ci	0x00000080,
6262306a36Sopenharmony_ci	0x00000000, /* PA_SC_WINDOW_OFFSET */
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci	0xc00d6900,
6562306a36Sopenharmony_ci	0x00000083,
6662306a36Sopenharmony_ci	0x0000ffff, /* PA_SC_CLIPRECT_RULE */
6762306a36Sopenharmony_ci	0x00000000, /* PA_SC_CLIPRECT_0_TL */
6862306a36Sopenharmony_ci	0x20002000, /* PA_SC_CLIPRECT_0_BR */
6962306a36Sopenharmony_ci	0x00000000,
7062306a36Sopenharmony_ci	0x20002000,
7162306a36Sopenharmony_ci	0x00000000,
7262306a36Sopenharmony_ci	0x20002000,
7362306a36Sopenharmony_ci	0x00000000,
7462306a36Sopenharmony_ci	0x20002000,
7562306a36Sopenharmony_ci	0xaaaaaaaa, /* PA_SC_EDGERULE */
7662306a36Sopenharmony_ci	0x00000000, /* PA_SU_HARDWARE_SCREEN_OFFSET */
7762306a36Sopenharmony_ci	0x0000000f, /* CB_TARGET_MASK */
7862306a36Sopenharmony_ci	0x0000000f, /* CB_SHADER_MASK */
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci	0xc0226900,
8162306a36Sopenharmony_ci	0x00000094,
8262306a36Sopenharmony_ci	0x80000000, /* PA_SC_VPORT_SCISSOR_0_TL */
8362306a36Sopenharmony_ci	0x20002000, /* PA_SC_VPORT_SCISSOR_0_BR */
8462306a36Sopenharmony_ci	0x80000000,
8562306a36Sopenharmony_ci	0x20002000,
8662306a36Sopenharmony_ci	0x80000000,
8762306a36Sopenharmony_ci	0x20002000,
8862306a36Sopenharmony_ci	0x80000000,
8962306a36Sopenharmony_ci	0x20002000,
9062306a36Sopenharmony_ci	0x80000000,
9162306a36Sopenharmony_ci	0x20002000,
9262306a36Sopenharmony_ci	0x80000000,
9362306a36Sopenharmony_ci	0x20002000,
9462306a36Sopenharmony_ci	0x80000000,
9562306a36Sopenharmony_ci	0x20002000,
9662306a36Sopenharmony_ci	0x80000000,
9762306a36Sopenharmony_ci	0x20002000,
9862306a36Sopenharmony_ci	0x80000000,
9962306a36Sopenharmony_ci	0x20002000,
10062306a36Sopenharmony_ci	0x80000000,
10162306a36Sopenharmony_ci	0x20002000,
10262306a36Sopenharmony_ci	0x80000000,
10362306a36Sopenharmony_ci	0x20002000,
10462306a36Sopenharmony_ci	0x80000000,
10562306a36Sopenharmony_ci	0x20002000,
10662306a36Sopenharmony_ci	0x80000000,
10762306a36Sopenharmony_ci	0x20002000,
10862306a36Sopenharmony_ci	0x80000000,
10962306a36Sopenharmony_ci	0x20002000,
11062306a36Sopenharmony_ci	0x80000000,
11162306a36Sopenharmony_ci	0x20002000,
11262306a36Sopenharmony_ci	0x80000000,
11362306a36Sopenharmony_ci	0x20002000,
11462306a36Sopenharmony_ci	0x00000000, /* PA_SC_VPORT_ZMIN_0 */
11562306a36Sopenharmony_ci	0x3f800000, /* PA_SC_VPORT_ZMAX_0 */
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci	0xc0016900,
11862306a36Sopenharmony_ci	0x000000d4,
11962306a36Sopenharmony_ci	0x00000000, /* SX_MISC */
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci	0xc0026900,
12262306a36Sopenharmony_ci	0x000000d9,
12362306a36Sopenharmony_ci	0x00000000, /* CP_RINGID */
12462306a36Sopenharmony_ci	0x00000000, /* CP_VMID */
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci	0xc0096900,
12762306a36Sopenharmony_ci	0x00000100,
12862306a36Sopenharmony_ci	0x00ffffff, /* VGT_MAX_VTX_INDX */
12962306a36Sopenharmony_ci	0x00000000, /* VGT_MIN_VTX_INDX */
13062306a36Sopenharmony_ci	0x00000000, /* VGT_INDX_OFFSET */
13162306a36Sopenharmony_ci	0x00000000, /* VGT_MULTI_PRIM_IB_RESET_INDX */
13262306a36Sopenharmony_ci	0x00000000, /* SX_ALPHA_TEST_CONTROL */
13362306a36Sopenharmony_ci	0x00000000, /* CB_BLEND_RED */
13462306a36Sopenharmony_ci	0x00000000, /* CB_BLEND_GREEN */
13562306a36Sopenharmony_ci	0x00000000, /* CB_BLEND_BLUE */
13662306a36Sopenharmony_ci	0x00000000, /* CB_BLEND_ALPHA */
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci	0xc0016900,
13962306a36Sopenharmony_ci	0x00000187,
14062306a36Sopenharmony_ci	0x00000100, /* SPI_VS_OUT_ID_0 */
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci	0xc0026900,
14362306a36Sopenharmony_ci	0x00000191,
14462306a36Sopenharmony_ci	0x00000100, /* SPI_PS_INPUT_CNTL_0 */
14562306a36Sopenharmony_ci	0x00000101, /* SPI_PS_INPUT_CNTL_1 */
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci	0xc0016900,
14862306a36Sopenharmony_ci	0x000001b1,
14962306a36Sopenharmony_ci	0x00000000, /* SPI_VS_OUT_CONFIG */
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci	0xc0106900,
15262306a36Sopenharmony_ci	0x000001b3,
15362306a36Sopenharmony_ci	0x20000001, /* SPI_PS_IN_CONTROL_0 */
15462306a36Sopenharmony_ci	0x00000000, /* SPI_PS_IN_CONTROL_1 */
15562306a36Sopenharmony_ci	0x00000000, /* SPI_INTERP_CONTROL_0 */
15662306a36Sopenharmony_ci	0x00000000, /* SPI_INPUT_Z */
15762306a36Sopenharmony_ci	0x00000000, /* SPI_FOG_CNTL */
15862306a36Sopenharmony_ci	0x00100000, /* SPI_BARYC_CNTL */
15962306a36Sopenharmony_ci	0x00000000, /* SPI_PS_IN_CONTROL_2 */
16062306a36Sopenharmony_ci	0x00000000, /* SPI_COMPUTE_INPUT_CNTL */
16162306a36Sopenharmony_ci	0x00000000, /* SPI_COMPUTE_NUM_THREAD_X */
16262306a36Sopenharmony_ci	0x00000000, /* SPI_COMPUTE_NUM_THREAD_Y */
16362306a36Sopenharmony_ci	0x00000000, /* SPI_COMPUTE_NUM_THREAD_Z */
16462306a36Sopenharmony_ci	0x00000000, /* SPI_GPR_MGMT */
16562306a36Sopenharmony_ci	0x00000000, /* SPI_LDS_MGMT */
16662306a36Sopenharmony_ci	0x00000000, /* SPI_STACK_MGMT */
16762306a36Sopenharmony_ci	0x00000000, /* SPI_WAVE_MGMT_1 */
16862306a36Sopenharmony_ci	0x00000000, /* SPI_WAVE_MGMT_2 */
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci	0xc0016900,
17162306a36Sopenharmony_ci	0x000001e0,
17262306a36Sopenharmony_ci	0x00000000, /* CB_BLEND0_CONTROL */
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ci	0xc00e6900,
17562306a36Sopenharmony_ci	0x00000200,
17662306a36Sopenharmony_ci	0x00000000, /* DB_DEPTH_CONTROL */
17762306a36Sopenharmony_ci	0x00000000, /* DB_EQAA */
17862306a36Sopenharmony_ci	0x00cc0010, /* CB_COLOR_CONTROL */
17962306a36Sopenharmony_ci	0x00000210, /* DB_SHADER_CONTROL */
18062306a36Sopenharmony_ci	0x00010000, /* PA_CL_CLIP_CNTL */
18162306a36Sopenharmony_ci	0x00000004, /* PA_SU_SC_MODE_CNTL */
18262306a36Sopenharmony_ci	0x00000100, /* PA_CL_VTE_CNTL */
18362306a36Sopenharmony_ci	0x00000000, /* PA_CL_VS_OUT_CNTL */
18462306a36Sopenharmony_ci	0x00000000, /* PA_CL_NANINF_CNTL */
18562306a36Sopenharmony_ci	0x00000000, /* PA_SU_LINE_STIPPLE_CNTL */
18662306a36Sopenharmony_ci	0x00000000, /* PA_SU_LINE_STIPPLE_SCALE */
18762306a36Sopenharmony_ci	0x00000000, /* PA_SU_PRIM_FILTER_CNTL */
18862306a36Sopenharmony_ci	0x00000000, /*  */
18962306a36Sopenharmony_ci	0x00000000, /*  */
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ci	0xc0026900,
19262306a36Sopenharmony_ci	0x00000229,
19362306a36Sopenharmony_ci	0x00000000, /* SQ_PGM_START_FS */
19462306a36Sopenharmony_ci	0x00000000,
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci	0xc0016900,
19762306a36Sopenharmony_ci	0x0000023b,
19862306a36Sopenharmony_ci	0x00000000, /* SQ_LDS_ALLOC_PS */
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci	0xc0066900,
20162306a36Sopenharmony_ci	0x00000240,
20262306a36Sopenharmony_ci	0x00000000, /* SQ_ESGS_RING_ITEMSIZE */
20362306a36Sopenharmony_ci	0x00000000,
20462306a36Sopenharmony_ci	0x00000000,
20562306a36Sopenharmony_ci	0x00000000,
20662306a36Sopenharmony_ci	0x00000000,
20762306a36Sopenharmony_ci	0x00000000,
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci	0xc0046900,
21062306a36Sopenharmony_ci	0x00000247,
21162306a36Sopenharmony_ci	0x00000000, /* SQ_GS_VERT_ITEMSIZE */
21262306a36Sopenharmony_ci	0x00000000,
21362306a36Sopenharmony_ci	0x00000000,
21462306a36Sopenharmony_ci	0x00000000,
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci	0xc0116900,
21762306a36Sopenharmony_ci	0x00000280,
21862306a36Sopenharmony_ci	0x00000000, /* PA_SU_POINT_SIZE */
21962306a36Sopenharmony_ci	0x00000000, /* PA_SU_POINT_MINMAX */
22062306a36Sopenharmony_ci	0x00000008, /* PA_SU_LINE_CNTL */
22162306a36Sopenharmony_ci	0x00000000, /* PA_SC_LINE_STIPPLE */
22262306a36Sopenharmony_ci	0x00000000, /* VGT_OUTPUT_PATH_CNTL */
22362306a36Sopenharmony_ci	0x00000000, /* VGT_HOS_CNTL */
22462306a36Sopenharmony_ci	0x00000000,
22562306a36Sopenharmony_ci	0x00000000,
22662306a36Sopenharmony_ci	0x00000000,
22762306a36Sopenharmony_ci	0x00000000,
22862306a36Sopenharmony_ci	0x00000000,
22962306a36Sopenharmony_ci	0x00000000,
23062306a36Sopenharmony_ci	0x00000000,
23162306a36Sopenharmony_ci	0x00000000,
23262306a36Sopenharmony_ci	0x00000000,
23362306a36Sopenharmony_ci	0x00000000,
23462306a36Sopenharmony_ci	0x00000000, /* VGT_GS_MODE */
23562306a36Sopenharmony_ci
23662306a36Sopenharmony_ci	0xc0026900,
23762306a36Sopenharmony_ci	0x00000292,
23862306a36Sopenharmony_ci	0x00000000, /* PA_SC_MODE_CNTL_0 */
23962306a36Sopenharmony_ci	0x00000000, /* PA_SC_MODE_CNTL_1 */
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci	0xc0016900,
24262306a36Sopenharmony_ci	0x000002a1,
24362306a36Sopenharmony_ci	0x00000000, /* VGT_PRIMITIVEID_EN */
24462306a36Sopenharmony_ci
24562306a36Sopenharmony_ci	0xc0016900,
24662306a36Sopenharmony_ci	0x000002a5,
24762306a36Sopenharmony_ci	0x00000000, /* VGT_MULTI_PRIM_IB_RESET_EN */
24862306a36Sopenharmony_ci
24962306a36Sopenharmony_ci	0xc0026900,
25062306a36Sopenharmony_ci	0x000002a8,
25162306a36Sopenharmony_ci	0x00000000, /* VGT_INSTANCE_STEP_RATE_0 */
25262306a36Sopenharmony_ci	0x00000000,
25362306a36Sopenharmony_ci
25462306a36Sopenharmony_ci	0xc0026900,
25562306a36Sopenharmony_ci	0x000002ad,
25662306a36Sopenharmony_ci	0x00000000, /* VGT_REUSE_OFF */
25762306a36Sopenharmony_ci	0x00000000,
25862306a36Sopenharmony_ci
25962306a36Sopenharmony_ci	0xc0016900,
26062306a36Sopenharmony_ci	0x000002d5,
26162306a36Sopenharmony_ci	0x00000000, /* VGT_SHADER_STAGES_EN */
26262306a36Sopenharmony_ci
26362306a36Sopenharmony_ci	0xc0016900,
26462306a36Sopenharmony_ci	0x000002dc,
26562306a36Sopenharmony_ci	0x0000aa00, /* DB_ALPHA_TO_MASK */
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci	0xc0066900,
26862306a36Sopenharmony_ci	0x000002de,
26962306a36Sopenharmony_ci	0x00000000, /* PA_SU_POLY_OFFSET_DB_FMT_CNTL */
27062306a36Sopenharmony_ci	0x00000000,
27162306a36Sopenharmony_ci	0x00000000,
27262306a36Sopenharmony_ci	0x00000000,
27362306a36Sopenharmony_ci	0x00000000,
27462306a36Sopenharmony_ci	0x00000000,
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci	0xc0026900,
27762306a36Sopenharmony_ci	0x000002e5,
27862306a36Sopenharmony_ci	0x00000000, /* VGT_STRMOUT_CONFIG */
27962306a36Sopenharmony_ci	0x00000000,
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci	0xc01b6900,
28262306a36Sopenharmony_ci	0x000002f5,
28362306a36Sopenharmony_ci	0x76543210, /* PA_SC_CENTROID_PRIORITY_0 */
28462306a36Sopenharmony_ci	0xfedcba98, /* PA_SC_CENTROID_PRIORITY_1 */
28562306a36Sopenharmony_ci	0x00000000, /* PA_SC_LINE_CNTL */
28662306a36Sopenharmony_ci	0x00000000, /* PA_SC_AA_CONFIG */
28762306a36Sopenharmony_ci	0x00000005, /* PA_SU_VTX_CNTL */
28862306a36Sopenharmony_ci	0x3f800000, /* PA_CL_GB_VERT_CLIP_ADJ */
28962306a36Sopenharmony_ci	0x3f800000, /* PA_CL_GB_VERT_DISC_ADJ */
29062306a36Sopenharmony_ci	0x3f800000, /* PA_CL_GB_HORZ_CLIP_ADJ */
29162306a36Sopenharmony_ci	0x3f800000, /* PA_CL_GB_HORZ_DISC_ADJ */
29262306a36Sopenharmony_ci	0x00000000, /* PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 */
29362306a36Sopenharmony_ci	0x00000000,
29462306a36Sopenharmony_ci	0x00000000,
29562306a36Sopenharmony_ci	0x00000000,
29662306a36Sopenharmony_ci	0x00000000,
29762306a36Sopenharmony_ci	0x00000000,
29862306a36Sopenharmony_ci	0x00000000,
29962306a36Sopenharmony_ci	0x00000000,
30062306a36Sopenharmony_ci	0x00000000,
30162306a36Sopenharmony_ci	0x00000000,
30262306a36Sopenharmony_ci	0x00000000,
30362306a36Sopenharmony_ci	0x00000000,
30462306a36Sopenharmony_ci	0x00000000,
30562306a36Sopenharmony_ci	0x00000000,
30662306a36Sopenharmony_ci	0x00000000,
30762306a36Sopenharmony_ci	0x00000000,
30862306a36Sopenharmony_ci	0xffffffff, /* PA_SC_AA_MASK_X0Y0_X1Y0 */
30962306a36Sopenharmony_ci	0xffffffff,
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_ci	0xc0026900,
31262306a36Sopenharmony_ci	0x00000316,
31362306a36Sopenharmony_ci	0x0000000e, /* VGT_VERTEX_REUSE_BLOCK_CNTL */
31462306a36Sopenharmony_ci	0x00000010, /*  */
31562306a36Sopenharmony_ci};
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_cistatic const u32 cayman_default_size = ARRAY_SIZE(cayman_default_state);
31862306a36Sopenharmony_ci
31962306a36Sopenharmony_ci#endif
320