From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup
Date: Tue, 2 Aug 2016 16:20:18 +0200 [thread overview]
Message-ID: <20160802142018.GV6232@phenom.ffwll.local> (raw)
In-Reply-To: <20160729095520.GX4329@intel.com>
On Fri, Jul 29, 2016 at 12:55:20PM +0300, Ville Syrjälä wrote:
> On Fri, Jul 29, 2016 at 11:16:19AM +0200, Daniel Vetter wrote:
> > On Thu, Jul 28, 2016 at 05:50:39PM +0300, ville.syrjala@linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > The MST vs. SST selection should depend purely on the choice of the
> > > connector/encoder. So don't try to determine the correct DDI mode
> > > based on the intel_dp->is_mst, which simply tells us whether the sink
> > > is in MST mode or not. Instead derive the information from the encoder
> > > type. Since the link training code deals in non-fake encoders, we'll
> > > also need to keep a second copy of that information around, which we'll
> > > now designate as 'link_mst'.
> > >
> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Hm, I think it'd be nice if we could shovel all this stuff into the crtc
> > state I think, instead of noodling it out of somewhere else.
>
> You mean stuffing a pre-computed (partial?) register value in the
> crtc state? That could work too.
Yeah. But reading ahead I'm not sure where exactly we need to store that,
since recovering that with your sync_state rfc might get tricky.
-Daniel
>
> > But since we
> > always update it in pre_enable hooks it should be all fine even with
> > TEST_ONLY atomic.
> >
> > I digress, change looks good.
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> > > ---
> > > drivers/gpu/drm/i915/intel_ddi.c | 21 +++------------------
> > > drivers/gpu/drm/i915/intel_dp.c | 1 +
> > > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > > 3 files changed, 5 insertions(+), 18 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > > index dd1d6fe12297..3b3a0a808477 100644
> > > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > > @@ -1111,7 +1111,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc)
> > > {
> > > struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > > struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
> > > - struct drm_encoder *encoder = &intel_encoder->base;
> > > struct drm_device *dev = crtc->dev;
> > > struct drm_i915_private *dev_priv = to_i915(dev);
> > > enum pipe pipe = intel_crtc->pipe;
> > > @@ -1177,29 +1176,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc)
> > > temp |= TRANS_DDI_MODE_SELECT_HDMI;
> > > else
> > > temp |= TRANS_DDI_MODE_SELECT_DVI;
> > > -
> > > } else if (type == INTEL_OUTPUT_ANALOG) {
> > > temp |= TRANS_DDI_MODE_SELECT_FDI;
> > > temp |= (intel_crtc->config->fdi_lanes - 1) << 1;
> > > -
> > > } else if (type == INTEL_OUTPUT_DP ||
> > > type == INTEL_OUTPUT_EDP) {
> > > - struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> > > -
> > > - if (intel_dp->is_mst) {
> > > - temp |= TRANS_DDI_MODE_SELECT_DP_MST;
> > > - } else
> > > - temp |= TRANS_DDI_MODE_SELECT_DP_SST;
> > > -
> > > + temp |= TRANS_DDI_MODE_SELECT_DP_SST;
> > > temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count);
> > > } else if (type == INTEL_OUTPUT_DP_MST) {
> > > - struct intel_dp *intel_dp = &enc_to_mst(encoder)->primary->dp;
> > > -
> > > - if (intel_dp->is_mst) {
> > > - temp |= TRANS_DDI_MODE_SELECT_DP_MST;
> > > - } else
> > > - temp |= TRANS_DDI_MODE_SELECT_DP_SST;
> > > -
> > > + temp |= TRANS_DDI_MODE_SELECT_DP_MST;
> > > temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count);
> > > } else {
> > > WARN(1, "Invalid encoder type %d for pipe %c\n",
> > > @@ -2105,7 +2090,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
> > >
> > > val = DP_TP_CTL_ENABLE |
> > > DP_TP_CTL_LINK_TRAIN_PAT1 | DP_TP_CTL_SCRAMBLE_DISABLE;
> > > - if (intel_dp->is_mst)
> > > + if (intel_dp->link_mst)
> > > val |= DP_TP_CTL_MODE_MST;
> > > else {
> > > val |= DP_TP_CTL_MODE_SST;
> > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > > index 8c38e3483989..0096c651c21f 100644
> > > --- a/drivers/gpu/drm/i915/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > > @@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
> > > {
> > > intel_dp->link_rate = pipe_config->port_clock;
> > > intel_dp->lane_count = pipe_config->lane_count;
> > > + intel_dp->link_mst = intel_crtc_has_type(pipe_config, INTEL_OUTPUT_DP_MST);
> > > }
> > >
> > > static void intel_dp_prepare(struct intel_encoder *encoder)
> > > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > > index e74d851868c5..70d7f33d6747 100644
> > > --- a/drivers/gpu/drm/i915/intel_drv.h
> > > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > > @@ -852,6 +852,7 @@ struct intel_dp {
> > > int link_rate;
> > > uint8_t lane_count;
> > > uint8_t sink_count;
> > > + bool link_mst;
> > > bool has_audio;
> > > bool detect_done;
> > > enum hdmi_force_audio force_audio;
> > > --
> > > 2.7.4
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
>
> --
> Ville Syrjälä
> Intel OTC
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-08-02 14:20 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 14:50 [PATCH 00/12] drm/i915: Move DP link retraining to hotplug work etc ville.syrjala
2016-07-28 14:50 ` [PATCH 01/12] drm/i915: Ignore initial lid state for eDP ville.syrjala
2016-07-28 15:47 ` Chris Wilson
2016-07-28 16:01 ` Ville Syrjälä
2016-07-28 16:36 ` Chris Wilson
2016-07-28 16:48 ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 02/12] drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP ville.syrjala
2016-07-28 17:30 ` Chris Wilson
2016-07-28 17:45 ` Ville Syrjälä
2016-07-29 13:52 ` [PATCH v3 " ville.syrjala
2016-07-28 14:50 ` [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup ville.syrjala
2016-07-29 9:16 ` Daniel Vetter
2016-07-29 9:55 ` Ville Syrjälä
2016-08-02 14:20 ` Daniel Vetter [this message]
2016-08-01 9:24 ` Maarten Lankhorst
2016-07-28 14:50 ` [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port ville.syrjala
2016-07-29 9:19 ` Daniel Vetter
2016-07-29 11:28 ` Ville Syrjälä
2016-08-02 14:22 ` Daniel Vetter
2016-08-01 9:28 ` Maarten Lankhorst
2016-07-28 14:50 ` [PATCH 05/12] drm/i915: Track active streams also for DP SST ville.syrjala
2016-07-29 9:22 ` Daniel Vetter
2016-07-29 11:36 ` Ville Syrjälä
2016-07-29 18:36 ` Jim Bride
2016-08-02 14:28 ` Daniel Vetter
2016-07-28 14:50 ` [PATCH 06/12] drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails ville.syrjala
2016-07-29 9:29 ` Daniel Vetter
2016-07-29 11:41 ` Ville Syrjälä
2016-07-29 13:51 ` [PATCH v2 " ville.syrjala
2016-07-28 14:50 ` [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect() ville.syrjala
2016-07-28 19:48 ` Manasi Navare
2016-07-28 20:15 ` Ville Syrjälä
2016-07-29 0:36 ` Manasi Navare
2016-07-29 9:52 ` Ville Syrjälä
2016-07-29 21:42 ` Manasi Navare
2016-07-29 21:45 ` Manasi Navare
2016-08-01 10:03 ` Ville Syrjälä
2016-07-29 20:37 ` Jim Bride
2016-07-28 14:50 ` [PATCH 08/12] drm/i915: Skip dpcd/edid read unless there was a long hpd ville.syrjala
2016-07-28 15:38 ` Chris Wilson
2016-07-28 15:44 ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 09/12] drm/i915: Remove useless rate_to_index() usage ville.syrjala
2016-07-29 9:33 ` Daniel Vetter
2016-07-28 14:50 ` [PATCH 10/12] drm/i915: Allow rate_to_index() to return non-exact matches ville.syrjala
2016-07-29 9:35 ` Daniel Vetter
2016-07-29 11:43 ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 11/12] drm/i915: Don't try to ack sink irqs when there are none ville.syrjala
2016-07-29 9:38 ` Daniel Vetter
2016-07-28 14:50 ` [RFC][PATCH 12/12] drm/i915: Add encoder .sync_state() hook ville.syrjala
2016-07-29 9:42 ` Daniel Vetter
2016-07-28 15:39 ` ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc Patchwork
2016-07-29 14:27 ` ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc. (rev3) Patchwork
2016-08-04 12:35 ` Ville Syrjälä
2016-08-04 13:08 ` [PATCH 00/12] drm/i915: Move DP link retraining to hotplug work etc 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=20160802142018.GV6232@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.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