[Intel-xe] [PATCH v2 02/12] drm/xe/reg_sr: Tweak verbosity for register printing

Matt Roper matthew.d.roper at intel.com
Fri Mar 10 23:44:09 UTC 2023


On Fri, Mar 10, 2023 at 02:15:39PM -0800, Lucas De Marchi wrote:
> If there is no register to save-restore or whitelist, just return. This
> drops some noise from the log, particurlarly for platforms with several
> engines like PVC:
> 
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs0 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs0 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs1 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs1 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs2 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs2 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs5 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs5 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs6 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs6 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs7 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs7 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying bcs8 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs8 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying ccs0 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0x20e4] = 0x00008000
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0xb01c] = 0x00000001
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0xe48c] = 0x00000800
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0xe7c8] = 0x40000000
> 	...
> 
> On a PVC system it should show something like below. Whitelist calls
> are still there since they aren't actually empty - driver just doesn't
> print each individual entry. This will be fixed in future.
> 
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs0 registers
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs1 registers
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs2 registers
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs5 registers
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs6 registers
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs7 registers
> 	[drm:xe_reg_sr_apply_whitelist [xe]] Whitelisting bcs8 registers
> 	[drm:xe_reg_sr_apply_mmio [xe]] Applying ccs0 save-restore MMIOs
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0x20e4] = 0x00008000
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0xb01c] = 0x00000001
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0xe48c] = 0x00000800
> 	[drm:xe_reg_sr_apply_mmio [xe]] REG[0xe7c8] = 0x40000000
> 
> v2: Only tweak log verbosity, leave the whitelist printout for later
>     since decoding the whitelist is more complex.
> 
> 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_reg_sr.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
> index 194a5060f1b3..c6f92fe9aad1 100644
> --- a/drivers/gpu/drm/xe/xe_reg_sr.c
> +++ b/drivers/gpu/drm/xe/xe_reg_sr.c
> @@ -168,6 +168,9 @@ void xe_reg_sr_apply_mmio(struct xe_reg_sr *sr, struct xe_gt *gt)
>  	unsigned long reg;
>  	int err;
>  
> +	if (xa_empty(&sr->xa))
> +		return;
> +
>  	drm_dbg(&xe->drm, "Applying %s save-restore MMIOs\n", sr->name);
>  
>  	err = xe_force_wake_get(&gt->mmio.fw, XE_FORCEWAKE_ALL);
> @@ -195,6 +198,9 @@ void xe_reg_sr_apply_whitelist(struct xe_reg_sr *sr, u32 mmio_base,
>  	unsigned int slot = 0;
>  	int err;
>  
> +	if (xa_empty(&sr->xa))
> +		return;
> +
>  	drm_dbg(&xe->drm, "Whitelisting %s registers\n", sr->name);
>  
>  	err = xe_force_wake_get(&gt->mmio.fw, XE_FORCEWAKE_ALL);
> -- 
> 2.39.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list