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

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Tue Mar 29 10:23:40 2022 +0200

radeonsi: make sure profile_peak is used before using sqtt

Using sqtt without this profile can cause hangs.

Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

---

 src/gallium/drivers/radeonsi/si_pipe.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c 
b/src/gallium/drivers/radeonsi/si_pipe.c
index 5c5942faca6..0ddb3bfa14c 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -820,7 +820,12 @@ static struct pipe_context *si_pipe_create_context(struct 
pipe_screen *screen, v
    ctx = si_create_context(screen, flags);
 
    if (ctx && sscreen->info.chip_class >= GFX9 && sscreen->debug_flags & 
DBG(SQTT)) {
-      if (!si_init_thread_trace((struct si_context *)ctx)) {
+      if (ac_check_profile_state(&sscreen->info)) {
+         fprintf(stderr, "radeonsi: Canceling RGP trace request as a hang 
condition has been "
+                         "detected. Force the GPU into a profiling mode with 
e.g. "
+                         "\"echo profile_peak  > "
+                         
"/sys/class/drm/card0/device/power_dpm_force_performance_level\"\n");
+      } else if (!si_init_thread_trace((struct si_context *)ctx)) {
          FREE(ctx);
          return NULL;
       }

Reply via email to