summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_reg_whitelist.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2023-03-14 03:30:02 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-20 02:29:47 +0300
commit6647e2fe23f595dc46780b7cc26be872ca168643 (patch)
tree5cbbde0c9d5e9b8d69665af6db296c0534306b7f /drivers/gpu/drm/xe/xe_reg_whitelist.c
parentd855d2246ea6b04cbda372846b21c040fb068575 (diff)
downloadlinux-6647e2fe23f595dc46780b7cc26be872ca168643.tar.xz
drm/xe/debugfs: Dump register save-restore tables
Add debugfs entry to dump the final tables with register save-restore information. For the workarounds, this has a format a little bit different than when the values are applied because we don't want to read the values from the HW when dumping via debugfs. For whitelist it just re-uses the print function added for when the whitelist is being built. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://lore.kernel.org/r/20230314003012.2600353-5-lucas.demarchi@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_reg_whitelist.c')
-rw-r--r--drivers/gpu/drm/xe/xe_reg_whitelist.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_reg_whitelist.c b/drivers/gpu/drm/xe/xe_reg_whitelist.c
index 6c8577e8dba6..c4b3a2045299 100644
--- a/drivers/gpu/drm/xe/xe_reg_whitelist.c
+++ b/drivers/gpu/drm/xe/xe_reg_whitelist.c
@@ -108,3 +108,21 @@ void xe_reg_whitelist_print_entry(struct drm_printer *p, unsigned int indent,
deny ? "deny" : "allow",
access_str);
}
+
+/**
+ * xe_reg_whitelist_dump - print all whitelist entries
+ * @sr: Save/restore entries
+ * @p: DRM printer
+ */
+void xe_reg_whitelist_dump(struct xe_reg_sr *sr, struct drm_printer *p)
+{
+ struct xe_reg_sr_entry *entry;
+ unsigned long reg;
+
+ if (!sr->name || xa_empty(&sr->xa))
+ return;
+
+ drm_printf(p, "%s\n", sr->name);
+ xa_for_each(&sr->xa, reg, entry)
+ xe_reg_whitelist_print_entry(p, 1, reg, entry);
+}