drm/i915: make sure VDD is turned off during system suspend
Subsystems (2)
PATCH 3/4 drm/i915: make sure VDD is turned off during system suspend
Atm we may leave eDP VDD enabled during system suspend after the CRTCs are disabled through an HPD->DPCD read event. So disable VDD during suspend at a point when no HPDs can occur.
--- drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +15 -0
@@ -501,6 +501,19 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)cancel_delayed_work_sync (&dev_priv->hotplug_reenable_work); } +static void intel_suspend_encoders (struct drm_i915_private *dev_priv) +{ +struct drm_device *dev = dev_priv->dev; +struct intel_encoder *intel_encoder; + +drm_modeset_lock_all (dev); +for_each_intel_encoder (dev, intel_encoder) { +if (intel_encoder->suspend) + intel_encoder->suspend (intel_encoder); + } +drm_modeset_unlock_all (dev); +} +static int i915_drm_freeze (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;
@@ -547,6 +560,8 @@ static int i915_drm_freeze(struct drm_device *dev)intel_runtime_pm_disable_interrupts (dev);intel_hpd_cancel_work (dev_priv); +intel_suspend_encoders (dev_priv); +intel_suspend_gt_powersave (dev);intel_modeset_suspend_hw (dev);
drivers/gpu/drm/i915/intel_dp.c +11 -2
@@ -1291,8 +1291,6 @@ static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)if (!is_edp (intel_dp))return ; -WARN (!intel_dp->want_panel_vdd,"eDP VDD not forced on" ); - intel_dp->want_panel_vdd = false;if (sync)
@@ -4003,6 +4001,16 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)kfree (intel_dig_port); } +void intel_dp_encoder_suspend (struct intel_encoder *intel_encoder) +{ +struct intel_dp *intel_dp =enc_to_intel_dp (&intel_encoder->base); + +if (!is_edp (intel_dp)) +return ; + +edp_panel_vdd_off (intel_dp, true); +} +static void intel_dp_encoder_reset (struct drm_encoder *encoder) {intel_edp_panel_vdd_sanitize (to_intel_encoder (encoder));
@@ -4722,6 +4730,7 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port) intel_encoder->disable = intel_disable_dp; intel_encoder->get_hw_state = intel_dp_get_hw_state; intel_encoder->get_config = intel_dp_get_config; + intel_encoder->suspend = intel_dp_encoder_suspend;if (IS_CHERRYVIEW (dev)) { intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable; intel_encoder->pre_enable = chv_pre_enable_dp;
drivers/gpu/drm/i915/intel_drv.h +6 -0
@@ -153,6 +153,12 @@ struct intel_encoder {* be set correctly before calling this function. */ void (*get_config)(struct intel_encoder *,struct intel_crtc_config *pipe_config); +/* +* Called during system suspend after all pending requests for the +* encoder are flushed (for example for DP AUX transactions) and +* device interrupts are disabled. +*/ +void (*suspend)(struct intel_encoder *);int crtc_mask;enum hpd_pin hpd_pin; };
Signature · 1 line
1.8.4
PATCH 4/4 drm/i915: don't try to retrain a DP link on an inactive CRTC
Atm we may retrain the DP link even if the CRTC is inactive through HPD work->intel_dp_check_link_status(). This in turn can lock up the PHY (at least on BYT), since the DP port is disabled.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81948
--- drivers/gpu/drm/i915/intel_dp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +3 -0
@@ -3551,6 +3551,9 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)if (WARN_ON (!intel_encoder->base.crtc))return ; +if (!to_intel_crtc (intel_encoder->base.crtc)->active) +return ; +/* Try to read receiver status if the link appears to be up */ if (!intel_dp_get_link_status (intel_dp, link_status)) {return ;
Signature · 1 line
1.8.4
Re: [PATCH 4/4] drm/i915: don't try to retrain a DP link on an inactive CRTC
Quoted 15 lines · Imre Deak
Atm we may retrain the DP link even if the CRTC is inactive through HPD
work->intel_dp_check_link_status(). This in turn can lock up the PHY (at least on BYT), since the DP port is disabled.Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81948
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/i915/intel_dp.c +0
-0
drivers/gpu/drm/i915/intel_dp.c intel_dp_check_link_status(struct intel_dp *intel_dp) · line 3555
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +2
-0@@ -3551,6 +3551,9 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)if (WARN_ON (!intel_encoder->base.crtc))return ; +if (!to_intel_crtc (intel_encoder->base.crtc)->active) +return ;
Yeah the connectors_active check isn't enough since we don't clear that when we disable the crtcs for system suspend. Maybe we should do that instead?
Anyway this check seems fine to me regardless of how we deal with connectors_active during system suspend, so:
Quoted 11 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0+/* Try to read receiver status if the link appears to be up */ if (!intel_dp_get_link_status (intel_dp, link_status)) {return ;Signature · 6 lines
1.8.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 3 lines · Imre Deak
Atm we may leave eDP VDD enabled during system suspend after the CRTCs are disabled through an
HPD->DPCDread event. So disable VDD during suspend at a point when no HPDs can occur.
And vdd itself holds a runtime pm ref so this problem can't occur there.
Quoted 46 lines
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_drv.c +15
-0@@ -501,6 +501,19 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)cancel_delayed_work_sync (&dev_priv->hotplug_reenable_work); } +static void intel_suspend_encoders (struct drm_i915_private *dev_priv) +{ +struct drm_device *dev = dev_priv->dev; +struct intel_encoder *intel_encoder; + +drm_modeset_lock_all (dev); +for_each_intel_encoder (dev, intel_encoder) { +if (intel_encoder->suspend) + intel_encoder->suspend (intel_encoder); + } +drm_modeset_unlock_all (dev); +} +static int i915_drm_freeze (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;@@ -547,6 +560,8 @@ static int i915_drm_freeze(struct drm_device *dev)intel_runtime_pm_disable_interrupts (dev);intel_hpd_cancel_work (dev_priv); +intel_suspend_encoders (dev_priv); +intel_suspend_gt_powersave (dev);intel_modeset_suspend_hw (dev);drivers/gpu/drm/i915/intel_dp.c +0
-0
drivers/gpu/drm/i915/intel_dp.c static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) · line 1295
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +0
-2@@ -1291,8 +1291,6 @@ static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)if (!is_edp (intel_dp))return ; -WARN (!intel_dp->want_panel_vdd,"eDP VDD not forced on" ); -
Should we perhaps keep this warn here and call the _sync() version directly from ->suspend()? I think we already do it that way when tearing down the encoder.
drivers/gpu/drm/i915/intel_dp.c void intel_dp_encoder_destroy(struct drm_encoder *encoder) · line 4009
Quoted 13 lines
drivers/gpu/drm/i915/intel_dp.c +6
-0intel_dp->want_panel_vdd = false;if (sync)@@ -4003,6 +4001,16 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)kfree (intel_dig_port); } +void intel_dp_encoder_suspend (struct intel_encoder *intel_encoder) +{ +struct intel_dp *intel_dp =enc_to_intel_dp (&intel_encoder->base); + +if (!is_edp (intel_dp)) +return ;
edp_panel_vdd_off() already has the same check, but if you convert it to use the _sync() directly then the check is needed.
Quoted 39 lines
drivers/gpu/drm/i915/intel_dp.c +5
-0+ +edp_panel_vdd_off (intel_dp, true); +} +static void intel_dp_encoder_reset (struct drm_encoder *encoder) {intel_edp_panel_vdd_sanitize (to_intel_encoder (encoder));@@ -4722,6 +4730,7 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port) intel_encoder->disable = intel_disable_dp; intel_encoder->get_hw_state = intel_dp_get_hw_state; intel_encoder->get_config = intel_dp_get_config; + intel_encoder->suspend = intel_dp_encoder_suspend;if (IS_CHERRYVIEW (dev)) { intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable; intel_encoder->pre_enable = chv_pre_enable_dp;drivers/gpu/drm/i915/intel_drv.h +6
-0@@ -153,6 +153,12 @@ struct intel_encoder {* be set correctly before calling this function. */ void (*get_config)(struct intel_encoder *,struct intel_crtc_config *pipe_config); +/* +* Called during system suspend after all pending requests for the +* encoder are flushed (for example for DP AUX transactions) and +* device interrupts are disabled. +*/ +void (*suspend)(struct intel_encoder *);int crtc_mask;enum hpd_pin hpd_pin; };Signature · 6 lines
1.8.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 6 lines · Ville Syrjälä
Quoted 3 lines · Imre Deak
Atm we may leave eDP VDD enabled during system suspend after the CRTCs are disabled through an
HPD->DPCDread event. So disable VDD during suspend at a point when no HPDs can occur.And vdd itself holds a runtime pm ref so this problem can't occur there.
Yep, I'll update the commit message.
Quoted 48 lines
Quoted 48 lines
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_drv.c +15
-0@@ -501,6 +501,19 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)cancel_delayed_work_sync (&dev_priv->hotplug_reenable_work); } +static void intel_suspend_encoders (struct drm_i915_private *dev_priv) +{ +struct drm_device *dev = dev_priv->dev; +struct intel_encoder *intel_encoder; + +drm_modeset_lock_all (dev); +for_each_intel_encoder (dev, intel_encoder) { +if (intel_encoder->suspend) + intel_encoder->suspend (intel_encoder); + } +drm_modeset_unlock_all (dev); +} +static int i915_drm_freeze (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;@@ -547,6 +560,8 @@ static int i915_drm_freeze(struct drm_device *dev)intel_runtime_pm_disable_interrupts (dev);intel_hpd_cancel_work (dev_priv); +intel_suspend_encoders (dev_priv); +intel_suspend_gt_powersave (dev);intel_modeset_suspend_hw (dev);drivers/gpu/drm/i915/intel_dp.c +0
-0@@ -1291,8 +1291,6 @@ static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)if (!is_edp (intel_dp))return ;
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) · line 1295
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +0
-2-WARN (!intel_dp->want_panel_vdd,"eDP VDD not forced on" ); -Should we perhaps keep this warn here and call the
_sync()version directly from ->suspend()? I think we already do it that way when tearing down the encoder.
Ok.
Quoted 52 lines
drivers/gpu/drm/i915/intel_dp.c void intel_dp_encoder_destroy(struct drm_encoder *encoder) · line 4009
Quoted 13 lines
drivers/gpu/drm/i915/intel_dp.c +6
-0intel_dp->want_panel_vdd = false;if (sync)@@ -4003,6 +4001,16 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)kfree (intel_dig_port); } +void intel_dp_encoder_suspend (struct intel_encoder *intel_encoder) +{ +struct intel_dp *intel_dp =enc_to_intel_dp (&intel_encoder->base); + +if (!is_edp (intel_dp)) +return ;
edp_panel_vdd_off()already has the same check, but if you convert it to use the_sync()directly then the check is needed.Quoted 35 lines
drivers/gpu/drm/i915/intel_dp.c +5
-0+ +edp_panel_vdd_off (intel_dp, true); +} +static void intel_dp_encoder_reset (struct drm_encoder *encoder) {intel_edp_panel_vdd_sanitize (to_intel_encoder (encoder));@@ -4722,6 +4730,7 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port) intel_encoder->disable = intel_disable_dp; intel_encoder->get_hw_state = intel_dp_get_hw_state; intel_encoder->get_config = intel_dp_get_config; + intel_encoder->suspend = intel_dp_encoder_suspend;if (IS_CHERRYVIEW (dev)) { intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable; intel_encoder->pre_enable = chv_pre_enable_dp;drivers/gpu/drm/i915/intel_drv.h +6
-0@@ -153,6 +153,12 @@ struct intel_encoder {* be set correctly before calling this function. */ void (*get_config)(struct intel_encoder *,struct intel_crtc_config *pipe_config); +/* +* Called during system suspend after all pending requests for the +* encoder are flushed (for example for DP AUX transactions) and +* device interrupts are disabled. +*/ +void (*suspend)(struct intel_encoder *);int crtc_mask;enum hpd_pin hpd_pin; };Signature · 1 line
1.8.4
Quoted 5 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx