Mesa (main): radv: set profile_peak when capturing with SQTT

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 21 11:47:33 UTC 2022


Module: Mesa
Branch: main
Commit: e6853de6b012ad7786aac0abe3333efc1f665216
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6853de6b012ad7786aac0abe3333efc1f665216

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Dec  3 09:23:51 2021 +0100

radv: set profile_peak when capturing with SQTT

Using new CTX OP to set/get stable pstates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>

---

 src/amd/vulkan/radv_sqtt.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/amd/vulkan/radv_sqtt.c b/src/amd/vulkan/radv_sqtt.c
index 4180fba5950..24fd99982d7 100644
--- a/src/amd/vulkan/radv_sqtt.c
+++ b/src/amd/vulkan/radv_sqtt.c
@@ -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);
 



More information about the mesa-commit mailing list