ac/pm4: determine spi_shader_pgm_lo_reg when PKT3_SET_SH_REG_PAIRS is used

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35582>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-06-17 14:51:50 +02:00 committed by Marge Bot
parent 5da4941101
commit ca0ed07588

View file

@ -204,6 +204,22 @@ ac_pm4_finalize(struct ac_pm4_state *state)
}
}
}
if (state->debug_sqtt && state->last_opcode == PKT3_SET_SH_REG_PAIRS) {
/* Set reg_va_low_idx to where the shader address is stored in the pm4 state. */
unsigned reg_count = (PKT_COUNT_G(state->pm4[state->last_pm4]) + 1) / 2;
for (unsigned i = 0; i < reg_count; i++) {
unsigned reg_base_offset = SI_SH_REG_OFFSET + state->pm4[state->last_pm4 + 1 + 2 * i] * 4;
if (strstr(ac_get_register_name(state->info->gfx_level,
state->info->family, reg_base_offset),
"SPI_SHADER_PGM_LO_")) {
state->spi_shader_pgm_lo_reg = reg_base_offset;
break;
}
}
}
}
void