From: Jani Nikula <jani.nikula@intel.com>
To: Khaled Almahallawy <khaled.almahallawy@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Khaled Almahallawy <khaled.almahallawy@intel.com>,
Uma Shankar <uma.shankar@intel.com>
Subject: Re: [PATCH] drm/i915/display: Set SPREAD_AMP bit to enable SSC
Date: Fri, 19 Sep 2025 13:26:43 +0300 [thread overview]
Message-ID: <11551c7d318448823015cc26d6409e0f897f0562@intel.com> (raw)
In-Reply-To: <20250918212847.1838637-1-khaled.almahallawy@intel.com>
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.
(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;
> 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);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-09-19 10:26 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 ` Jani Nikula [this message]
2025-09-22 20:06 ` [PATCH] " Almahallawy, Khaled
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=11551c7d318448823015cc26d6409e0f897f0562@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=khaled.almahallawy@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