drm/xe/debugfs: Dump active workarounds
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 26 May 2023 16:43:44 +0000 (09:43 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:34:02 +0000 (18:34 -0500)
Add a "workarounds" node in debugfs that can dump all the active
workarounds using the information recorded by rtp infra when those
workarounds were processed.

v2: move workarounds to be reported per-GT

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230526164358.86393-8-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt_debugfs.c
drivers/gpu/drm/xe/xe_wa.c
drivers/gpu/drm/xe/xe_wa.h

index 8bf441e850a0028b692ba2e1aa9d2dd8e0b8a990..339ecd5fad9b804675a72973c4c2b1e1963c847f 100644 (file)
@@ -19,6 +19,7 @@
 #include "xe_reg_sr.h"
 #include "xe_reg_whitelist.h"
 #include "xe_uc_debugfs.h"
+#include "xe_wa.h"
 
 static struct xe_gt *node_to_gt(struct drm_info_node *node)
 {
@@ -127,6 +128,16 @@ static int register_save_restore(struct seq_file *m, void *data)
        return 0;
 }
 
+static int workarounds(struct seq_file *m, void *data)
+{
+       struct xe_gt *gt = node_to_gt(m->private);
+       struct drm_printer p = drm_seq_file_printer(m);
+
+       xe_wa_dump(gt, &p);
+
+       return 0;
+}
+
 static const struct drm_info_list debugfs_list[] = {
        {"hw_engines", hw_engines, 0},
        {"force_reset", force_reset, 0},
@@ -135,6 +146,7 @@ static const struct drm_info_list debugfs_list[] = {
        {"steering", steering, 0},
        {"ggtt", ggtt, 0},
        {"register-save-restore", register_save_restore, 0},
+       {"workarounds", workarounds, 0},
 };
 
 void xe_gt_debugfs_register(struct xe_gt *gt)
index 665714abc5f00a572a8cc4ef33b88b994086a96c..910579453316a27663117dd4fec2ea3edddbc0b7 100644 (file)
@@ -651,3 +651,20 @@ int xe_wa_init(struct xe_gt *gt)
 
        return 0;
 }
+
+void xe_wa_dump(struct xe_gt *gt, struct drm_printer *p)
+{
+       size_t idx;
+
+       drm_printf(p, "GT Workarounds\n");
+       for_each_set_bit(idx, gt->wa_active.gt, ARRAY_SIZE(gt_was))
+               drm_printf_indent(p, 1, "%s\n", gt_was[idx].name);
+
+       drm_printf(p, "\nEngine Workarounds\n");
+       for_each_set_bit(idx, gt->wa_active.engine, ARRAY_SIZE(engine_was))
+               drm_printf_indent(p, 1, "%s\n", engine_was[idx].name);
+
+       drm_printf(p, "\nLRC Workarounds\n");
+       for_each_set_bit(idx, gt->wa_active.lrc, ARRAY_SIZE(lrc_was))
+               drm_printf_indent(p, 1, "%s\n", lrc_was[idx].name);
+}
index eae05bcecc68e67b0875452e9f73c11c1bb4b4c1..defefa5d9611a2537debea434490f8915f451c2a 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef _XE_WA_
 #define _XE_WA_
 
+struct drm_printer;
 struct xe_gt;
 struct xe_hw_engine;
 
@@ -15,5 +16,6 @@ void xe_wa_process_engine(struct xe_hw_engine *hwe);
 void xe_wa_process_lrc(struct xe_hw_engine *hwe);
 
 void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe);
+void xe_wa_dump(struct xe_gt *gt, struct drm_printer *p);
 
 #endif