From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH 1/7] drm/i915/dp: Fix 2.7 Gbps DP_LINK_BW value on g4x
Date: Thu, 17 Jul 2025 00:41:32 +0300 [thread overview]
Message-ID: <aHgcjAMrjmzuIZPg@ideak-desk> (raw)
In-Reply-To: <aHfyKJ_NJL-i8B94@intel.com>
On Wed, Jul 16, 2025 at 09:40:40PM +0300, Ville Syrjälä wrote:
> On Wed, Jul 16, 2025 at 04:20:28PM +0300, Imre Deak wrote:
> > On Thu, Jul 10, 2025 at 11:17:12PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > On g4x we currently use the 96MHz non-SSC refclk, which can't actually
> > > generate an exact 2.7 Gbps link rate. In practice we end up with 2.688
> > > Gbps which seems to be close enough to actually work, but link training
> > > is currently failing due to miscalculating the DP_LINK_BW value (we
> > > calcualte it directly from port_clock which reflects the actual PLL
> > > outpout frequency).
> > >
> > > Ideas how to fix this:
> > > - nudge port_clock back up to 270000 during PLL computation/readout
> > > - track port_clock and the nominal link rate separately so they might
> > > differ a bit
> > > - switch to the 100MHz refclk, but that one should be SSC so perhaps
> > > not something we want
> > >
> > > While we ponder about a better solution apply some band aid to the
> > > immediate issue of miscalculated DP_LINK_BW value. With this
> > > I can again use 2.7 Gbps link rate on g4x.
> > >
> > > Cc: stable@vger.kernel.org
> > > Fixes: 665a7b04092c ("drm/i915: Feed the DPLL output freq back into crtc_state")
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Reviewed-by: Imre Deak <imre.deak@intel.com>
> >
> > IIUC, port_clock for g4x is ref * m / n / p, where for DP the fixed
> > ref=96000 and m/n/p values from g4x_dpll are used.
> >
> > Ftr, m = 135, n = 6, p = 8 would give port_clock = 270000, but there's
> > no intel_limit for DP, so can't know if these params are within range.
>
> The P divider can only be some multiple of 5.
Right, missed that, so with this ref clock setting an exact link rate
doesn't seem to be possible indeed (within the VCO range used for all
other output types on g4x).
> > > ---
> > > drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > > index f48912f308df..7976fec88606 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > > @@ -1606,6 +1606,12 @@ int intel_dp_rate_select(struct intel_dp *intel_dp, int rate)
> > > void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
> > > u8 *link_bw, u8 *rate_select)
> > > {
> > > + struct intel_display *display = to_intel_display(intel_dp);
> > > +
> > > + /* FIXME g4x can't generate an exact 2.7GHz with the 96MHz non-SSC refclk */
> > > + if (display->platform.g4x && port_clock == 268800)
> > > + port_clock = 270000;
> > > +
> > > /* eDP 1.4 rate select method. */
> > > if (intel_dp->use_rate_select) {
> > > *link_bw = 0;
> > > --
> > > 2.49.0
> > >
>
> --
> Ville Syrjälä
> Intel
next prev parent reply other threads:[~2025-07-16 21:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 20:17 [PATCH 0/7] drm/i915/dp: DP stuff Ville Syrjala
2025-07-10 20:17 ` [PATCH 1/7] drm/i915/dp: Fix 2.7 Gbps DP_LINK_BW value on g4x Ville Syrjala
2025-07-16 13:20 ` Imre Deak
2025-07-16 18:40 ` Ville Syrjälä
2025-07-16 21:41 ` Imre Deak [this message]
2025-07-10 20:17 ` [PATCH 2/7] drm/i915/dp: Don't switch to idle pattern before disable on pre-hsw Ville Syrjala
2025-07-16 13:32 ` Imre Deak
2025-07-10 20:17 ` [PATCH 3/7] drm/i915/dp: Clear DPCD training pattern before transmitting the idle pattern Ville Syrjala
2025-07-10 20:17 ` [PATCH 4/7] drm/i915/dp: Have intel_dp_get_adjust_train() tell us if anything changed Ville Syrjala
2025-07-10 20:17 ` [PATCH 5/7] drm/i915/dp: Move intel_dp_training_pattern() Ville Syrjala
2025-07-10 20:17 ` [PATCH 6/7] drm/i915/dp: Implement .set_idle_link_train() for everyone Ville Syrjala
2025-07-10 20:17 ` [PATCH 7/7] drm/i915/dp: Make .set_idle_link_train() mandatory Ville Syrjala
2025-07-10 20:54 ` ✓ CI.KUnit: success for drm/i915/dp: DP stuff Patchwork
2025-07-10 21:09 ` ✗ CI.checksparse: warning " Patchwork
2025-07-10 22:02 ` ✓ Xe.CI.BAT: success " Patchwork
2025-07-11 5:26 ` ✗ Xe.CI.Full: failure " Patchwork
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=aHgcjAMrjmzuIZPg@ideak-desk \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=ville.syrjala@linux.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