From: "Almahallawy, Khaled" <khaled.almahallawy@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Nikula, Jani" <jani.nikula@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Cc: "Shankar, Uma" <uma.shankar@intel.com>
Subject: Re: [PATCH] drm/i915/display: Set SPREAD_AMP bit to enable SSC
Date: Mon, 22 Sep 2025 20:06:25 +0000 [thread overview]
Message-ID: <396995979a4e852c31fe090300ed1121b3a158e8.camel@intel.com> (raw)
In-Reply-To: <11551c7d318448823015cc26d6409e0f897f0562@intel.com>
On Fri, 2025-09-19 at 13:26 +0300, Jani Nikula wrote:
> On Thu, 18 Sep 2025, Khaled Almahallawy
> <khaled.almahallawy@intel.com> wrote:
> > According to DP Specs[1]:
> > "SSC is enabled or disabled when the SPREAD_AMP bit in the
> > DOWNSPREAD_CTRL register is set or cleared (DPCD 00107h[4] = 1 or
> > 0,
> > respectively)."
> >
> > Set the SPREAD_AMP bit before starting link training to ensure SSC
> > is enabled as required.
> >
> > [1]: DisplayPort Standard v2.1 - Sec 2.2.3.1 De-spreading of the
> > Regenerated Stream Clock
> >
> > Cc: Uma Shankar <uma.shankar@intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: Khaled Almahallawy <khaled.almahallawy@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_dp_link_training.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> > b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> > index 27f3716bdc1f..db2ea3c51a5f 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> > @@ -711,9 +711,13 @@ static bool
> > intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp,
> >
> > void intel_dp_link_training_set_mode(struct intel_dp *intel_dp,
> > int link_rate, bool is_vrr)
> > {
> > + struct intel_display *display =
> > to_intel_display(intel_dp);
> > u8 link_config[2];
> > + bool ssc_enabled = intel_panel_use_ssc(display) &&
> > + (intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
> > DP_MAX_DOWNSPREAD_0_5);
>
> This is actually pretty messy.
>
> intel_panel_use_ssc() looks at a module parameter, and then at an
> *obsolete* field in the VBT, but may also be quirked away.
>
> And as the name implies, it's for panels, originally LVDS only.
>
> Someone needs to look at the VBT spec, there's a handful of places
> mentioning SSC, and *all* usage of intel_panel_use_ssc() in the
> driver,
> and match those properly, using the right part from VBT depending on
> BDB
> version and panel/child device, etc.
Noted, I will give a try to implement this.
>
> (Side note, there's Cx0 PHY code looking at DPCD registers for this,
> WTF.)
>
> This code here would probably benefit from having:
>
> intel_dp_source_supports_ssc()
>
> and
>
> intel_dp_sink_supports_ssc()
>
> to make all of this clear here.
>
> > - link_config[0] = is_vrr ? DP_MSA_TIMING_PAR_IGNORE_EN : 0;
> > + link_config[0] = (is_vrr ? DP_MSA_TIMING_PAR_IGNORE_EN :
> > 0) |
> > + (ssc_enabled ? DP_SPREAD_AMP_0_5 : 0);
>
> Getting complex, maybe something like:
>
> if (is_vrr)
> link_config[0] |= DP_MSA_TIMING_PAR_IGNORE_EN;
> if (intel_dp_source_supports_ssc() &&
> intel_dp_sink_supports_ssc())
> link_config[0] |= DP_SPREAD_AMP_0_5;
Sure, Will incorporate that.
>
> > link_config[1] = drm_dp_is_uhbr_rate(link_rate) ?
> > DP_SET_ANSI_128B132B : DP_SET_ANSI_8B10B;
> > drm_dp_dpcd_write(&intel_dp->aux, DP_DOWNSPREAD_CTRL,
> > link_config, 2);
>
Thank You for your review
Khaled
prev parent reply other threads:[~2025-09-22 20:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 21:28 [PATCH] drm/i915/display: Set SPREAD_AMP bit to enable SSC Khaled Almahallawy
2025-09-18 22:45 ` ✓ CI.KUnit: success for " Patchwork
2025-09-18 23:17 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-19 10:26 ` [PATCH] " Jani Nikula
2025-09-22 20:06 ` Almahallawy, Khaled [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=396995979a4e852c31fe090300ed1121b3a158e8.camel@intel.com \
--to=khaled.almahallawy@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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