]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/debugfs: Update xe_mocs_dump signature
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 23 Sep 2025 21:16:12 +0000 (23:16 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 30 Sep 2025 08:21:27 +0000 (10:21 +0200)
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
drivers/gpu/drm/xe/xe_gt_debugfs.c
drivers/gpu/drm/xe/xe_mocs.c
drivers/gpu/drm/xe/xe_mocs.h

index bcf234e74471fc17adc0e0be3d718e4f1aa71531..b0e6dafeeaccbd9bdec27e41a0a6588792fd5ed1 100644 (file)
@@ -173,12 +173,6 @@ static int pat(struct xe_gt *gt, struct drm_printer *p)
        return 0;
 }
 
-static int mocs(struct xe_gt *gt, struct drm_printer *p)
-{
-       xe_mocs_dump(gt, p);
-       return 0;
-}
-
 static int rcs_default_lrc(struct xe_gt *gt, struct drm_printer *p)
 {
        xe_lrc_dump_default(p, gt, XE_ENGINE_CLASS_RENDER);
@@ -237,7 +231,7 @@ static const struct drm_info_list vf_safe_debugfs_list[] = {
 /* everything else should be added here */
 static const struct drm_info_list pf_only_debugfs_list[] = {
        { "hw_engines", .show = xe_gt_debugfs_show_with_rpm, .data = hw_engines },
-       { "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = mocs },
+       { "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = xe_mocs_dump },
        { "pat", .show = xe_gt_debugfs_show_with_rpm, .data = pat },
        { "powergate_info", .show = xe_gt_debugfs_show_with_rpm, .data = xe_gt_idle_pg_print },
        { "steering", .show = xe_gt_debugfs_show_with_rpm, .data = steering },
index 0c737413fcb68d0e59a575db62a38c4fdb7b13f0..7b68c22ff7bbcaeed15e1fc7ee9deae164b73abb 100644 (file)
@@ -772,12 +772,20 @@ void xe_mocs_init(struct xe_gt *gt)
                init_l3cc_table(gt, &table);
 }
 
-void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
+/**
+ * xe_mocs_dump() - Dump MOCS table.
+ * @gt: the &xe_gt with MOCS table
+ * @p: the &drm_printer to dump info to
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
 {
        struct xe_device *xe = gt_to_xe(gt);
        enum xe_force_wake_domains domain;
        struct xe_mocs_info table;
        unsigned int fw_ref, flags;
+       int err = 0;
 
        flags = get_mocs_settings(xe, &table);
 
@@ -785,14 +793,17 @@ void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
        xe_pm_runtime_get_noresume(xe);
        fw_ref = xe_force_wake_get(gt_to_fw(gt), domain);
 
-       if (!xe_force_wake_ref_has_domain(fw_ref, domain))
+       if (!xe_force_wake_ref_has_domain(fw_ref, domain)) {
+               err = -ETIMEDOUT;
                goto err_fw;
+       }
 
        table.ops->dump(&table, flags, gt, p);
 
 err_fw:
        xe_force_wake_put(gt_to_fw(gt), fw_ref);
        xe_pm_runtime_put(xe);
+       return err;
 }
 
 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
index dc972ffd4d0755425687329b2399175f55d39473..f00bbb2698294c152e7f7306dc14aee7954707e7 100644 (file)
@@ -11,12 +11,6 @@ struct xe_gt;
 
 void xe_mocs_init_early(struct xe_gt *gt);
 void xe_mocs_init(struct xe_gt *gt);
-
-/**
- * xe_mocs_dump - Dump mocs table
- * @gt: GT structure
- * @p: Printer to dump info to
- */
-void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p);
+int xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p);
 
 #endif