[PATCH 09/10] drm/xe: switch from drm_debug_printer() to device specific drm_dbg_printer()

Luca Coelho luca at coelho.fi
Tue Jan 30 10:32:29 UTC 2024


On Tue, 2024-01-16 at 15:07 +0200, Jani Nikula wrote:
> Prefer the device specific debug printer.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt.c          | 2 +-
>  drivers/gpu/drm/xe/xe_gt_topology.c | 4 +++-
>  drivers/gpu/drm/xe/xe_reg_sr.c      | 2 +-
>  3 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 0f2258dc4a00..16481f9b3125 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -327,7 +327,7 @@ static void dump_pat_on_error(struct xe_gt *gt)
>  	char prefix[32];
>  
>  	snprintf(prefix, sizeof(prefix), "[GT%u Error]", gt->info.id);
> -	p = drm_debug_printer(prefix);
> +	p = drm_dbg_printer(&gt_to_xe(gt)->drm, DRM_UT_DRIVER, prefix);
>  
>  	xe_pat_dump(gt, &p);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_gt_topology.c b/drivers/gpu/drm/xe/xe_gt_topology.c
> index a8d7f272c30a..5dc62fe1be49 100644
> --- a/drivers/gpu/drm/xe/xe_gt_topology.c
> +++ b/drivers/gpu/drm/xe/xe_gt_topology.c
> @@ -84,7 +84,7 @@ void
>  xe_gt_topology_init(struct xe_gt *gt)
>  {
>  	struct xe_device *xe = gt_to_xe(gt);
> -	struct drm_printer p = drm_debug_printer("GT topology");
> +	struct drm_printer p;
>  	int num_geometry_regs, num_compute_regs;
>  
>  	get_num_dss_regs(xe, &num_geometry_regs, &num_compute_regs);
> @@ -107,6 +107,8 @@ xe_gt_topology_init(struct xe_gt *gt)
>  		      XE2_GT_COMPUTE_DSS_2);
>  	load_eu_mask(gt, gt->fuse_topo.eu_mask_per_dss);
>  
> +	p = drm_dbg_printer(&gt_to_xe(gt)->drm, DRM_UT_DRIVER, "GT topology");
> +

I'm not sure there was a specific reason to move the initialization out
of the declaration, but it's probably a bit cleaner and more aligned
with other places...


>  	xe_gt_topology_dump(gt, &p);
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
> index 87adefb56024..440ac572f6e5 100644
> --- a/drivers/gpu/drm/xe/xe_reg_sr.c
> +++ b/drivers/gpu/drm/xe/xe_reg_sr.c
> @@ -231,7 +231,7 @@ void xe_reg_sr_apply_whitelist(struct xe_hw_engine *hwe)
>  	if (err)
>  		goto err_force_wake;
>  
> -	p = drm_debug_printer(KBUILD_MODNAME);
> +	p = drm_dbg_printer(&xe->drm, DRM_UT_DRIVER, NULL);
>  	xa_for_each(&sr->xa, reg, entry) {
>  		if (slot == RING_MAX_NONPRIV_SLOTS) {
>  			xe_gt_err(gt,


Reviewed-by: Luca Coelho <luciano.coelho at intel.com>

--
Cheers,
Luca.


More information about the Intel-xe mailing list