- rstate = radeon_state(rscreen->rw, R600_VS_RESOURCE0 + 1);
- if (rstate == NULL) {
- return -ENOMEM;
- }
- rstate->states[R600_RESOURCE__RESOURCE_WORD0] = 0x00000010;
- rstate->states[R600_RESOURCE__RESOURCE_WORD1] = 0x00000070;
- rstate->states[R600_RESOURCE__RESOURCE_WORD2] = 0x02302000;
- rstate->states[R600_RESOURCE__RESOURCE_WORD3] = 0x00000000;
- rstate->states[R600_RESOURCE__RESOURCE_WORD4] = 0x00000000;
- rstate->states[R600_RESOURCE__RESOURCE_WORD5] = 0x00000000;
- rstate->states[R600_RESOURCE__RESOURCE_WORD6] = 0xC0000000;
- rstate->bo[0] = radeon_bo_incref(rscreen->rw, bo);
- rstate->nbo = 1;
- rstate->placement[0] = RADEON_GEM_DOMAIN_GTT;
- if (radeon_state_pm4(rstate)) {
- radeon_state_decref(rstate);
- return -ENOMEM;
- }
- bstates->vs_resource1 = rstate;
-
- return 0;
-}
-
-static struct radeon_state *r600_blit_state_vs_shader(struct r600_screen *rscreen)
-{
- struct radeon_state *rstate;
- struct radeon_bo *bo;
- u32 shader_bc_r600[] = {
- 0x00000004, 0x81000400,
- 0x00000008, 0xA01C0000,
- 0xC001A03C, 0x94000688,
- 0xC0024000, 0x94200688,
- 0x7C000000, 0x002D1001,
- 0x00080000, 0x00000000,
- 0x7C000100, 0x002D1002,
- 0x00080000, 0x00000000,
- 0x00000001, 0x00601910,
- 0x00000401, 0x20601910,
- 0x00000801, 0x40601910,
- 0x80000C01, 0x60601910,
- 0x00000002, 0x00801910,
- 0x00000402, 0x20801910,
- 0x00000802, 0x40801910,
- 0x80000C02, 0x60801910
- };
- u32 shader_bc_r700[] = {
- 0x00000004, 0x81000400,
- 0x00000008, 0xA01C0000,
- 0xC001A03C, 0x94000688,
- 0xC0024000, 0x94200688,
- 0x7C000000, 0x002D1001,
- 0x00080000, 0x00000000,
- 0x7C000100, 0x002D1002,
- 0x00080000, 0x00000000,
- 0x00000001, 0x00600C90,
- 0x00000401, 0x20600C90,
- 0x00000801, 0x40600C90,
- 0x80000C01, 0x60600C90,
- 0x00000002, 0x00800C90,
- 0x00000402, 0x20800C90,
- 0x00000802, 0x40800C90,
- 0x80000C02, 0x60800C90
- };
-
- /* simple shader */
- bo = radeon_bo(rscreen->rw, 0, 128, 4096, NULL);
- if (bo == NULL) {
- return NULL;
- }
- if (radeon_bo_map(rscreen->rw, bo)) {
- radeon_bo_decref(rscreen->rw, bo);
- return NULL;
- }
- switch (rscreen->chip_class) {
- case R600:
- memcpy(bo->data, shader_bc_r600, 128);
- break;
- case R700:
- memcpy(bo->data, shader_bc_r700, 128);
- break;
- default:
- R600_ERR("unsupported chip family\n");
- radeon_bo_unmap(rscreen->rw, bo);
- radeon_bo_decref(rscreen->rw, bo);
- return NULL;
- }
- radeon_bo_unmap(rscreen->rw, bo);