From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/8] drm/i915: Rewrite mst suspend/resume in terms of encoders
Date: Fri, 6 Jul 2018 10:00:51 -0700 [thread overview]
Message-ID: <20180706170051.GE2848@intel.com> (raw)
In-Reply-To: <20180706104235.GG5565@intel.com>
On Fri, Jul 06, 2018 at 01:42:35PM +0300, Ville Syrjälä wrote:
> On Thu, Jul 05, 2018 at 02:29:59PM -0700, Rodrigo Vivi wrote:
> > On Thu, Jul 05, 2018 at 07:43:52PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > Rather than looping over all the ports and picking the encoder based on
> > > the port, let's just loop over all the encoders instead. Gets rid of
> > > some irq_port[] usage, which is a bit of an eye sore.
> > >
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > > drivers/gpu/drm/i915/i915_drv.c | 4 ++--
> > > drivers/gpu/drm/i915/intel_dp.c | 41 +++++++++++++++++++++++-----------------
> > > drivers/gpu/drm/i915/intel_drv.h | 4 ++--
> > > 3 files changed, 28 insertions(+), 21 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > > index 0db3c83cce29..1f2449d9206d 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.c
> > > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > > @@ -1577,7 +1577,7 @@ static int i915_drm_suspend(struct drm_device *dev)
> > >
> > > intel_display_suspend(dev);
> > >
> > > - intel_dp_mst_suspend(dev);
> > > + intel_dp_mst_suspend(dev_priv);
> > >
> > > intel_runtime_pm_disable_interrupts(dev_priv);
> > > intel_hpd_cancel_work(dev_priv);
> > > @@ -1742,7 +1742,7 @@ static int i915_drm_resume(struct drm_device *dev)
> > > dev_priv->display.hpd_irq_setup(dev_priv);
> > > spin_unlock_irq(&dev_priv->irq_lock);
> > >
> > > - intel_dp_mst_resume(dev);
> > > + intel_dp_mst_resume(dev_priv);
> > >
> > > intel_display_resume(dev);
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > > index e95f1181e302..e9bc0f9f5e54 100644
> > > --- a/drivers/gpu/drm/i915/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > > @@ -6490,37 +6490,44 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
> > > return false;
> > > }
> > >
> > > -void intel_dp_mst_suspend(struct drm_device *dev)
> > > +void intel_dp_mst_suspend(struct drm_i915_private *dev_priv)
> > > {
> > > - struct drm_i915_private *dev_priv = to_i915(dev);
> > > - int i;
> > > + struct intel_encoder *encoder;
> > > +
> > > + for_each_intel_encoder(&dev_priv->drm, encoder) {
> > > + struct intel_dp *intel_dp;
> > > +
> > > + if (encoder->type != INTEL_OUTPUT_DDI)
> >
> > INTEL_OUTPUT_DP not possible at this point?
>
> No MST on pre-DDI platforms, and encoder->type for DDI platforms is
> either DDI or EDP but never DP.
Oh! indeed, thanks
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> >
> > > + continue;
> > >
> > > - /* disable MST */
> > > - for (i = 0; i < I915_MAX_PORTS; i++) {
> > > - struct intel_digital_port *intel_dig_port = dev_priv->hotplug.irq_port[i];
> > > + intel_dp = enc_to_intel_dp(&encoder->base);
> > >
> > > - if (!intel_dig_port || !intel_dig_port->dp.can_mst)
> > > + if (!intel_dp->can_mst)
> > > continue;
> > >
> > > - if (intel_dig_port->dp.is_mst)
> > > - drm_dp_mst_topology_mgr_suspend(&intel_dig_port->dp.mst_mgr);
> > > + if (intel_dp->is_mst)
> > > + drm_dp_mst_topology_mgr_suspend(&intel_dp->mst_mgr);
> > > }
> > > }
> > >
> > > -void intel_dp_mst_resume(struct drm_device *dev)
> > > +void intel_dp_mst_resume(struct drm_i915_private *dev_priv)
> > > {
> > > - struct drm_i915_private *dev_priv = to_i915(dev);
> > > - int i;
> > > + struct intel_encoder *encoder;
> > >
> > > - for (i = 0; i < I915_MAX_PORTS; i++) {
> > > - struct intel_digital_port *intel_dig_port = dev_priv->hotplug.irq_port[i];
> > > + for_each_intel_encoder(&dev_priv->drm, encoder) {
> > > + struct intel_dp *intel_dp;
> > > int ret;
> > >
> > > - if (!intel_dig_port || !intel_dig_port->dp.can_mst)
> > > + if (encoder->type != INTEL_OUTPUT_DDI)
> > > + continue;
> > > +
> > > + intel_dp = enc_to_intel_dp(&encoder->base);
> > > +
> > > + if (!intel_dp->can_mst)
> > > continue;
> > >
> > > - ret = drm_dp_mst_topology_mgr_resume(&intel_dig_port->dp.mst_mgr);
> > > + ret = drm_dp_mst_topology_mgr_resume(&intel_dp->mst_mgr);
> > > if (ret)
> > > - intel_dp_check_mst_status(&intel_dig_port->dp);
> > > + intel_dp_check_mst_status(intel_dp);
> > > }
> > > }
> > > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > > index 077189ed9e46..dc11106b2081 100644
> > > --- a/drivers/gpu/drm/i915/intel_drv.h
> > > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > > @@ -1700,8 +1700,8 @@ void intel_edp_backlight_off(const struct drm_connector_state *conn_state);
> > > void intel_edp_panel_vdd_on(struct intel_dp *intel_dp);
> > > void intel_edp_panel_on(struct intel_dp *intel_dp);
> > > void intel_edp_panel_off(struct intel_dp *intel_dp);
> > > -void intel_dp_mst_suspend(struct drm_device *dev);
> > > -void intel_dp_mst_resume(struct drm_device *dev);
> > > +void intel_dp_mst_suspend(struct drm_i915_private *dev_priv);
> > > +void intel_dp_mst_resume(struct drm_i915_private *dev_priv);
> > > int intel_dp_max_link_rate(struct intel_dp *intel_dp);
> > > int intel_dp_max_lane_count(struct intel_dp *intel_dp);
> > > int intel_dp_rate_select(struct intel_dp *intel_dp, int rate);
> > > --
> > > 2.16.4
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-07-06 17:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 16:43 [PATCH 0/8] drm/i915: Hotplug cleanups and whanot Ville Syrjala
2018-07-05 16:43 ` [PATCH 1/8] drm/i915: Introduce for_each_intel_dp() Ville Syrjala
2018-07-05 21:17 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 2/8] drm/i915: Introduce intel_encoder_is_dig_port() Ville Syrjala
2018-07-06 17:01 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 3/8] drm/i915: Rewrite mst suspend/resume in terms of encoders Ville Syrjala
2018-07-05 21:29 ` Rodrigo Vivi
2018-07-06 10:42 ` Ville Syrjälä
2018-07-06 17:00 ` Rodrigo Vivi [this message]
2018-07-05 16:43 ` [PATCH 4/8] drm/i915: Nuke dev_priv->irq_port[] Ville Syrjala
2018-07-09 21:27 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 5/8] drm/i915: s/int i/enum hpd_pin pin/ Ville Syrjala
2018-07-09 21:28 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 6/8] drm/i915: Pass hpd_pin to long_pulse_detect() Ville Syrjala
2018-07-05 21:14 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 7/8] drm/i915: Assert that our hpd pin bitmasks don't overflow Ville Syrjala
2018-07-05 16:52 ` Chris Wilson
2018-07-05 17:51 ` Ville Syrjälä
2018-07-05 17:57 ` Chris Wilson
2018-07-05 16:43 ` [PATCH 8/8] drm/i915: Print the long_mask alongside the pin_mask Ville Syrjala
2018-07-05 18:00 ` Chris Wilson
2018-07-05 20:55 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Hotplug cleanups and whanot Patchwork
2018-07-05 20:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-05 21:14 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-06 11:05 ` ✓ Fi.CI.IGT: " 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=20180706170051.GE2848@intel.com \
--to=rodrigo.vivi@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).