mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 23:08:18 +02:00
radv: inhibit clock gating when tracing with SQTT
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8616>
(cherry picked from commit 5b5cd18853)
This commit is contained in:
parent
acfd179fe3
commit
291eebfaa4
2 changed files with 24 additions and 1 deletions
|
|
@ -130,7 +130,7 @@
|
|||
"description": "radv: inhibit clock gating when tracing with SQTT",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -357,6 +357,19 @@ radv_emit_spi_config_cntl(struct radv_device *device,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
radv_emit_inhibit_clockgating(struct radv_device *device,
|
||||
struct radeon_cmdbuf *cs, bool inhibit)
|
||||
{
|
||||
if (device->physical_device->rad_info.chip_class >= GFX10) {
|
||||
radeon_set_uconfig_reg(cs, R_037390_RLC_PERFMON_CLK_CNTL,
|
||||
S_037390_PERFMON_CLOCK_STATE(inhibit));
|
||||
} else if (device->physical_device->rad_info.chip_class >= GFX8) {
|
||||
radeon_set_uconfig_reg(cs, R_0372FC_RLC_PERFMON_CLK_CNTL,
|
||||
S_0372FC_PERFMON_CLOCK_STATE(inhibit));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
radv_emit_wait_for_idle(struct radv_device *device,
|
||||
struct radeon_cmdbuf *cs, int family)
|
||||
|
|
@ -407,6 +420,11 @@ radv_thread_trace_init_cs(struct radv_device *device)
|
|||
device->thread_trace.start_cs[family],
|
||||
family);
|
||||
|
||||
/* Disable clock gating before starting SQTT. */
|
||||
radv_emit_inhibit_clockgating(device,
|
||||
device->thread_trace.start_cs[family],
|
||||
true);
|
||||
|
||||
/* Enable SQG events that collects thread trace data. */
|
||||
radv_emit_spi_config_cntl(device,
|
||||
device->thread_trace.start_cs[family],
|
||||
|
|
@ -456,6 +474,11 @@ radv_thread_trace_init_cs(struct radv_device *device)
|
|||
device->thread_trace.stop_cs[family],
|
||||
false);
|
||||
|
||||
/* Restore previous state by re-enabling clock gating. */
|
||||
radv_emit_inhibit_clockgating(device,
|
||||
device->thread_trace.stop_cs[family],
|
||||
false);
|
||||
|
||||
result = ws->cs_finalize(device->thread_trace.stop_cs[family]);
|
||||
if (result != VK_SUCCESS)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue