Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	jani.nikula@linux.intel.com, uma.shankar@intel.com
Subject: Re: [PATCH 1/4] Add bits for link_n_exended for DISPLAY >= 14
Date: Fri, 21 Mar 2025 20:42:45 +0200	[thread overview]
Message-ID: <Z92zJQsjTVs4FDef@intel.com> (raw)
In-Reply-To: <Z92werPIFgvyjcr_@intel.com>

On Fri, Mar 21, 2025 at 08:31:22PM +0200, Ville Syrjälä wrote:
> On Fri, Mar 21, 2025 at 04:56:47PM +0530, Ankit Nautiyal wrote:
> > LINK_N register has bits 31:24 for extended link N value used for
> > HDMI2.1 and for an alternate mode of operation of DP TG DDA
> > (Bspec:50488).
> > 
> > Add support for these extra bits.
> > 
> > For displays with version 14 or higher, the `PIPE_LINK_N1_EXTENDED_MASK`
> > (bits 31:24) is used to handle the extended link N bits.
> > For older platforms, the `DATA_LINK_M_N_MASK` (bits 23:0) is used to
> > handle the standard link N bits. This distinction ensures clarity and
> > maintains the semantics for platforms that support the extended bits.
> > In subsequent changes the logic is updated to conditionally apply the
> > extended link N bits.
> > 
> > v2: Drop extra link_n_ext member. (Jani)
> > v3: Avoid link_n_ext in set_m_n helper. (Jani)
> > v4: Rebase, and update commit message.
> > 
> > Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 18 ++++++++++++++++--
> >  drivers/gpu/drm/i915/i915_reg.h              |  2 ++
> >  2 files changed, 18 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 3afb85fe8536..8fb0df388571 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -2583,14 +2583,22 @@ void intel_set_m_n(struct intel_display *display,
> >  		   i915_reg_t data_m_reg, i915_reg_t data_n_reg,
> >  		   i915_reg_t link_m_reg, i915_reg_t link_n_reg)
> >  {
> > +	u32 link_n = m_n->link_n;
> > +
> >  	intel_de_write(display, data_m_reg, TU_SIZE(m_n->tu) | m_n->data_m);
> >  	intel_de_write(display, data_n_reg, m_n->data_n);
> >  	intel_de_write(display, link_m_reg, m_n->link_m);
> > +
> > +	if (DISPLAY_VER(display) >= 14)
> > +		link_n &= ~PIPE_LINK_N1_EXTENDED_MASK;
> > +	else
> > +		link_n &= DATA_LINK_M_N_MASK;
> 
> There should never be anything in those bits or we've screwed up
> somewhere.
> 
> The actual w/a for the M/N > 10.0 looks like a pile of annoying
> hacks in the hardware. I wonder if we could just live without it
> to avoid complicating the code?
> 
> As for the 10.0 limit, I suspect there's nothing platform specific
> about it and it's always been there. It's just not possible to hit
> it with 8b/10b encoding.

Hmm. Maybe it would be possible to hit it with DSC+bigjoiner on ICL+.

Without some kind of joiner it's definitely not possible due to
cdclk limiting the max dotclock well below 1.62 GHz.

> The correct place to handle this would seem
> to be the link rate calculation, ie. just bump up the link rate until
> the limit is no longer an issue (or error out if we can't increase the
> link rate sufficiently).
> 
> > +
> >  	/*
> >  	 * On BDW+ writing LINK_N arms the double buffered update
> >  	 * of all the M/N registers, so it must be written last.
> >  	 */
> > -	intel_de_write(display, link_n_reg, m_n->link_n);
> > +	intel_de_write(display, link_n_reg, link_n);
> >  }
> >  
> >  bool intel_cpu_transcoder_has_m2_n2(struct intel_display *display,
> > @@ -3279,7 +3287,13 @@ void intel_get_m_n(struct intel_display *display,
> >  		   i915_reg_t link_m_reg, i915_reg_t link_n_reg)
> >  {
> >  	m_n->link_m = intel_de_read(display, link_m_reg) & DATA_LINK_M_N_MASK;
> > -	m_n->link_n = intel_de_read(display, link_n_reg) & DATA_LINK_M_N_MASK;
> > +	m_n->link_n = intel_de_read(display, link_n_reg);
> > +
> > +	if (DISPLAY_VER(display) >= 14)
> > +		m_n->link_n &= ~PIPE_LINK_N1_EXTENDED_MASK;
> > +	else
> > +		m_n->link_n &= DATA_LINK_M_N_MASK;
> > +
> >  	m_n->data_m = intel_de_read(display, data_m_reg) & DATA_LINK_M_N_MASK;
> >  	m_n->data_n = intel_de_read(display, data_n_reg) & DATA_LINK_M_N_MASK;
> >  	m_n->tu = REG_FIELD_GET(TU_SIZE_MASK, intel_de_read(display, data_m_reg)) + 1;
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index c5064eebe063..a2054aced4f8 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -1869,6 +1869,8 @@
> >  
> >  #define _PIPEA_LINK_N1		0x60044
> >  #define _PIPEB_LINK_N1		0x61044
> > +#define  PIPE_LINK_N1_EXTENDED_MASK	REG_GENMASK(31, 24)
> > +#define  PIPE_LINK_N1_EXTENDED(val)	REG_FIELD_PREP(PIPE_LINK_N1_EXTENDED_MASK, (val))
> >  #define PIPE_LINK_N1(dev_priv, tran) _MMIO_TRANS2(dev_priv, tran, _PIPEA_LINK_N1)
> >  
> >  #define _PIPEA_LINK_M2		0x60048
> > -- 
> > 2.45.2
> 
> -- 
> Ville Syrjälä
> Intel

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-03-21 18:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 11:26 [PATCH 0/4] Implement Wa_14021768792 to bypass m_n ratio limit Ankit Nautiyal
2025-03-21 11:26 ` [PATCH 1/4] Add bits for link_n_exended for DISPLAY >= 14 Ankit Nautiyal
2025-03-21 18:31   ` Ville Syrjälä
2025-03-21 18:42     ` Ville Syrjälä [this message]
2025-03-26  9:24     ` Nautiyal, Ankit K
2025-03-21 11:26 ` [PATCH 2/4] drm/i915/display: Limit m/n ratio to 10 for display > 12 Ankit Nautiyal
2025-03-21 11:26 ` [PATCH 3/4] drm/i915/display: Add bits for Wa_14021768792 for linkm/n ratio > 10 Ankit Nautiyal
2025-03-21 11:26 ` [PATCH 4/4] drm/i915/display: Implement Wa_14021768792 for BMG DP for link_m/n " Ankit Nautiyal
2025-03-21 12:33 ` ✓ CI.Patch_applied: success for Implement Wa_14021768792 to bypass m_n ratio limit (rev4) Patchwork
2025-03-21 12:33 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-21 12:34 ` ✓ CI.KUnit: success " Patchwork
2025-03-21 12:51 ` ✓ CI.Build: " Patchwork
2025-03-21 12:53 ` ✓ CI.Hooks: " Patchwork
2025-03-21 12:55 ` ✗ CI.checksparse: warning " Patchwork
2025-03-21 13:15 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-21 14:44 ` ✗ Xe.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-10-10  4:10 [PATCH 0/4] Implement Wa_14021768792 to bypass m_n ratio limit Ankit Nautiyal
2024-10-10  4:10 ` [PATCH 1/4] Add bits for link_n_exended for DISPLAY >= 14 Ankit Nautiyal
2024-11-28  6:54   ` Srikanth V, NagaVenkata
2024-09-17 17:41 [PATCH 0/4] Implement Wa_14021768792 to bypass m_n ratio limit Ankit Nautiyal
2024-09-17 17:41 ` [PATCH 1/4] Add bits for link_n_exended for DISPLAY >= 14 Ankit Nautiyal
2024-09-17 17:46   ` Jani Nikula
2024-09-18  3:58     ` Nautiyal, Ankit K

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=Z92zJQsjTVs4FDef@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=uma.shankar@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