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

drm/xe/debugfs: Update xe_mocs_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, move kernel-doc closer to the function definition,
as suggested in the doc-guide.

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-5-michal.wajdeczko@intel.com

+15 -16
+1 -7
drivers/gpu/drm/xe/xe_gt_debugfs.c
··· 173 173 return 0; 174 174 } 175 175 176 - static int mocs(struct xe_gt *gt, struct drm_printer *p) 177 - { 178 - xe_mocs_dump(gt, p); 179 - return 0; 180 - } 181 - 182 176 static int rcs_default_lrc(struct xe_gt *gt, struct drm_printer *p) 183 177 { 184 178 xe_lrc_dump_default(p, gt, XE_ENGINE_CLASS_RENDER); ··· 231 237 /* everything else should be added here */ 232 238 static const struct drm_info_list pf_only_debugfs_list[] = { 233 239 { "hw_engines", .show = xe_gt_debugfs_show_with_rpm, .data = hw_engines }, 234 - { "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = mocs }, 240 + { "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = xe_mocs_dump }, 235 241 { "pat", .show = xe_gt_debugfs_show_with_rpm, .data = pat }, 236 242 { "powergate_info", .show = xe_gt_debugfs_show_with_rpm, .data = xe_gt_idle_pg_print }, 237 243 { "steering", .show = xe_gt_debugfs_show_with_rpm, .data = steering },
+13 -2
drivers/gpu/drm/xe/xe_mocs.c
··· 772 772 init_l3cc_table(gt, &table); 773 773 } 774 774 775 - void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p) 775 + /** 776 + * xe_mocs_dump() - Dump MOCS table. 777 + * @gt: the &xe_gt with MOCS table 778 + * @p: the &drm_printer to dump info to 779 + * 780 + * Return: 0 on success or a negative error code on failure. 781 + */ 782 + int xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p) 776 783 { 777 784 struct xe_device *xe = gt_to_xe(gt); 778 785 enum xe_force_wake_domains domain; 779 786 struct xe_mocs_info table; 780 787 unsigned int fw_ref, flags; 788 + int err = 0; 781 789 782 790 flags = get_mocs_settings(xe, &table); 783 791 ··· 793 785 xe_pm_runtime_get_noresume(xe); 794 786 fw_ref = xe_force_wake_get(gt_to_fw(gt), domain); 795 787 796 - if (!xe_force_wake_ref_has_domain(fw_ref, domain)) 788 + if (!xe_force_wake_ref_has_domain(fw_ref, domain)) { 789 + err = -ETIMEDOUT; 797 790 goto err_fw; 791 + } 798 792 799 793 table.ops->dump(&table, flags, gt, p); 800 794 801 795 err_fw: 802 796 xe_force_wake_put(gt_to_fw(gt), fw_ref); 803 797 xe_pm_runtime_put(xe); 798 + return err; 804 799 } 805 800 806 801 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
+1 -7
drivers/gpu/drm/xe/xe_mocs.h
··· 11 11 12 12 void xe_mocs_init_early(struct xe_gt *gt); 13 13 void xe_mocs_init(struct xe_gt *gt); 14 - 15 - /** 16 - * xe_mocs_dump - Dump mocs table 17 - * @gt: GT structure 18 - * @p: Printer to dump info to 19 - */ 20 - void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p); 14 + int xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p); 21 15 22 16 #endif