[PATCH 3/5] drm/xe: Add xe_gt_dbg_printer
Matt Roper
matthew.d.roper at intel.com
Thu Dec 5 19:27:04 UTC 2024
On Thu, Dec 05, 2024 at 10:22:38AM -0800, Lucas De Marchi wrote:
> Like the info/err, add a printer for dbg messages.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_printk.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
> index 5dc71394372d6..1f27d9f75bae1 100644
> --- a/drivers/gpu/drm/xe/xe_gt_printk.h
> +++ b/drivers/gpu/drm/xe/xe_gt_printk.h
> @@ -60,6 +60,13 @@ static inline void __xe_gt_printfn_info(struct drm_printer *p, struct va_format
> xe_gt_info(gt, "%pV", vaf);
> }
>
> +static inline void __xe_gt_printfn_dbg(struct drm_printer *p, struct va_format *vaf)
> +{
> + struct xe_gt *gt = p->arg;
> +
> + xe_gt_dbg(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()
> @@ -90,4 +97,19 @@ static inline struct drm_printer xe_gt_info_printer(struct xe_gt *gt)
> return p;
> }
>
> +/**
> + * xe_gt_dbg_printer - Construct a &drm_printer that outputs to xe_gt_dbg()
> + * @gt: the &xe_gt pointer to use in xe_gt_dbg()
> + *
> + * Return: The &drm_printer object.
> + */
> +static inline struct drm_printer xe_gt_dbg_printer(struct xe_gt *gt)
> +{
> + struct drm_printer p = {
> + .printfn = __xe_gt_printfn_dbg,
> + .arg = gt,
> + };
> + return p;
> +}
> +
> #endif
> --
> 2.47.0
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
More information about the Intel-xe
mailing list