mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
ac/debug: add a helper to print GPUVM fault protection status
This basically prints the same info as dmesg. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25855>
This commit is contained in:
parent
bc09932ec3
commit
e18c4bca31
2 changed files with 51 additions and 0 deletions
|
|
@ -1180,3 +1180,51 @@ unsigned ac_get_wave_info(enum amd_gfx_level gfx_level,
|
|||
return num_waves;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* List of GFXHUB clients from AMDGPU source code. */
|
||||
static const char *const gfx10_gfxhub_client_ids[] = {
|
||||
"CB/DB",
|
||||
"Reserved",
|
||||
"GE1",
|
||||
"GE2",
|
||||
"CPF",
|
||||
"CPC",
|
||||
"CPG",
|
||||
"RLC",
|
||||
"TCP",
|
||||
"SQC (inst)",
|
||||
"SQC (data)",
|
||||
"SQG",
|
||||
"Reserved",
|
||||
"SDMA0",
|
||||
"SDMA1",
|
||||
"GCR",
|
||||
"SDMA2",
|
||||
"SDMA3",
|
||||
};
|
||||
|
||||
static const char *
|
||||
ac_get_gfx10_gfxhub_client(unsigned cid)
|
||||
{
|
||||
if (cid >= ARRAY_SIZE(gfx10_gfxhub_client_ids))
|
||||
return "UNKNOWN";
|
||||
return gfx10_gfxhub_client_ids[cid];
|
||||
}
|
||||
|
||||
void ac_print_gpuvm_fault_status(FILE *output, enum amd_gfx_level gfx_level,
|
||||
uint32_t status)
|
||||
{
|
||||
if (gfx_level >= GFX10) {
|
||||
const uint8_t cid = G_00A130_CID(status);
|
||||
|
||||
fprintf(output, "GCVM_L2_PROTECTION_FAULT_STATUS: 0x%x\n", status);
|
||||
fprintf(output, "\t CLIENT_ID: (%s) 0x%x\n", ac_get_gfx10_gfxhub_client(cid), cid);
|
||||
fprintf(output, "\t MORE_FAULTS: %d\n", G_00A130_MORE_FAULTS(status));
|
||||
fprintf(output, "\t WALKER_ERROR: %d\n", G_00A130_WALKER_ERROR(status));
|
||||
fprintf(output, "\t PERMISSION_FAULTS: %d\n", G_00A130_PERMISSION_FAULTS(status));
|
||||
fprintf(output, "\t MAPPING_ERROR: %d\n", G_00A130_MAPPING_ERROR(status));
|
||||
fprintf(output, "\t RW: %d\n", G_00A130_RW(status));
|
||||
} else {
|
||||
fprintf(output, "VM_CONTEXT1_PROTECTION_FAULT_STATUS: 0x%x\n", status);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ bool ac_vm_fault_occurred(enum amd_gfx_level gfx_level, uint64_t *old_dmesg_time
|
|||
unsigned ac_get_wave_info(enum amd_gfx_level gfx_level,
|
||||
struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP]);
|
||||
|
||||
void ac_print_gpuvm_fault_status(FILE *output, enum amd_gfx_level gfx_level,
|
||||
uint32_t status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue