diff options
-rw-r--r-- | src/gallium/drivers/ilo/ilo_shader.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_shader.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_fs.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_gs.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_vs.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_compiler.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_compiler.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_compiler_disasm.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_helpers.h | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_legalize.c | 16 |
10 files changed, 33 insertions, 33 deletions
diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c index 90793448381..9a367213fa5 100644 --- a/src/gallium/drivers/ilo/ilo_shader.c +++ b/src/gallium/drivers/ilo/ilo_shader.c @@ -327,8 +327,8 @@ ilo_shader_state_create(const struct ilo_context *ilo, if (!state) return NULL; + state->info.dev = ilo->dev; state->info.type = type; - state->info.gen = ilo->dev->gen; if (type == PIPE_SHADER_COMPUTE) { const struct pipe_compute_state *c = diff --git a/src/gallium/drivers/ilo/ilo_shader.h b/src/gallium/drivers/ilo/ilo_shader.h index 2c9e556adf8..accea7ad6be 100644 --- a/src/gallium/drivers/ilo/ilo_shader.h +++ b/src/gallium/drivers/ilo/ilo_shader.h @@ -126,8 +126,8 @@ struct ilo_shader { * Information about a shader state. */ struct ilo_shader_info { + const struct ilo_dev_info *dev; int type; - int gen; const struct tgsi_token *tokens; diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c index d5f365cb4d7..1766f6f224f 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c @@ -400,7 +400,7 @@ fs_lower_opcode_tgsi_direct(struct fs_compile_context *fcc, fs_lower_opcode_tgsi_in(fcc, inst->dst, dim, idx); break; case TOY_OPCODE_TGSI_CONST: - if (tc->gen >= ILO_GEN(7)) + if (tc->dev->gen >= ILO_GEN(7)) fs_lower_opcode_tgsi_const_gen7(fcc, inst->dst, dim, inst->src[1]); else fs_lower_opcode_tgsi_const_gen6(fcc, inst->dst, dim, inst->src[1]); @@ -921,7 +921,7 @@ fs_prepare_tgsi_sampling(struct toy_compiler *tc, const struct toy_inst *inst, } /* set up sampler parameters */ - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { msg_len = fs_add_sampler_params_gen7(tc, msg_type, base_mrf, param_size, coords, num_coords, bias_or_lod, ref_or_si, ddx, ddy, num_derivs); } @@ -1607,7 +1607,7 @@ fs_setup(struct fs_compile_context *fcc, fcc->variant = variant; - toy_compiler_init(&fcc->tc, state->info.gen); + toy_compiler_init(&fcc->tc, state->info.dev); fcc->dispatch_mode = GEN6_WM_8_DISPATCH_ENABLE; @@ -1654,7 +1654,7 @@ fs_setup(struct fs_compile_context *fcc, fcc->num_grf_per_vrf = (fcc->dispatch_mode == GEN6_WM_16_DISPATCH_ENABLE) ? 2 : 1; - if (fcc->tc.gen >= ILO_GEN(7)) { + if (fcc->tc.dev->gen >= ILO_GEN(7)) { fcc->last_free_grf -= 15; fcc->first_free_mrf = fcc->last_free_grf + 1; fcc->last_free_mrf = fcc->first_free_mrf + 14; diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_gs.c b/src/gallium/drivers/ilo/shader/ilo_shader_gs.c index 620e0bffc15..a07e39c3e8d 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_gs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_gs.c @@ -1248,7 +1248,7 @@ gs_setup(struct gs_compile_context *gcc, gcc->variant = variant; gcc->so_info = &state->info.stream_output; - toy_compiler_init(&gcc->tc, state->info.gen); + toy_compiler_init(&gcc->tc, state->info.dev); gcc->write_so = (state->info.stream_output.num_outputs > 0); gcc->write_vue = !gcc->variant->u.gs.rasterizer_discard; diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c index 09a7b0424e7..ff4e4be01cc 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c @@ -215,7 +215,7 @@ vs_lower_opcode_tgsi_direct(struct vs_compile_context *vcc, vs_lower_opcode_tgsi_in(vcc, inst->dst, dim, idx); break; case TOY_OPCODE_TGSI_CONST: - if (tc->gen >= ILO_GEN(7)) + if (tc->dev->gen >= ILO_GEN(7)) vs_lower_opcode_tgsi_const_gen7(vcc, inst->dst, dim, inst->src[1]); else vs_lower_opcode_tgsi_const_gen6(vcc, inst->dst, dim, inst->src[1]); @@ -269,7 +269,7 @@ vs_lower_opcode_tgsi_indirect(struct vs_compile_context *vcc, indirect_idx = tsrc_from(tmp); } - if (tc->gen >= ILO_GEN(7)) + if (tc->dev->gen >= ILO_GEN(7)) vs_lower_opcode_tgsi_const_gen7(vcc, inst->dst, dim, indirect_idx); else vs_lower_opcode_tgsi_const_gen6(vcc, inst->dst, dim, indirect_idx); @@ -334,7 +334,7 @@ vs_add_sampler_params(struct toy_compiler *tc, int msg_type, int base_mrf, assert(num_coords <= 3); tc_MOV(tc, tdst_writemask(tdst_d(m[0]), coords_writemask), coords); tc_MOV(tc, tdst_writemask(tdst_d(m[0]), TOY_WRITEMASK_W), bias_or_lod); - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { num_params = 4; } else { @@ -876,7 +876,7 @@ vs_write_vue(struct vs_compile_context *vcc) inst = tc_MOV(tc, header, r0); inst->mask_ctrl = BRW_MASK_DISABLE; - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { inst = tc_OR(tc, tdst_offset(header, 0, 5), tsrc_rect(tsrc_offset(r0, 0, 5), TOY_RECT_010), tsrc_rect(tsrc_imm_ud(0xff00), TOY_RECT_010)); @@ -914,7 +914,7 @@ vs_write_vue(struct vs_compile_context *vcc) eot = false; } - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { /* do not forget about the header */ msg_len = 1 + num_attrs; } @@ -1162,7 +1162,7 @@ vs_setup(struct vs_compile_context *vcc, vcc->variant = variant; - toy_compiler_init(&vcc->tc, state->info.gen); + toy_compiler_init(&vcc->tc, state->info.dev); vcc->tc.templ.access_mode = BRW_ALIGN_16; vcc->tc.templ.exec_size = BRW_EXECUTE_8; vcc->tc.rect_linear_width = 4; @@ -1198,7 +1198,7 @@ vs_setup(struct vs_compile_context *vcc, vcc->num_grf_per_vrf = 1; - if (vcc->tc.gen >= ILO_GEN(7)) { + if (vcc->tc.dev->gen >= ILO_GEN(7)) { vcc->last_free_grf -= 15; vcc->first_free_mrf = vcc->last_free_grf + 1; vcc->last_free_mrf = vcc->first_free_mrf + 14; @@ -1224,7 +1224,7 @@ ilo_shader_compile_vs(const struct ilo_shader_state *state, if (!vs_setup(&vcc, state, variant)) return NULL; - if (vcc.tc.gen >= ILO_GEN(7)) { + if (vcc.tc.dev->gen >= ILO_GEN(7)) { need_gs = false; } else { diff --git a/src/gallium/drivers/ilo/shader/toy_compiler.c b/src/gallium/drivers/ilo/shader/toy_compiler.c index 73b03e62594..71f6fa87dd9 100644 --- a/src/gallium/drivers/ilo/shader/toy_compiler.c +++ b/src/gallium/drivers/ilo/shader/toy_compiler.c @@ -534,11 +534,11 @@ tc_init_inst_templ(struct toy_compiler *tc) * Initialize the toy compiler. */ void -toy_compiler_init(struct toy_compiler *tc, int gen) +toy_compiler_init(struct toy_compiler *tc, const struct ilo_dev_info *dev) { memset(tc, 0, sizeof(*tc)); - tc->gen = gen; + tc->dev = dev; tc_init_inst_templ(tc); diff --git a/src/gallium/drivers/ilo/shader/toy_compiler.h b/src/gallium/drivers/ilo/shader/toy_compiler.h index a6413ead066..3238c22b478 100644 --- a/src/gallium/drivers/ilo/shader/toy_compiler.h +++ b/src/gallium/drivers/ilo/shader/toy_compiler.h @@ -28,9 +28,9 @@ #ifndef TOY_COMPILER_H #define TOY_COMPILER_H +#include "util/u_slab.h" #include "brw_defines.h" -#include "util/u_slab.h" #include "ilo_common.h" #include "toy_compiler_reg.h" @@ -138,7 +138,7 @@ struct toy_inst { * Toy compiler. */ struct toy_compiler { - int gen; + const struct ilo_dev_info *dev; struct toy_inst templ; struct util_slab_mempool mempool; @@ -456,7 +456,7 @@ tc_fail(struct toy_compiler *tc, const char *reason) } void -toy_compiler_init(struct toy_compiler *tc, int gen); +toy_compiler_init(struct toy_compiler *tc, const struct ilo_dev_info *dev); void toy_compiler_cleanup(struct toy_compiler *tc); diff --git a/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c b/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c index bedbc3d53c8..0a90c3d0919 100644 --- a/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c +++ b/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c @@ -55,7 +55,7 @@ toy_compiler_disassemble(struct toy_compiler *tc, const void *kernel, int size) } brw_disasm(stderr, (struct brw_instruction *) &instructions[i], - ILO_GEN_GET_MAJOR(tc->gen)); + ILO_GEN_GET_MAJOR(tc->dev->gen)); } } diff --git a/src/gallium/drivers/ilo/shader/toy_helpers.h b/src/gallium/drivers/ilo/shader/toy_helpers.h index dca9fd7b4c3..038a81f5b2b 100644 --- a/src/gallium/drivers/ilo/shader/toy_helpers.h +++ b/src/gallium/drivers/ilo/shader/toy_helpers.h @@ -168,7 +168,7 @@ tsrc_imm_mdesc_sampler(const struct toy_compiler *tc, assert(sampler_index < 16); assert(binding_table_index < 256); - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { ctrl = simd_mode << 17 | message_type << 12 | sampler_index << 8 | @@ -198,7 +198,7 @@ tsrc_imm_mdesc_data_port(const struct toy_compiler *tc, { uint32_t ctrl; - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { assert(!send_write_commit_message); assert((message_specific_control & 0x3f00) == message_specific_control); @@ -235,7 +235,7 @@ tsrc_imm_mdesc_data_port_scratch(const struct toy_compiler *tc, const bool header_present = true; uint32_t ctrl; - assert(tc->gen >= ILO_GEN(7)); + assert(tc->dev->gen >= ILO_GEN(7)); assert(num_registers == 1 || num_registers == 2 || num_registers == 4); ctrl = 1 << 18 | @@ -264,7 +264,7 @@ tsrc_imm_mdesc_urb(const struct toy_compiler *tc, const bool header_present = true; uint32_t ctrl; - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { const bool per_slot_offset = false; ctrl = per_slot_offset << 16 | diff --git a/src/gallium/drivers/ilo/shader/toy_legalize.c b/src/gallium/drivers/ilo/shader/toy_legalize.c index 04f2a2570f4..19aab4c7952 100644 --- a/src/gallium/drivers/ilo/shader/toy_legalize.c +++ b/src/gallium/drivers/ilo/shader/toy_legalize.c @@ -335,7 +335,7 @@ patch_while_jip(struct toy_compiler *tc, struct toy_inst *inst) dist--; } - if (tc->gen >= ILO_GEN(7)) + if (tc->dev->gen >= ILO_GEN(7)) inst->src[1] = tsrc_imm_w(dist * 2); else inst->dst = tdst_imm_w(dist * 2); @@ -375,7 +375,7 @@ patch_if_else_jip(struct toy_compiler *tc, struct toy_inst *inst) /* the following instruction */ jip = (dist + 1) * 2; - if (tc->gen == ILO_GEN(6)) { + if (tc->dev->gen == ILO_GEN(6)) { uip = jip; break; } @@ -388,7 +388,7 @@ patch_if_else_jip(struct toy_compiler *tc, struct toy_inst *inst) dist++; } - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { /* what should the type be? */ inst->dst.type = TOY_TYPE_D; inst->src[0].type = TOY_TYPE_D; @@ -433,7 +433,7 @@ patch_endif_jip(struct toy_compiler *tc, struct toy_inst *inst) if (!found) dist = 1; - if (tc->gen >= ILO_GEN(7)) + if (tc->dev->gen >= ILO_GEN(7)) inst->src[1] = tsrc_imm_w(dist * 2); else inst->dst = tdst_imm_w(dist * 2); @@ -485,7 +485,7 @@ patch_break_continue_jip(struct toy_compiler *tc, struct toy_inst *inst) } else { /* the following instruction */ - if (tc->gen == ILO_GEN(6) && inst->opcode == BRW_OPCODE_BREAK) + if (tc->dev->gen == ILO_GEN(6) && inst->opcode == BRW_OPCODE_BREAK) dist++; uip = dist * 2; @@ -546,7 +546,7 @@ toy_compiler_legalize_for_asm(struct toy_compiler *tc) * * "INT DIV function does not support SIMD16." */ - if (tc->gen < ILO_GEN(7) || + if (tc->dev->gen < ILO_GEN(7) || inst->cond_modifier == BRW_MATH_FUNCTION_INT_DIV_QUOTIENT || inst->cond_modifier == BRW_MATH_FUNCTION_INT_DIV_REMAINDER) { struct toy_inst *inst2; @@ -566,7 +566,7 @@ toy_compiler_legalize_for_asm(struct toy_compiler *tc) } break; case BRW_OPCODE_IF: - if (tc->gen >= ILO_GEN(7) && + if (tc->dev->gen >= ILO_GEN(7) && inst->cond_modifier != BRW_CONDITIONAL_NONE) { struct toy_inst *inst2; @@ -590,7 +590,7 @@ toy_compiler_legalize_for_asm(struct toy_compiler *tc) } /* MRF to GRF */ - if (tc->gen >= ILO_GEN(7)) { + if (tc->dev->gen >= ILO_GEN(7)) { for (i = 0; i < Elements(inst->src); i++) { if (inst->src[i].file != TOY_FILE_MRF) continue; |