/* * Copyright 2010 Jerome Glisse * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Jerome Glisse */ #include "r600.h" #include "r600d.h" void r700_scheduler_states_default(struct r600_winsys *rdev, struct r600_scheduler *scheduler) { struct radeon_ib *ib = scheduler->ib; #if 0 ib->ptr[ib->cpkts++] = PKT3(PKT3_START_3D_CMDBUF, 0); ib->ptr[ib->cpkts++] = 0x00000000; #endif ib->ptr[ib->cpkts++] = PKT3(PKT3_CONTEXT_CONTROL, 1); ib->ptr[ib->cpkts++] = 0x80000000; ib->ptr[ib->cpkts++] = 0x80000000; ib->ptr[ib->cpkts++] = PKT3(PKT3_EVENT_WRITE, 0); ib->ptr[ib->cpkts++] = 0x00000016; /* R_008040_WAIT_UNTIL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x00000010; ib->ptr[ib->cpkts++] = S_008040_WAIT_3D_IDLE(1) | S_008040_WAIT_3D_IDLECLEAN(1); /* R_009714_VC_ENHANCE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x000005C5; ib->ptr[ib->cpkts++] = 0x00000000; /* R7xx R_008D8C_SQ_DYN_GPR_CNTL_PS_FLUSH_REQ */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x00000363; ib->ptr[ib->cpkts++] = 0x00004000; /* R_009839_DB_DEBUG */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x0000060C; ib->ptr[ib->cpkts++] = 0x00000000; /* R_09838_DB_WATERMARK */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x0000060E; ib->ptr[ib->cpkts++] = 0x00420204; /* R_0288A8_SQ_ESGS_RING_ITEMSIZE * R_0288AC_SQ_GSVS_RING_ITEMSIZE * R_0288B0_SQ_ESTMP_RING_ITEMSIZE * R_0288B4_SQ_GSTMP_RING_ITEMSIZE * R_0288B8_SQ_VSTMP_RING_ITEMSIZE * R_0288BC_SQ_PSTMP_RING_ITEMSIZE * R_0288C0_SQ_FBUF_RING_ITEMSIZE * R_0288C4_SQ_REDUC_RING_ITEMSIZE * R_0288C8_SQ_GS_VERT_ITEMSIZE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 9); ib->ptr[ib->cpkts++] = 0x0000022A; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* R7xx R_0287A0_CB_SHADER_CONTROL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x000001E8; ib->ptr[ib->cpkts++] = 0x00000003; /* SX_MISC */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x000000D4; ib->ptr[ib->cpkts++] = 0x00000000; /* SX_ALPHA_TEST_CONTROL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000104; ib->ptr[ib->cpkts++] = 0x00000000; /* SX_ALPHA_REF */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x0000010E; ib->ptr[ib->cpkts++] = 0x00000000; /* SPI_THREAD_GROUPING */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x000001B2; ib->ptr[ib->cpkts++] = 0x00000001; /* SPI_INTERP_CONTROL_0 * SPI_INPUT_Z * SPI_FOG_CNTL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 3); ib->ptr[ib->cpkts++] = 0x000001B5; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* TA_CNTL_AUX */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x00000542; ib->ptr[ib->cpkts++] = 0x07000002; /* VGT_VTX_VECT_EJECT_REG */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x0000022C; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_GS_PER_ES * VGT_ES_PER_GS */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 2); ib->ptr[ib->cpkts++] = 0x00000232; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_GS_VERTEX_REUSE * VGT_MC_LAT_CNTL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 2); ib->ptr[ib->cpkts++] = 0x00000235; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_GS_PER_VS */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x0000023A; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_PRIMITIVE_TYPE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 1); ib->ptr[ib->cpkts++] = 0x00000256; ib->ptr[ib->cpkts++] = 0x00000005; /* VGT_NUM_INDICES * VGT_NUM_INSTANCES */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 2); ib->ptr[ib->cpkts++] = 0x0000025C; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_MAX_VTX_INDX * VGT_MIN_VTX_INDX */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 2); ib->ptr[ib->cpkts++] = 0x00000100; ib->ptr[ib->cpkts++] = 0x00FFFFFF; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_MULTI_PRIM_IB_RESET_INDX */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000103; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_OUTPUT_PATH_CNTL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000284; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_GS_MODE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000290; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_ENHANCE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000294; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_GS_OUT_PRIM_TYPE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x0000029B; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_PRIMITIVEID_EN */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x000002A1; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_MULTI_PRIM_IB_RESET_EN */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x000002A5; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_INSTANCE_STEP_RATE_0 * VGT_INSTANCE_STEP_RATE_1 */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 2); ib->ptr[ib->cpkts++] = 0x000002A8; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_REUSE_OFF * VGT_VTX_CNT_EN */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 2); ib->ptr[ib->cpkts++] = 0x000002AD; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* VGT_VERTEX_REUSE_BLOCK_CNTL * VGT_OUT_DEALLOC_CNTL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 2); ib->ptr[ib->cpkts++] = 0x00000316; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00000000; /* SQ_CONFIG * SQ_GPR_RESOURCE_MGMT_1 * SQ_GPR_RESOURCE_MGMT_2 * SQ_THREAD_RESOURCE_MGMT * SQ_STACK_RESOURCE_MGMT_1 * SQ_STACK_RESOURCE_MGMT_2 */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONFIG_REG, 6); ib->ptr[ib->cpkts++] = 0x00000300; ib->ptr[ib->cpkts++] = 0x0000000D; ib->ptr[ib->cpkts++] = 0x40240054; ib->ptr[ib->cpkts++] = 0x00000000; ib->ptr[ib->cpkts++] = 0x00003CBC; ib->ptr[ib->cpkts++] = 0x00800080; ib->ptr[ib->cpkts++] = 0x00000000; /* R7xx PA_SC_EDGERULE */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x0000008C; ib->ptr[ib->cpkts++] = 0xAAAAAAAA; /* PA_SC_AA_SAMPLE_LOCS_MCTX */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000307; ib->ptr[ib->cpkts++] = 0x00000000; /* PA_SC_AA_SAMPLE_LOCS_8S_WD1_M */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000308; ib->ptr[ib->cpkts++] = 0x00000000; /* PA_SC_WINDOW_OFFSET */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000080; ib->ptr[ib->cpkts++] = 0x00000000; /* PA_SC_VPORT_ZMIN_0 */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 2); ib->ptr[ib->cpkts++] = 0x000000B4; ib->ptr[ib->cpkts++] = 0.0f; ib->ptr[ib->cpkts++] = 1.0f; /* PA_SC_MODE_CNTL */ ib->ptr[ib->cpkts++] = PKT3(PKT3_SET_CONTEXT_REG, 1); ib->ptr[ib->cpkts++] = 0x00000293; ib->ptr[ib->cpkts++] = 0x00514000; }