@@ -60,6 +60,21 @@ static inline void __xe_gt_printfn_info(struct drm_printer *p, struct va_format
60
60
xe_gt_info (gt , "%pV" , vaf );
61
61
}
62
62
63
+ static inline void __xe_gt_printfn_dbg (struct drm_printer * p , struct va_format * vaf )
64
+ {
65
+ struct xe_gt * gt = p -> arg ;
66
+ struct drm_printer dbg ;
67
+
68
+ /*
69
+ * The original xe_gt_dbg() callsite annotations are useless here,
70
+ * redirect to the tweaked drm_dbg_printer() instead.
71
+ */
72
+ dbg = drm_dbg_printer (& gt_to_xe (gt )-> drm , DRM_UT_DRIVER , NULL );
73
+ dbg .origin = p -> origin ;
74
+
75
+ drm_printf (& dbg , "GT%u: %pV" , gt -> info .id , vaf );
76
+ }
77
+
63
78
/**
64
79
* xe_gt_err_printer - Construct a &drm_printer that outputs to xe_gt_err()
65
80
* @gt: the &xe_gt pointer to use in xe_gt_err()
@@ -90,4 +105,20 @@ static inline struct drm_printer xe_gt_info_printer(struct xe_gt *gt)
90
105
return p ;
91
106
}
92
107
108
+ /**
109
+ * xe_gt_dbg_printer - Construct a &drm_printer that outputs like xe_gt_dbg()
110
+ * @gt: the &xe_gt pointer to use in xe_gt_dbg()
111
+ *
112
+ * Return: The &drm_printer object.
113
+ */
114
+ static inline struct drm_printer xe_gt_dbg_printer (struct xe_gt * gt )
115
+ {
116
+ struct drm_printer p = {
117
+ .printfn = __xe_gt_printfn_dbg ,
118
+ .arg = gt ,
119
+ .origin = (const void * )_THIS_IP_ ,
120
+ };
121
+ return p ;
122
+ }
123
+
93
124
#endif
0 commit comments