Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH] drm/xe: Fix duplicated setting for register 0x6604
Date: Mon, 6 Mar 2023 17:05:00 -0500	[thread overview]
Message-ID: <ZAZjjGdfNpNmZoDf@intel.com> (raw)
In-Reply-To: <20230306212450.803557-1-lucas.demarchi@intel.com>

On Mon, Mar 06, 2023 at 01:24:50PM -0800, Lucas De Marchi wrote:
> The following warning shows up for TGL:
> 
> 		[drm:xe_reg_sr_add [xe]] *ERROR* Discarding save-restore reg 6604 (clear: 00ff0000, set: 00040000, masked: no): ret=-22
> 		[drm:xe_reg_sr_add [xe]] *ERROR* Discarding save-restore reg 6604 (clear: 00ff0000, set: 00040000, masked: no): ret=-22
> 
> That is because the same register is being set both by the WAs and the
> tunings. Like was done in i915, prefer the tuning over the workaround
> since that is applicable for more platforms. Also fix the tuning: it
> was incorrectly using the MCR version of the register, but that only
> became true in XEHP.
> 
> References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/233
> Reported-by: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/regs/xe_gt_regs.h |  1 -
>  drivers/gpu/drm/xe/xe_tuning.c       | 11 ++++++-----
>  drivers/gpu/drm/xe/xe_wa.c           | 10 +++-------
>  3 files changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index 4d0f09cd447c..c025c6dbf3a9 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -70,7 +70,6 @@
>  #define XEHP_FLAT_CCS_BASE_ADDR			MCR_REG(0x4910)
>  
>  #define GEN12_FF_MODE2				_MMIO(0x6604)
> -#define XEHP_FF_MODE2				MCR_REG(0x6604)
>  #define   FF_MODE2_GS_TIMER_MASK		REG_GENMASK(31, 24)
>  #define   FF_MODE2_GS_TIMER_224			REG_FIELD_PREP(FF_MODE2_GS_TIMER_MASK, 224)
>  #define   FF_MODE2_TDS_TIMER_MASK		REG_GENMASK(23, 16)
> diff --git a/drivers/gpu/drm/xe/xe_tuning.c b/drivers/gpu/drm/xe/xe_tuning.c
> index 624b257ecfbc..2861a014c85c 100644
> --- a/drivers/gpu/drm/xe/xe_tuning.c
> +++ b/drivers/gpu/drm/xe/xe_tuning.c
> @@ -24,11 +24,12 @@ static const struct xe_rtp_entry gt_tunings[] = {
>  };
>  
>  static const struct xe_rtp_entry lrc_tunings[] = {
> -	{ XE_RTP_NAME("1604555607"),
> -	  XE_RTP_RULES(GRAPHICS_VERSION(1200)),
> -	  XE_RTP_ACTIONS(FIELD_SET_NO_READ_MASK(XEHP_FF_MODE2,
> -						FF_MODE2_TDS_TIMER_MASK,
> -						FF_MODE2_TDS_TIMER_128))
> +	{ XE_RTP_NAME("Tuning: ganged timer, also known as 16011163337"),
> +	  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, 1210)),
> +	  /* read verification is ignored due to 1608008084. */
> +	  XE_RTP_ACTIONS(FIELD_SET_NO_READ_MASK(GEN12_FF_MODE2,
> +						FF_MODE2_GS_TIMER_MASK,
> +						FF_MODE2_GS_TIMER_224))
>  	},
>  	{}
>  };
> diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c
> index df72b15dfeb0..71e9e1a111f8 100644
> --- a/drivers/gpu/drm/xe/xe_wa.c
> +++ b/drivers/gpu/drm/xe/xe_wa.c
> @@ -265,13 +265,9 @@ static const struct xe_rtp_entry lrc_was[] = {
>  				   GEN9_PREEMPT_GPGPU_THREAD_GROUP_LEVEL,
>  				   XE_RTP_ACTION_FLAG(MASKED_REG)))
>  	},
> -	{ XE_RTP_NAME("16011163337"),
> -	  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, 1210)),
> -	  /* read verification is ignored due to 1608008084. */
> -	  XE_RTP_ACTIONS(FIELD_SET_NO_READ_MASK(GEN12_FF_MODE2,
> -						FF_MODE2_GS_TIMER_MASK,
> -						FF_MODE2_GS_TIMER_224))
> -	},
> +
> +	/* DG1 */
> +
>  	{ XE_RTP_NAME("1409044764"),
>  	  XE_RTP_RULES(PLATFORM(DG1)),
>  	  XE_RTP_ACTIONS(CLR(GEN11_COMMON_SLICE_CHICKEN3,
> -- 
> 2.39.0
> 

      parent reply	other threads:[~2023-03-06 22:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 21:24 [Intel-xe] [PATCH] drm/xe: Fix duplicated setting for register 0x6604 Lucas De Marchi
2023-03-06 21:30 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-03-06 21:31 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-03-06 21:35 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-03-06 22:05 ` Rodrigo Vivi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAZjjGdfNpNmZoDf@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox