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

drm/xe/debugfs: Update xe_tuning_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-4-michal.wajdeczko@intel.com

+16 -11
+1 -7
drivers/gpu/drm/xe/xe_gt_debugfs.c
··· 167 167 return 0; 168 168 } 169 169 170 - static int tunings(struct xe_gt *gt, struct drm_printer *p) 171 - { 172 - xe_tuning_dump(gt, p); 173 - return 0; 174 - } 175 - 176 170 static int pat(struct xe_gt *gt, struct drm_printer *p) 177 171 { 178 172 xe_pat_dump(gt, p); ··· 225 231 { "register-save-restore", 226 232 .show = xe_gt_debugfs_show_with_rpm, .data = register_save_restore }, 227 233 { "workarounds", .show = xe_gt_debugfs_show_with_rpm, .data = xe_wa_gt_dump }, 228 - { "tunings", .show = xe_gt_debugfs_show_with_rpm, .data = tunings }, 234 + { "tunings", .show = xe_gt_debugfs_show_with_rpm, .data = xe_tuning_dump }, 229 235 { "default_lrc_rcs", .show = xe_gt_debugfs_show_with_rpm, .data = rcs_default_lrc }, 230 236 { "default_lrc_ccs", .show = xe_gt_debugfs_show_with_rpm, .data = ccs_default_lrc }, 231 237 { "default_lrc_bcs", .show = xe_gt_debugfs_show_with_rpm, .data = bcs_default_lrc },
+14 -3
drivers/gpu/drm/xe/xe_tuning.c
··· 214 214 xe_rtp_process_to_sr(&ctx, lrc_tunings, ARRAY_SIZE(lrc_tunings), &hwe->reg_lrc); 215 215 } 216 216 217 - void xe_tuning_dump(struct xe_gt *gt, struct drm_printer *p) 217 + /** 218 + * xe_tuning_dump() - Dump GT tuning info into a drm printer. 219 + * @gt: the &xe_gt 220 + * @p: the &drm_printer 221 + * 222 + * Return: always 0. 223 + */ 224 + int xe_tuning_dump(struct xe_gt *gt, struct drm_printer *p) 218 225 { 219 226 size_t idx; 220 227 ··· 229 222 for_each_set_bit(idx, gt->tuning_active.gt, ARRAY_SIZE(gt_tunings)) 230 223 drm_printf_indent(p, 1, "%s\n", gt_tunings[idx].name); 231 224 232 - drm_printf(p, "\nEngine Tunings\n"); 225 + drm_puts(p, "\n"); 226 + drm_printf(p, "Engine Tunings\n"); 233 227 for_each_set_bit(idx, gt->tuning_active.engine, ARRAY_SIZE(engine_tunings)) 234 228 drm_printf_indent(p, 1, "%s\n", engine_tunings[idx].name); 235 229 236 - drm_printf(p, "\nLRC Tunings\n"); 230 + drm_puts(p, "\n"); 231 + drm_printf(p, "LRC Tunings\n"); 237 232 for_each_set_bit(idx, gt->tuning_active.lrc, ARRAY_SIZE(lrc_tunings)) 238 233 drm_printf_indent(p, 1, "%s\n", lrc_tunings[idx].name); 234 + 235 + return 0; 239 236 }
+1 -1
drivers/gpu/drm/xe/xe_tuning.h
··· 14 14 void xe_tuning_process_gt(struct xe_gt *gt); 15 15 void xe_tuning_process_engine(struct xe_hw_engine *hwe); 16 16 void xe_tuning_process_lrc(struct xe_hw_engine *hwe); 17 - void xe_tuning_dump(struct xe_gt *gt, struct drm_printer *p); 17 + int xe_tuning_dump(struct xe_gt *gt, struct drm_printer *p); 18 18 19 19 #endif