static void si_pm4_cmd_begin(struct si_pm4_state *state, unsigned opcode)
{
assert(state->ndw < SI_PM4_MAX_DW);
+ assert(opcode <= 254);
state->last_opcode = opcode;
state->last_pm4 = state->ndw++;
}
{
assert(state->ndw < SI_PM4_MAX_DW);
state->pm4[state->ndw++] = dw;
- state->last_opcode = -1;
+ state->last_opcode = 255; /* invalid opcode */
}
static void si_pm4_cmd_end(struct si_pm4_state *state, bool predicate)
state->pm4[state->ndw++] = reg;
}
+ assert(reg <= UINT16_MAX);
state->last_reg = reg;
state->pm4[state->ndw++] = val;
si_pm4_cmd_end(state, false);
struct si_pm4_state {
/* PKT3_SET_*_REG handling */
- unsigned last_opcode;
- unsigned last_reg;
- unsigned last_pm4;
-
- /* commands for the DE */
- unsigned ndw;
- uint32_t pm4[SI_PM4_MAX_DW];
+ uint16_t last_reg; /* register offset in dwords */
+ uint16_t last_pm4;
+ uint16_t ndw; /* number of dwords in pm4 */
+ uint8_t last_opcode;
/* For shader states only */
bool is_shader;
struct si_atom atom;
+
+ /* commands for the DE */
+ uint32_t pm4[SI_PM4_MAX_DW];
};
void si_pm4_cmd_add(struct si_pm4_state *state, uint32_t dw);