Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/debugfs: Update xe_wa_dump signature

Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print()
functions to return int. New signature allows us to drop wrapper.

While around, print additional separation lines using puts() to
avoid output with leading \n which might confuse some printers.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250923211613.193347-3-michal.wajdeczko@intel.com

+17 -12
+1 -7
drivers/gpu/drm/xe/xe_gt_debugfs.c
··· 167 167 return 0; 168 168 } 169 169 170 - static int workarounds(struct xe_gt *gt, struct drm_printer *p) 171 - { 172 - xe_wa_dump(gt, p); 173 - return 0; 174 - } 175 - 176 170 static int tunings(struct xe_gt *gt, struct drm_printer *p) 177 171 { 178 172 xe_tuning_dump(gt, p); ··· 230 236 { "topology", .show = xe_gt_debugfs_show_with_rpm, .data = xe_gt_topology_dump }, 231 237 { "register-save-restore", 232 238 .show = xe_gt_debugfs_show_with_rpm, .data = register_save_restore }, 233 - { "workarounds", .show = xe_gt_debugfs_show_with_rpm, .data = workarounds }, 239 + { "workarounds", .show = xe_gt_debugfs_show_with_rpm, .data = xe_wa_gt_dump }, 234 240 { "tunings", .show = xe_gt_debugfs_show_with_rpm, .data = tunings }, 235 241 { "default_lrc_rcs", .show = xe_gt_debugfs_show_with_rpm, .data = rcs_default_lrc }, 236 242 { "default_lrc_ccs", .show = xe_gt_debugfs_show_with_rpm, .data = ccs_default_lrc },
+15 -4
drivers/gpu/drm/xe/xe_wa.c
··· 1086 1086 drm_printf_indent(p, 1, "%s\n", device_oob_was[idx].name); 1087 1087 } 1088 1088 1089 - void xe_wa_dump(struct xe_gt *gt, struct drm_printer *p) 1089 + /** 1090 + * xe_wa_gt_dump() - Dump GT workarounds into a drm printer. 1091 + * @gt: the &xe_gt 1092 + * @p: the &drm_printer 1093 + * 1094 + * Return: always 0. 1095 + */ 1096 + int xe_wa_gt_dump(struct xe_gt *gt, struct drm_printer *p) 1090 1097 { 1091 1098 size_t idx; 1092 1099 ··· 1101 1094 for_each_set_bit(idx, gt->wa_active.gt, ARRAY_SIZE(gt_was)) 1102 1095 drm_printf_indent(p, 1, "%s\n", gt_was[idx].name); 1103 1096 1104 - drm_printf(p, "\nEngine Workarounds\n"); 1097 + drm_puts(p, "\n"); 1098 + drm_printf(p, "Engine Workarounds\n"); 1105 1099 for_each_set_bit(idx, gt->wa_active.engine, ARRAY_SIZE(engine_was)) 1106 1100 drm_printf_indent(p, 1, "%s\n", engine_was[idx].name); 1107 1101 1108 - drm_printf(p, "\nLRC Workarounds\n"); 1102 + drm_puts(p, "\n"); 1103 + drm_printf(p, "LRC Workarounds\n"); 1109 1104 for_each_set_bit(idx, gt->wa_active.lrc, ARRAY_SIZE(lrc_was)) 1110 1105 drm_printf_indent(p, 1, "%s\n", lrc_was[idx].name); 1111 1106 1112 - drm_printf(p, "\nOOB Workarounds\n"); 1107 + drm_puts(p, "\n"); 1108 + drm_printf(p, "OOB Workarounds\n"); 1113 1109 for_each_set_bit(idx, gt->wa_active.oob, ARRAY_SIZE(oob_was)) 1114 1110 if (oob_was[idx].name) 1115 1111 drm_printf_indent(p, 1, "%s\n", oob_was[idx].name); 1112 + return 0; 1116 1113 } 1117 1114 1118 1115 /*
+1 -1
drivers/gpu/drm/xe/xe_wa.h
··· 22 22 void xe_wa_process_lrc(struct xe_hw_engine *hwe); 23 23 void xe_wa_apply_tile_workarounds(struct xe_tile *tile); 24 24 void xe_wa_device_dump(struct xe_device *xe, struct drm_printer *p); 25 - void xe_wa_dump(struct xe_gt *gt, struct drm_printer *p); 25 + int xe_wa_gt_dump(struct xe_gt *gt, struct drm_printer *p); 26 26 27 27 /** 28 28 * XE_GT_WA - Out-of-band GT workarounds, to be queried and called as needed.