From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 10/11] drm/i915: Plumb crtc_state to link training
Date: Wed, 30 Sep 2020 21:50:52 +0300 [thread overview]
Message-ID: <20200930185052.GM6112@intel.com> (raw)
In-Reply-To: <20200930163624.GJ867650@ideak-desk.fi.intel.com>
On Wed, Sep 30, 2020 at 07:36:24PM +0300, Imre Deak wrote:
> On Wed, Sep 30, 2020 at 02:34:48AM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Get rid of mode crtc->config usage, and some ad-hoc intel_dp state
> > usage by plumbing the crtc state all the way down to the link training
> > code.
> >
> > Unfortunately we do have to keep some cached state in intel_dp so
> > that we can do the "does the link need retraining?" checks from
> > the short hpd handler.
> >
> > v2: Add intel_crtc_state forward declaration
> > v3: Don't kill the PHY test code totally since it's
> > now in the hotplug work where we can get at the states
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Reviewed-by: Imre Deak <imre.deak@intel.com>
>
> 4 nitpicks below.
>
<snip>
> > static void
> > -tgl_dkl_phy_ddi_vswing_sequence(struct intel_encoder *encoder, int link_clock,
> > - u32 level, enum intel_output_type type)
> > +tgl_dkl_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
> > + const struct intel_crtc_state *crtc_state,
> > + int level)
> > {
> > struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port);
> > const struct tgl_dkl_phy_ddi_buf_trans *ddi_translations;
> > - u32 n_entries, val, ln, dpcnt_mask, dpcnt_val;
> > - int rate = 0;
> > + u32 val, dpcnt_mask, dpcnt_val;
> > + int n_entries, ln;
> >
> > - if (type == INTEL_OUTPUT_HDMI) {
> > - struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> > -
> > - rate = intel_dp->link_rate;
>
> Looks like a bugfix and then would make sense to fix it in a separate
> patch.
Didn't even notie this one. I need to check whether it's a current bug
or if I just fumbled the earlier patches somehow.
<snip>
> > @@ -4224,10 +4209,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
> > intel_wait_ddi_buf_idle(dev_priv, port);
> > }
> >
> > - dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
> > - if (intel_dp->link_mst)
> > + dp_tp_ctl = DP_TP_CTL_ENABLE |
> > + DP_TP_CTL_LINK_TRAIN_PAT1 | DP_TP_CTL_SCRAMBLE_DISABLE;
>
> Disable scrambling looks like some HW debugging feature, the HW toggles it
> automatically based on the spec. There was a recent related change
> removing setting it in intel_ddi_set_link_train().
>
> If needed, it should be a separate change imo.
This is just a rebase fail on my part I think.
Thanks for catching it.
<snip>
> > @@ -5852,8 +5871,20 @@ int intel_dp_retrain_link(struct intel_encoder *encoder,
> > intel_crtc_pch_transcoder(crtc), false);
> > }
> >
> > - intel_dp_start_link_train(intel_dp);
> > - intel_dp_stop_link_train(intel_dp);
> > + for_each_intel_crtc_mask(&dev_priv->drm, crtc, crtc_mask) {
> > + const struct intel_crtc_state *crtc_state =
> > + to_intel_crtc_state(crtc->base.state);
> > +
> > + /* retrain on the MST master transcoder */
> > + if (INTEL_GEN(dev_priv) >= 12 &&
> > + intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) &&
> > + crtc_state->cpu_transcoder != crtc_state->mst_master_transcoder)
>
> Could use intel_dp_mst_is_master_trans().
Ack. Didn't remember we had such a thing.
>
> > + continue;
> > +
> > + intel_dp_start_link_train(intel_dp, crtc_state);
> > + intel_dp_stop_link_train(intel_dp, crtc_state);
> > + break;
> > + }
> >
> > for_each_intel_crtc_mask(&dev_priv->drm, crtc, crtc_mask) {
> > const struct intel_crtc_state *crtc_state =
> > @@ -5923,6 +5954,7 @@ static int intel_dp_do_phy_test(struct intel_encoder *encoder,
> > {
> > struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> > + struct intel_crtc *crtc;
> > u32 crtc_mask;
> > int ret;
> >
> > @@ -5940,7 +5972,20 @@ static int intel_dp_do_phy_test(struct intel_encoder *encoder,
> >
> > drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] PHY test\n",
> > encoder->base.base.id, encoder->base.name);
> > - intel_dp_process_phy_request(intel_dp);
> > +
> > + for_each_intel_crtc_mask(&dev_priv->drm, crtc, crtc_mask) {
> > + const struct intel_crtc_state *crtc_state =
> > + to_intel_crtc_state(crtc->base.state);
> > +
> > + /* test on the MST master transcoder */
> > + if (INTEL_GEN(dev_priv) >= 12 &&
> > + intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) &&
> > + crtc_state->cpu_transcoder != crtc_state->mst_master_transcoder)
>
> Here too.
>
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-09-30 18:51 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 23:34 [Intel-gfx] [PATCH v2 00/11] drm/i915: Plumb crtc state to link training code Ville Syrjala
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 01/11] drm/i915: s/pre_empemph/preemph/ Ville Syrjala
2020-09-30 13:56 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 02/11] drm/i915: s/old_crtc_state/crtc_state/ Ville Syrjala
2020-09-30 13:57 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 03/11] drm/i915: Make intel_dp_process_phy_request() static Ville Syrjala
2020-09-30 13:58 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 04/11] drm/i915: Shove the PHY test into the hotplug work Ville Syrjala
2020-09-30 8:10 ` kernel test robot
2020-09-30 10:04 ` [Intel-gfx] [PATCH v3 " Ville Syrjala
2020-09-30 15:12 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 05/11] drm/i915: Split ICL combo PHY buf trans per output type Ville Syrjala
2020-09-30 15:19 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 06/11] drm/i915: Split ICL MG " Ville Syrjala
2020-09-30 15:21 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 07/11] drm/i915: Split EHL combo " Ville Syrjala
2020-09-30 15:24 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 08/11] drm/i915: Split TGL " Ville Syrjala
2020-09-30 15:29 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 09/11] drm/i915: Split TGL DKL " Ville Syrjala
2020-09-30 15:31 ` Imre Deak
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 10/11] drm/i915: Plumb crtc_state to link training Ville Syrjala
2020-09-30 16:36 ` Imre Deak
2020-09-30 18:50 ` Ville Syrjälä [this message]
2020-10-01 11:10 ` [Intel-gfx] [PATCH v4 " Ville Syrjala
2020-09-29 23:34 ` [Intel-gfx] [PATCH v2 11/11] drm/i915: Eliminate intel_dp.regs.dp_tp_{ctl, status} Ville Syrjala
2020-09-30 17:04 ` Imre Deak
2020-09-29 23:50 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Plumb crtc state to link training code (rev3) Patchwork
2020-09-29 23:51 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-09-30 0:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-30 10:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Plumb crtc state to link training code (rev4) Patchwork
2020-09-30 13:12 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Plumb crtc state to link training code (rev3) Patchwork
2020-09-30 15:35 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Plumb crtc state to link training code (rev4) Patchwork
2020-10-01 11:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Plumb crtc state to link training code (rev5) Patchwork
2020-10-01 11:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-10-01 13:12 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-10-01 14:02 ` [Intel-gfx] [PATCH v2 00/11] drm/i915: Plumb crtc state to link training code Ville Syrjälä
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=20200930185052.GM6112@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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