[PATCH 2/3] drm/xe/guc: Move state change logger to helper

Cavitt, Jonathan jonathan.cavitt at intel.com
Wed Jul 9 19:07:18 UTC 2025


-----Original Message-----
From: Intel-xe <intel-xe-bounces at lists.freedesktop.org> On Behalf Of Michal Wajdeczko
Sent: Wednesday, July 9, 2025 10:41 AM
To: intel-xe at lists.freedesktop.org
Cc: Wajdeczko, Michal <Michal.Wajdeczko at intel.com>; Brost, Matthew <matthew.brost at intel.com>
Subject: [PATCH 2/3] drm/xe/guc: Move state change logger to helper
> 
> In the state change helper we are already doing extra stuff,
> move debug state logger there to cover all state changes.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Matthew Brost <matthew.brost at intel.com>

LGTM.
Reviewed-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/xe/xe_guc_ct.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index 2a052dc22ff2..17e5870baf33 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -387,6 +387,8 @@ static int guc_ct_control_toggle(struct xe_guc_ct *ct, bool enable)
>  static void guc_ct_change_state(struct xe_guc_ct *ct,
>  				enum xe_guc_ct_state state)
>  {
> +	struct xe_gt *gt = ct_to_gt(ct);
> +
>  	mutex_lock(&ct->lock);		/* Serialise dequeue_one_g2h() */
>  	spin_lock_irq(&ct->fast_lock);	/* Serialise CT fast-path */
>  
> @@ -398,6 +400,10 @@ static void guc_ct_change_state(struct xe_guc_ct *ct,
>  	ct->g2h_outstanding = 0;
>  	ct->state = state;
>  
> +	xe_gt_dbg(gt, "GuC CT communication channel %s\n",
> +		  state == XE_GUC_CT_STATE_STOPPED ? "stopped" :
> +		  str_enabled_disabled(state == XE_GUC_CT_STATE_ENABLED));
> +
>  	spin_unlock_irq(&ct->fast_lock);
>  
>  	/*
> @@ -473,7 +479,6 @@ int xe_guc_ct_enable(struct xe_guc_ct *ct)
>  
>  	smp_mb();
>  	wake_up_all(&ct->wq);
> -	xe_gt_dbg(gt, "GuC CT communication channel enabled\n");
>  
>  	if (ct_needs_safe_mode(ct))
>  		ct_enter_safe_mode(ct);
> -- 
> 2.47.1
> 
> 


More information about the Intel-xe mailing list