mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
drm/xe: Add GT oriented drm_printers
Instead of using generic drm_err_printer() that just adds static prefix, or drm_info_printer() that outputs only device name, add new helpers that create dedicated drm_printers that use our GT oriented xe_gt_err() and xe_gt_info() functions. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20231218190629.502-2-michal.wajdeczko@intel.com Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
This commit is contained in:
parent
b130289b23
commit
b2e1f97fb4
|
|
@ -43,4 +43,48 @@
|
|||
#define xe_gt_WARN_ON_ONCE(_gt, _condition) \
|
||||
xe_gt_WARN_ONCE((_gt), _condition, "%s(%s)", "gt_WARN_ON_ONCE", __stringify(_condition))
|
||||
|
||||
static inline void __xe_gt_printfn_err(struct drm_printer *p, struct va_format *vaf)
|
||||
{
|
||||
struct xe_gt *gt = p->arg;
|
||||
|
||||
xe_gt_err(gt, "%pV", vaf);
|
||||
}
|
||||
|
||||
static inline void __xe_gt_printfn_info(struct drm_printer *p, struct va_format *vaf)
|
||||
{
|
||||
struct xe_gt *gt = p->arg;
|
||||
|
||||
xe_gt_info(gt, "%pV", vaf);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_err_printer - Construct a &drm_printer that outputs to xe_gt_err()
|
||||
* @gt: the &xe_gt pointer to use in xe_gt_err()
|
||||
*
|
||||
* Return: The &drm_printer object.
|
||||
*/
|
||||
static inline struct drm_printer xe_gt_err_printer(struct xe_gt *gt)
|
||||
{
|
||||
struct drm_printer p = {
|
||||
.printfn = __xe_gt_printfn_err,
|
||||
.arg = gt,
|
||||
};
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_info_printer - Construct a &drm_printer that outputs to xe_gt_info()
|
||||
* @gt: the &xe_gt pointer to use in xe_gt_info()
|
||||
*
|
||||
* Return: The &drm_printer object.
|
||||
*/
|
||||
static inline struct drm_printer xe_gt_info_printer(struct xe_gt *gt)
|
||||
{
|
||||
struct drm_printer p = {
|
||||
.printfn = __xe_gt_printfn_info,
|
||||
.arg = gt,
|
||||
};
|
||||
return p;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user