]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/uc: Track uc firmware state changes
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 27 Mar 2026 20:24:06 +0000 (21:24 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 31 Mar 2026 19:09:53 +0000 (21:09 +0200)
Under CONFIG_DRM_XE_DEBUG_GUC print debug messages with each uc
firmware state transition to better visualize the changes.

  [drm:xe_uc_fw_change_status [xe]] Tile0: GT0: GuC UNINITIALIZED->SELECTED
  [drm:xe_uc_fw_change_status [xe]] Tile0: GT0: GuC SELECTED->AVAILABLE
  [drm:xe_uc_fw_change_status [xe]] Tile0: GT0: GuC AVAILABLE->LOADABLE
  [drm:xe_uc_fw_change_status [xe]] Tile0: GT0: GuC LOADABLE->TRANSFERRED
  [drm:xe_uc_fw_change_status [xe]] Tile0: GT0: GuC TRANSFERRED->RUNNING

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260327202407.563-1-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_uc_fw.c
drivers/gpu/drm/xe/xe_uc_fw.h

index 9cebb24902457a69dcee7c42b4a2988881888db8..df2aa196f6f9b41ef3c778768710db37e0e4682a 100644 (file)
@@ -214,6 +214,17 @@ static struct xe_device *uc_fw_to_xe(struct xe_uc_fw *uc_fw)
        return gt_to_xe(uc_fw_to_gt(uc_fw));
 }
 
+#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
+void xe_uc_fw_change_status(struct xe_uc_fw *uc_fw, enum xe_uc_fw_status status)
+{
+       xe_gt_dbg(uc_fw_to_gt(uc_fw), "%s %s->%s\n",
+                 xe_uc_fw_type_repr(uc_fw->type),
+                 xe_uc_fw_status_repr(uc_fw->status),
+                 xe_uc_fw_status_repr(status));
+       uc_fw->__status = status;
+}
+#endif
+
 static void
 uc_fw_auto_select(struct xe_device *xe, struct xe_uc_fw *uc_fw)
 {
index 6195e353f269eaf6f0f6e3aea55ec88490b7956f..bb281b72a6772b954c81414886ca8ec39176bd4f 100644 (file)
@@ -25,11 +25,15 @@ static inline u32 xe_uc_fw_rsa_offset(struct xe_uc_fw *uc_fw)
        return sizeof(struct uc_css_header) + uc_fw->ucode_size + uc_fw->css_offset;
 }
 
+#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
+void xe_uc_fw_change_status(struct xe_uc_fw *uc_fw, enum xe_uc_fw_status status);
+#else
 static inline void xe_uc_fw_change_status(struct xe_uc_fw *uc_fw,
                                          enum xe_uc_fw_status status)
 {
        uc_fw->__status = status;
 }
+#endif
 
 static inline
 const char *xe_uc_fw_status_repr(enum xe_uc_fw_status status)