radv: set profile_peak when capturing with SQTT

Using new CTX OP to set/get stable pstates.

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/14038>
This commit is contained in:
Samuel Pitoiset 2021-12-03 09:23:51 +01:00 committed by Marge Bot
parent 5cf4f0cc91
commit e6853de6b0
1 changed files with 23 additions and 0 deletions

View File

@ -429,6 +429,26 @@ radv_thread_trace_finish_bo(struct radv_device *device)
}
}
static int
radv_thread_trace_init_pstate(struct radv_device *device)
{
struct radeon_winsys *ws = device->ws;
if (device->physical_device->rad_info.has_stable_pstate) {
for (unsigned i = 0; i < RADV_MAX_QUEUE_FAMILIES; i++) {
for (unsigned q = 0; q < device->queue_count[i]; q++) {
struct radv_queue *queue = &device->queues[i][q];
/* Set the current pstate to peak which is required for profiling. */
if (ws->ctx_set_pstate(queue->hw_ctx, RADEON_CTX_PSTATE_PEAK) < 0)
return false;
}
}
}
return true;
}
bool
radv_thread_trace_init(struct radv_device *device)
{
@ -446,6 +466,9 @@ radv_thread_trace_init(struct radv_device *device)
if (!radv_thread_trace_init_bo(device))
return false;
if (!radv_thread_trace_init_pstate(device))
return false;
list_inithead(&thread_trace_data->rgp_pso_correlation.record);
simple_mtx_init(&thread_trace_data->rgp_pso_correlation.lock, mtx_plain);