drm/i915: Reuse the aux_domain cached
Subsystems (2)
PATCH 1/4 drm/i915: Reuse the aux_domain cached
intel_dp_detect() caches the aux_domain in the beginning of the function as it is used twice, so lets also use it as the aux_domain don't change in runtime.
--- drivers/gpu/drm/i915/intel_dp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -2
@@ -5289,8 +5289,7 @@ intel_dp_detect(struct drm_connector *connector, ret =intel_dp_retrain_link (encoder, ctx);if (ret) { -intel_display_power_put (dev_priv, -intel_aux_power_domain (dig_port)); +intel_display_power_put (dev_priv, aux_domain);return ret; } }
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Release DDI power well references in MST ports
MST ports did not had the post_pll_disable() hook causing the references get in pre_pll_enable() never being released causing DDI and AUX CH being enabled all the times.
--- drivers/gpu/drm/i915/intel_dp_mst.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/i915/intel_dp_mst.c +15 -0
@@ -215,6 +215,20 @@ static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, pipe_config, NULL); } +static void intel_mst_post_pll_disable_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config, +const struct drm_connector_state *conn_state) +{ +struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base); +struct intel_digital_port *intel_dig_port = intel_mst->primary; +struct intel_dp *intel_dp = &intel_dig_port->dp; + +if (intel_dp->active_mst_links ==0 && + intel_dig_port->base.post_pll_disable) + intel_dig_port->base.post_pll_disable (&intel_dig_port->base, + pipe_config,NULL ); +} +static void intel_mst_pre_enable_dp (struct intel_encoder *encoder,const struct intel_crtc_state *pipe_config,const struct drm_connector_state *conn_state)
@@ -549,6 +563,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum intel_encoder->disable = intel_mst_disable_dp; intel_encoder->post_disable = intel_mst_post_disable_dp; intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; + intel_encoder->post_pll_disable = intel_mst_post_pll_disable_dp; intel_encoder->pre_enable = intel_mst_pre_enable_dp; intel_encoder->enable = intel_mst_enable_dp; intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state;
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915: Release DDI power well references in MST ports
Quoted 7 lines · José Roberto de Souza
MST ports did not had the
post_pll_disable()hook causing the references get inpre_pll_enable()never being released causing DDI and AUX CH being enabled all the times.Cc Imre Deak <[email protected]>Cc Manasi Navare <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>
Patches 1 and 2 are
Quoted 44 lines
--- drivers/gpu/drm/i915/intel_dp_mst.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/gpu/drm/i915/intel_dp_mst.c +15
-0@@ -215,6 +215,20 @@ static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, pipe_config, NULL); } +static void intel_mst_post_pll_disable_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config, +const struct drm_connector_state *conn_state) +{ +struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base); +struct intel_digital_port *intel_dig_port = intel_mst->primary; +struct intel_dp *intel_dp = &intel_dig_port->dp; + +if (intel_dp->active_mst_links ==0 && + intel_dig_port->base.post_pll_disable) + intel_dig_port->base.post_pll_disable (&intel_dig_port->base, + pipe_config,NULL ); +} +static void intel_mst_pre_enable_dp (struct intel_encoder *encoder,const struct intel_crtc_state *pipe_config,const struct drm_connector_state *conn_state)@@ -549,6 +563,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum intel_encoder->disable = intel_mst_disable_dp; intel_encoder->post_disable = intel_mst_post_disable_dp; intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; + intel_encoder->post_pll_disable = intel_mst_post_pll_disable_dp; intel_encoder->pre_enable = intel_mst_pre_enable_dp; intel_encoder->enable = intel_mst_enable_dp; intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state;Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915: Release DDI power well references in MST ports
In reply to José Roberto de SouzaQuoted 7 lines · José Roberto de Souza
MST ports did not had the
post_pll_disable()hook causing the references get inpre_pll_enable()never being released causing DDI and AUX CH being enabled all the times.Cc Imre Deak <[email protected]>Cc Manasi Navare <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>
Err, thanks for catching it. We really need more testing on MST.. You could also add the Fixes: line.
Quoted 9 lines
--- drivers/gpu/drm/i915/intel_dp_mst.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/gpu/drm/i915/intel_dp_mst.c +0
-0
drivers/gpu/drm/i915/intel_dp_mst.c static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, · line 221
Quoted 7 lines
drivers/gpu/drm/i915/intel_dp_mst.c +4
-0@@ -215,6 +215,20 @@ static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, pipe_config, NULL); } +static void intel_mst_post_pll_disable_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config, +const struct drm_connector_state *conn_state) +{
Nit: these are better called old_crtc_state, old_conn_state.
drivers/gpu/drm/i915/intel_dp_mst.c static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, · line 227
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp_mst.c +6
-0+struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base); +struct intel_digital_port *intel_dig_port = intel_mst->primary; +struct intel_dp *intel_dp = &intel_dig_port->dp; + +if (intel_dp->active_mst_links ==0 && + intel_dig_port->base.post_pll_disable)
Since by now all DDI platforms (which are the only platforms supporting MST) define the .pre_pll_enable() .post_pll_disable() hooks you could remove the NULL check for them (in a follow-up patch).
Either with or without changing the above nit:
Quoted 18 lines
drivers/gpu/drm/i915/intel_dp_mst.c +5
-0+ intel_dig_port->base.post_pll_disable (&intel_dig_port->base, + pipe_config,NULL ); +} +static void intel_mst_pre_enable_dp (struct intel_encoder *encoder,const struct intel_crtc_state *pipe_config,const struct drm_connector_state *conn_state)@@ -549,6 +563,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum intel_encoder->disable = intel_mst_disable_dp; intel_encoder->post_disable = intel_mst_post_disable_dp; intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; + intel_encoder->post_pll_disable = intel_mst_post_pll_disable_dp; intel_encoder->pre_enable = intel_mst_pre_enable_dp; intel_encoder->enable = intel_mst_enable_dp; intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state;Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915: Release DDI power well references in MST ports
In reply to José Roberto de SouzaQuoted 7 lines · José Roberto de Souza
MST ports did not had the
post_pll_disable()hook causing the references get inpre_pll_enable()never being released causing DDI and AUX CH being enabled all the times.Cc Imre Deak <[email protected]>Cc Manasi Navare <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>
Could you resend this and the first patch separately?
Thanks,
Imre
Quoted 40 lines
--- drivers/gpu/drm/i915/intel_dp_mst.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/gpu/drm/i915/intel_dp_mst.c +15
-0@@ -215,6 +215,20 @@ static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, pipe_config, NULL); } +static void intel_mst_post_pll_disable_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config, +const struct drm_connector_state *conn_state) +{ +struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base); +struct intel_digital_port *intel_dig_port = intel_mst->primary; +struct intel_dp *intel_dp = &intel_dig_port->dp; + +if (intel_dp->active_mst_links ==0 && + intel_dig_port->base.post_pll_disable) + intel_dig_port->base.post_pll_disable (&intel_dig_port->base, + pipe_config,NULL ); +} +static void intel_mst_pre_enable_dp (struct intel_encoder *encoder,const struct intel_crtc_state *pipe_config,const struct drm_connector_state *conn_state)@@ -549,6 +563,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum intel_encoder->disable = intel_mst_disable_dp; intel_encoder->post_disable = intel_mst_post_disable_dp; intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; + intel_encoder->post_pll_disable = intel_mst_post_pll_disable_dp; intel_encoder->pre_enable = intel_mst_pre_enable_dp; intel_encoder->enable = intel_mst_enable_dp; intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state;Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915/icl: Only grab TC ports when using it
In reply to José Roberto de SouzaWhen suspending or unloading the driver, it needs to release the TC ports so HW can change it state without wait for driver handshake. Spec also state that if the port is not used by driver it should release TC access, so here only grabbing control of the TC ports and marking as unsafe when aux power is needed as have aux power well is a requirement to have DDI enabled in TC ports, the pre_pll_enable and post_pll_disable hooks takes care of getting and releasing it.
BSpec: 21750
--- drivers/gpu/drm/i915/intel_dp.c | 28 ------------- drivers/gpu/drm/i915/intel_runtime_pm.c | 55 ++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -28
@@ -5013,16 +5013,6 @@ static bool icl_tc_phy_connect(struct drm_i915_private *dev_priv,return false; } -/* -* This function may be called many times in a row without an HPD event -* in between, so try to avoid the write when we can. -*/ - val =I915_READ (PORT_TX_DFLEXDPCSSS ); -if (!(val &DP_PHY_MODE_STATUS_NOT_SAFE (tc_port))) { - val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } -/* * Now we have to re-check the live state, in case the port recently * became disconnected. Not necessary for legacy mode.
@@ -5044,24 +5034,6 @@ static bool icl_tc_phy_connect(struct drm_i915_private *dev_priv,static void icl_tc_phy_disconnect (struct drm_i915_private *dev_priv,struct intel_digital_port *dig_port) { -enum tc_port tc_port =intel_port_to_tc (dev_priv, dig_port->base.port); - -if (dig_port->tc_type ==TC_PORT_UNKNOWN ) -return ; - -/* -* TBT disconnection flow is read the live status, what was done in -* caller. -*/ -if (dig_port->tc_type ==TC_PORT_TYPEC || - dig_port->tc_type ==TC_PORT_LEGACY ) { -u32 val; - - val =I915_READ (PORT_TX_DFLEXDPCSSS ); - val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } - dig_port->tc_type =TC_PORT_UNKNOWN ; }
drivers/gpu/drm/i915/intel_runtime_pm.c +54 -1
79 lines not on this page · raw message
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/4] drm/i915/icl: Only grab TC ports when using it
Quoted 8 lines · José Roberto de Souza
When suspending or unloading the driver, it needs to release the TC ports so HW can change it state without wait for driver handshake. Spec also state that if the port is not used by driver it should release TC access, so here only grabbing control of the TC ports and marking as unsafe when aux power is needed as have aux power well is a requirement to have DDI enabled in TC ports, the
pre_pll_enableandpost_pll_disablehooks takes care of getting and releasing it.
Quoted 5 lines
BSpec: 21750
Cc Imre Deak <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>
Agreed that we should force a manual disconnect before entering low-power states and driver unloading, but I don't think this should be done from the power well code. We could perform multiple AUX transfers after a connect event around each of which we would enable/disable the AUX power well. We would then likely continue doing a modeset. During this whole sequence I don't think we should do forced connects/disconnects due to the AUX power well getting enabled/disabled.
I think normally we should change the connection status (that is the safe/unsafe mode you're setting here) in response to HPD events, also considering that we may have to delay changing the state as discussed earlier with Ville (due to an ongoing AUX transfer or active mode in the opposite TypeC mode). Then only during system/runtime suspend and unload should we do a forced disconnect, which would be safe since at those points we don't have any pending AUX transfers or active outputs.
--Imre
Quoted 141 lines
--- drivers/gpu/drm/i915/intel_dp.c | 28 ------------- drivers/gpu/drm/i915/intel_runtime_pm.c | 55 ++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 29 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-28@@ -5013,16 +5013,6 @@ static bool icl_tc_phy_connect(struct drm_i915_private *dev_priv,return false; } -/* -* This function may be called many times in a row without an HPD event -* in between, so try to avoid the write when we can. -*/ - val =I915_READ (PORT_TX_DFLEXDPCSSS ); -if (!(val &DP_PHY_MODE_STATUS_NOT_SAFE (tc_port))) { - val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } -/* * Now we have to re-check the live state, in case the port recently * became disconnected. Not necessary for legacy mode. @@ -5044,24 +5034,6 @@ static bool icl_tc_phy_connect(struct drm_i915_private *dev_priv,static void icl_tc_phy_disconnect (struct drm_i915_private *dev_priv,struct intel_digital_port *dig_port) { -enum tc_port tc_port =intel_port_to_tc (dev_priv, dig_port->base.port); - -if (dig_port->tc_type ==TC_PORT_UNKNOWN ) -return ; - -/* -* TBT disconnection flow is read the live status, what was done in -* caller. -*/ -if (dig_port->tc_type ==TC_PORT_TYPEC || - dig_port->tc_type ==TC_PORT_LEGACY ) { -u32 val; - - val =I915_READ (PORT_TX_DFLEXDPCSSS ); - val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } - dig_port->tc_type =TC_PORT_UNKNOWN ; }drivers/gpu/drm/i915/intel_runtime_pm.c +54
-1@@ -465,6 +465,48 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,hsw_wait_for_power_well_disable (dev_priv, power_well); } +static void icl_tc_grab_control (struct drm_i915_private *dev_priv, +enum aux_ch aux_ch,bool grab) +{ +struct drm_device *dev = &dev_priv->drm; +struct drm_connector_list_iter conn_iter; +struct drm_connector *connector; + +drm_connector_list_iter_begin (dev, &conn_iter); +drm_for_each_connector_iter (connector, &conn_iter) { +struct intel_connector *intel_connector; +struct intel_encoder *intel_encoder; +struct intel_digital_port *dig_port; +enum tc_port tc_port; + + intel_connector =to_intel_connector (connector); +if (!intel_connector->encoder) +continue ; + intel_encoder = intel_connector->encoder; + dig_port =enc_to_dig_port (&intel_encoder->base); + +if (!dig_port || dig_port->aux_ch != aux_ch) +continue ; + + tc_port =intel_port_to_tc (dev_priv, dig_port->base.port); + +if (dig_port->tc_type ==TC_PORT_TYPEC || + dig_port->tc_type ==TC_PORT_LEGACY ) { +u32 val; + + val =I915_READ (PORT_TX_DFLEXDPCSSS ); +if (grab) + val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); +else + val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); +I915_WRITE (PORT_TX_DFLEXDPCSSS , val); + } + +break ; + } +drm_connector_list_iter_end (&conn_iter); +} +#define ICL_AUX_PW_TO_CH (pw_idx) \ ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)@@ -475,6 +517,8 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,enum aux_ch aux_ch =ICL_AUX_PW_TO_CH (power_well->desc->hsw.idx);u32 val; +icl_tc_grab_control (dev_priv, aux_ch, true); + val =I915_READ (DP_AUX_CH_CTL (aux_ch)); val &= ~DP_AUX_CH_CTL_TBT_IO ;if (power_well->desc->hsw.is_tc_tbt)@@ -484,6 +528,15 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,hsw_power_well_enable (dev_priv, power_well); } +static void icl_tc_phy_aux_power_well_disable (struct drm_i915_private *dev_priv, +struct i915_power_well *power_well) +{ +enum aux_ch aux_ch =ICL_AUX_PW_TO_CH (power_well->desc->hsw.idx); + +icl_tc_grab_control (dev_priv, aux_ch, false); +hsw_power_well_disable (dev_priv, power_well); +} +/* * We should only use the power well if we explicitly asked the hardware to * enable it, so check if it's enabled and also check if we've requested it to @@ -2754,7 +2807,7 @@ static const struct i915_power_well_ops icl_combo_phy_aux_power_well_ops = {static const struct i915_power_well_ops icl_tc_phy_aux_power_well_ops = { .sync_hw = hsw_power_well_sync_hw, .enable = icl_tc_phy_aux_power_well_enable, - .disable = hsw_power_well_disable, + .disable = icl_tc_phy_aux_power_well_disable, .is_enabled = hsw_power_well_enabled, };Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/4] drm/i915/icl: Only grab TC ports when using it
Quoted 32 lines · Imre Deak
Quoted 12 lines · José Roberto de Souza
When suspending or unloading the driver, it needs to release the TC ports so HW can change it state without wait for driver handshake.
Spec also state that if the port is not used by driver it should release TC access, so here only grabbing control of the TC ports and
marking as unsafe when aux power is needed as have aux power well is
a requirement to have DDI enabled in TC ports, thepre_pll_enableandpost_pll_disablehooks takes care of getting and releasing it.Quoted 5 lines
BSpec: 21750
Cc Imre Deak <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>Agreed that we should force a manual disconnect before entering low-power states and driver unloading, but I don't think this should be
done from the power well code. We could perform multiple AUX transfers
after a connect event around each of which we would enable/disable the
AUX power well. We would then likely continue doing a modeset. During this whole sequence I don't think we should do forced connects/disconnects due to the AUX power well getting enabled/disabled.
Quoted 5 lines
I think normally we should change the connection status (that is the safe/unsafe mode you're setting here) in response to HPD events, also considering that we may have to delay changing the state as discussed earlier with Ville (due to an ongoing AUX transfer or active mode in the
What do you think about use power_well->count to delay when type- c/legacy is disconnected?
Then when the last reference is taken icl_tc_phy_aux_power_well_disable() check if the TC live status is disconnected and mark as unsafe.
Quoted 169 lines
opposite TypeC mode). Then only during system/runtime suspend and unload
should we do a forced disconnect, which would be safe since at those points we don't have any pending AUX transfers or active outputs.--Imre
Quoted 162 lines
--- drivers/gpu/drm/i915/intel_dp.c | 28 ------------- drivers/gpu/drm/i915/intel_runtime_pm.c | 55 ++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 29 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-2@@ -5013,16 +5013,6 @@ static bool icl_tc_phy_connect(structdrm_i915_private *dev_priv, return false; } -/* -* This function may be called many times in a row without an HPD event
drivers/gpu/drm/i915/intel_dp.c +0
-8-* in between, so try to avoid the write when we can. -*/ - val =I915_READ (PORT_TX_DFLEXDPCSSS ); -if (!(val &DP_PHY_MODE_STATUS_NOT_SAFE (tc_port))) { - val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } -/* * Now we have to re-check the live state, in case the port recently
drivers/gpu/drm/i915/intel_dp.c +0
-7* became disconnected. Not necessary for legacy mode. @@ -5044,24 +5034,6 @@ static bool icl_tc_phy_connect(structdrm_i915_private *dev_priv, static void icl_tc_phy_disconnect(struct drm_i915_private *dev_priv, struct intel_digital_port *dig_port) { - enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port- >base.port); - -if (dig_port->tc_type ==TC_PORT_UNKNOWN ) -return ; - -/* -* TBT disconnection flow is read the live status, what was done in
drivers/gpu/drm/i915/intel_dp.c +0
-11-* caller. -*/ -if (dig_port->tc_type ==TC_PORT_TYPEC || - dig_port->tc_type ==TC_PORT_LEGACY ) { -u32 val; - - val =I915_READ (PORT_TX_DFLEXDPCSSS ); - val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } - dig_port->tc_type =TC_PORT_UNKNOWN ; }drivers/gpu/drm/i915/intel_runtime_pm.c +34
-0@@ -465,6 +465,48 @@ icl_combo_phy_aux_power_well_disable(structdrm_i915_private *dev_priv,hsw_wait_for_power_well_disable (dev_priv ,power_well ); } +static void icl_tc_grab_control (struct drm_i915_private *dev_priv, +enum aux_ch aux_ch,bool grab) +{ +struct drm_device *dev = &dev_priv->drm; +struct drm_connector_list_iter conn_iter; +struct drm_connector *connector; + +drm_connector_list_iter_begin (dev, &conn_iter); +drm_for_each_connector_iter (connector, &conn_iter) { +struct intel_connector *intel_connector; +struct intel_encoder *intel_encoder; +struct intel_digital_port *dig_port; +enum tc_port tc_port; + + intel_connector =to_intel_connector (connector); +if (!intel_connector->encoder) +continue ; + intel_encoder = intel_connector->encoder; + dig_port =enc_to_dig_port (&intel_encoder->base); + +if (!dig_port || dig_port->aux_ch != aux_ch) +continue ; + + tc_port =intel_port_to_tc (dev_priv, dig_port- >base.port); + +if (dig_port->tc_type ==TC_PORT_TYPEC || + dig_port->tc_type ==TC_PORT_LEGACY ) { +u32 val; + + val =I915_READ (PORT_TX_DFLEXDPCSSS ); +if (grab) + val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); +else + val &=~DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
drivers/gpu/drm/i915/intel_runtime_pm.c +10
-0+I915_WRITE (PORT_TX_DFLEXDPCSSS , val); + } + +break ; + } +drm_connector_list_iter_end (&conn_iter); +} +#define ICL_AUX_PW_TO_CH (pw_idx) \ ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)@@ -475,6 +517,8 @@ icl_tc_phy_aux_power_well_enable(structdrm_i915_private *dev_priv, enum aux_ch aux_ch = ICL_AUX_PW_TO_CH(power_well->desc- >hsw.idx);u32 val; +icl_tc_grab_control (dev_priv, aux_ch, true); + val =I915_READ (DP_AUX_CH_CTL (aux_ch));drivers/gpu/drm/i915/intel_runtime_pm.c +4
-0val &= ~DP_AUX_CH_CTL_TBT_IO ;if (power_well->desc->hsw.is_tc_tbt)@@ -484,6 +528,15 @@ icl_tc_phy_aux_power_well_enable(structdrm_i915_private *dev_priv,hsw_power_well_enable (dev_priv ,power_well ); } +static void icl_tc_phy_aux_power_well_disable (struct drm_i915_private *dev_priv, +struct i915_power_well *power_well) +{ + enum aux_ch aux_ch = ICL_AUX_PW_TO_CH(power_well->desc-Quoted 1 line
hsw.idx);
drivers/gpu/drm/i915/intel_runtime_pm.c +5
-0+ +icl_tc_grab_control (dev_priv, aux_ch, false); +hsw_power_well_disable (dev_priv, power_well); +} +/* * We should only use the power well if we explicitly asked the hardware to
* enable it, so check if it's enabled and also check if we've
requested it todrivers/gpu/drm/i915/intel_runtime_pm.c +1
-1@@ -2754,7 +2807,7 @@ static const struct i915_power_well_ops icl_combo_phy_aux_power_well_ops = {static const struct i915_power_well_ops icl_tc_phy_aux_power_well_ops = { .sync_hw = hsw_power_well_sync_hw, .enable = icl_tc_phy_aux_power_well_enable, - .disable = hsw_power_well_disable, + .disable = icl_tc_phy_aux_power_well_disable, .is_enabled = hsw_power_well_enabled,};
Quoted 3 lines
Quoted 3 lines
Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/4] drm/i915/icl: Only grab TC ports when using it
Quoted 39 lines · Jose
Quoted 32 lines · Imre Deak
Quoted 12 lines · José Roberto de Souza
When suspending or unloading the driver, it needs to release the TC ports so HW can change it state without wait for driver handshake.
Spec also state that if the port is not used by driver it should release TC access, so here only grabbing control of the TC ports and
marking as unsafe when aux power is needed as have aux power well is
a requirement to have DDI enabled in TC ports, thepre_pll_enableandpost_pll_disablehooks takes care of getting and releasing it.Quoted 5 lines
BSpec: 21750
Cc Imre Deak <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>Agreed that we should force a manual disconnect before entering low-power states and driver unloading, but I don't think this should be
done from the power well code. We could perform multiple AUX transfers
after a connect event around each of which we would enable/disable the
AUX power well. We would then likely continue doing a modeset. During this whole sequence I don't think we should do forced connects/disconnects due to the AUX power well getting enabled/disabled.Quoted 5 lines
I think normally we should change the connection status (that is the safe/unsafe mode you're setting here) in response to HPD events, also considering that we may have to delay changing the state as discussed earlier with Ville (due to an ongoing AUX transfer or active mode in the
Quoted 4 lines
What do you think about use
power_well->countto delay when type- c/legacy is disconnected? Then when the last reference is takenicl_tc_phy_aux_power_well_disable()check if the TC live status is disconnected and mark as unsafe.
^mark as safe if I read the spec correctly, whatever that means.
I think this should be done from the suspend/unload handlers. At those places we should put the controller into safe state regardless of the live status.
Quoted 169 lines
Quoted 169 lines
opposite TypeC mode). Then only during system/runtime suspend and unload
should we do a forced disconnect, which would be safe since at those points we don't have any pending AUX transfers or active outputs.--Imre
Quoted 162 lines
--- drivers/gpu/drm/i915/intel_dp.c | 28 ------------- drivers/gpu/drm/i915/intel_runtime_pm.c | 55 ++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 29 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-2@@ -5013,16 +5013,6 @@ static bool icl_tc_phy_connect(structdrm_i915_private *dev_priv, return false; } -/* -* This function may be called many times in a row without an HPD event
drivers/gpu/drm/i915/intel_dp.c +0
-8-* in between, so try to avoid the write when we can. -*/ - val =I915_READ (PORT_TX_DFLEXDPCSSS ); -if (!(val &DP_PHY_MODE_STATUS_NOT_SAFE (tc_port))) { - val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } -/* * Now we have to re-check the live state, in case the port recently
drivers/gpu/drm/i915/intel_dp.c +0
-7* became disconnected. Not necessary for legacy mode. @@ -5044,24 +5034,6 @@ static bool icl_tc_phy_connect(structdrm_i915_private *dev_priv, static void icl_tc_phy_disconnect(struct drm_i915_private *dev_priv, struct intel_digital_port *dig_port) { - enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port- >base.port); - -if (dig_port->tc_type ==TC_PORT_UNKNOWN ) -return ; - -/* -* TBT disconnection flow is read the live status, what was done in
drivers/gpu/drm/i915/intel_dp.c +0
-11-* caller. -*/ -if (dig_port->tc_type ==TC_PORT_TYPEC || - dig_port->tc_type ==TC_PORT_LEGACY ) { -u32 val; - - val =I915_READ (PORT_TX_DFLEXDPCSSS ); - val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); -I915_WRITE (PORT_TX_DFLEXDPCSSS , val); - } - dig_port->tc_type =TC_PORT_UNKNOWN ; }drivers/gpu/drm/i915/intel_runtime_pm.c +34
-0@@ -465,6 +465,48 @@ icl_combo_phy_aux_power_well_disable(structdrm_i915_private *dev_priv,hsw_wait_for_power_well_disable (dev_priv ,power_well ); } +static void icl_tc_grab_control (struct drm_i915_private *dev_priv, +enum aux_ch aux_ch,bool grab) +{ +struct drm_device *dev = &dev_priv->drm; +struct drm_connector_list_iter conn_iter; +struct drm_connector *connector; + +drm_connector_list_iter_begin (dev, &conn_iter); +drm_for_each_connector_iter (connector, &conn_iter) { +struct intel_connector *intel_connector; +struct intel_encoder *intel_encoder; +struct intel_digital_port *dig_port; +enum tc_port tc_port; + + intel_connector =to_intel_connector (connector); +if (!intel_connector->encoder) +continue ; + intel_encoder = intel_connector->encoder; + dig_port =enc_to_dig_port (&intel_encoder->base); + +if (!dig_port || dig_port->aux_ch != aux_ch) +continue ; + + tc_port =intel_port_to_tc (dev_priv, dig_port- >base.port); + +if (dig_port->tc_type ==TC_PORT_TYPEC || + dig_port->tc_type ==TC_PORT_LEGACY ) { +u32 val; + + val =I915_READ (PORT_TX_DFLEXDPCSSS ); +if (grab) + val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); +else + val &=~DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
drivers/gpu/drm/i915/intel_runtime_pm.c +10
-0+I915_WRITE (PORT_TX_DFLEXDPCSSS , val); + } + +break ; + } +drm_connector_list_iter_end (&conn_iter); +} +#define ICL_AUX_PW_TO_CH (pw_idx) \ ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)@@ -475,6 +517,8 @@ icl_tc_phy_aux_power_well_enable(structdrm_i915_private *dev_priv, enum aux_ch aux_ch = ICL_AUX_PW_TO_CH(power_well->desc- >hsw.idx);u32 val; +icl_tc_grab_control (dev_priv, aux_ch, true); + val =I915_READ (DP_AUX_CH_CTL (aux_ch));drivers/gpu/drm/i915/intel_runtime_pm.c +4
-0val &= ~DP_AUX_CH_CTL_TBT_IO ;if (power_well->desc->hsw.is_tc_tbt)@@ -484,6 +528,15 @@ icl_tc_phy_aux_power_well_enable(structdrm_i915_private *dev_priv,hsw_power_well_enable (dev_priv ,power_well ); } +static void icl_tc_phy_aux_power_well_disable (struct drm_i915_private *dev_priv, +struct i915_power_well *power_well) +{ + enum aux_ch aux_ch = ICL_AUX_PW_TO_CH(power_well->desc-Quoted 1 line
hsw.idx);
drivers/gpu/drm/i915/intel_runtime_pm.c +5
-0+ +icl_tc_grab_control (dev_priv, aux_ch, false); +hsw_power_well_disable (dev_priv, power_well); +} +/* * We should only use the power well if we explicitly asked the hardware to
* enable it, so check if it's enabled and also check if we've
requested it todrivers/gpu/drm/i915/intel_runtime_pm.c +1
-1@@ -2754,7 +2807,7 @@ static const struct i915_power_well_ops icl_combo_phy_aux_power_well_ops = {static const struct i915_power_well_ops icl_tc_phy_aux_power_well_ops = { .sync_hw = hsw_power_well_sync_hw, .enable = icl_tc_phy_aux_power_well_enable, - .disable = hsw_power_well_disable, + .disable = icl_tc_phy_aux_power_well_disable, .is_enabled = hsw_power_well_enabled,};
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915/icl: Delay hotplug processing for tc ports
In reply to José Roberto de SouzaSome USB type-C dongles requires some time to power on before being able to process aux channel transactions.
It was not a problem for older gens because there was a bridge between DP port and USB-C controller adding some delay but ICL handles type-C native.
So here trying to do a aux channel transaction at each 150ms for up 5 times, before giving up.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_dp.c | 7 +++ drivers/gpu/drm/i915/intel_drv.h | 6 ++- drivers/gpu/drm/i915/intel_hotplug.c | 76 ++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2789,6 +2789,7 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv, enum port port);bool intel_hpd_disable (struct drm_i915_private *dev_priv,enum hpd_pin pin);void intel_hpd_enable (struct drm_i915_private *dev_priv,enum hpd_pin pin); +void intel_hotplug_tc_wa_work (struct work_struct *__work);/* i915_irq.c */ static inline void i915_queue_hangcheck (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/intel_dp.c +7 -0
@@ -5379,6 +5379,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder) {struct intel_digital_port *intel_dig_port =enc_to_dig_port (encoder);struct intel_dp *intel_dp = &intel_dig_port->dp; +struct drm_i915_private *dev_priv =dp_to_i915 (intel_dp);intel_dp_mst_encoder_cleanup (intel_dig_port);if (intel_dp_is_edp (intel_dp)) {
@@ -5395,6 +5396,8 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)unregister_reboot_notifier (&intel_dp->edp_notifier); intel_dp->edp_notifier.notifier_call =NULL ; } + }else if (IS_ICELAKE (dev_priv)) { +cancel_delayed_work_sync (&intel_dp->tc_wa_work); }intel_dp_aux_fini (intel_dp);
@@ -6758,6 +6761,10 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,I915_WRITE (PEG_BAND_GAP_DATA , (temp & ~0xf ) |0xd ); } +if (IS_ICELAKE (dev_priv) && !intel_dp_is_edp (intel_dp)) +INIT_DELAYED_WORK (&intel_dp->tc_wa_work, + intel_hotplug_tc_wa_work); +return true; fail:
drivers/gpu/drm/i915/intel_drv.h +5 -1
@@ -1137,7 +1137,11 @@ struct intel_dp {int panel_power_cycle_delay;int backlight_on_delay;int backlight_off_delay; -struct delayed_work panel_vdd_work; +union { +struct delayed_work panel_vdd_work; +struct delayed_work tc_wa_work; + }; +u8 tc_wa_count;bool want_panel_vdd;unsigned long last_power_on;unsigned long last_backlight_off;
drivers/gpu/drm/i915/intel_hotplug.c +76 -0
91 lines not on this page · raw message
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915: Reuse the aux_domain cached
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Reuse the aux_domain cached
URL : https://patchwork.freedesktop.org/series/51983/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm/i915: Reuse the aux_domain cached Okay!
Commit: drm/i915: Release DDI power well references in MST ports Okay!
Commit: drm/i915/icl: Only grab TC ports when using it Okay!
Commit: drm/i915/icl: Delay hotplug processing for tc ports -drivers/gpu/drm/i915/selftests/../i915_drv.h:3705:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_drv.h:3706:16: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [1/4] drm/i915: Reuse the aux_domain cached
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Reuse the aux_domain cached
URL : https://patchwork.freedesktop.org/series/51983/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_5081 -> Patchwork_10717 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_10717 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10717, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/51983/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10717:
=== IGT changes ===
==== Possible regressions ====
igt@drv_module_reload@basic-no-display:
fi-icl-u2: PASS -> DMESG-WARN +2
igt@drv_module_reload@basic-reload:
fi-icl-u: PASS -> DMESG-WARN +2== Known issues ==
Here are the changes found in Patchwork_10717 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_suspend@basic-s3:
fi-kbl-soraka: NOTRUN -> INCOMPLETE (fdo#107859, fdo#107774, fdo#107556)
igt@prime_vgem@basic-fence-flip:
fi-apl-guc: PASS -> FAIL (fdo#104008)
==== Possible fixes ====
igt@kms_flip@basic-flip-vs-modeset:
fi-skl-6700hq: DMESG-WARN (fdo#105998) -> PASS fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859
== Participating hosts (50 -> 45) ==
Additional (1): fi-kbl-soraka
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u
== Build changes ==
* Linux: CI_DRM_5081 -> Patchwork_10717
CI_DRM_5081: f5e16acf6c85d38756c3efdb77ec6aede55df0ba @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4705: 7983e19ed62ec8db1884f55e07e458a62cc51e37 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10717: 722af784c0a60ffb61cd71fd9fcbdba7bfcd1b48 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
722af784c0a6 drm/i915/icl: Delay hotplug processing for tc ports 9c011275643e drm/i915/icl: Only grab TC ports when using it 61201ac1c365 drm/i915: Release DDI power well references in MST ports d81abcdc9b49 drm/i915: Reuse the aux_domain cached
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10717/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 15 lines · José Roberto de Souza
intel_dp_detect()caches theaux_domainin the beginning of the function as it is used twice, so lets also use it as theaux_domaindon't change in runtime.Cc Imre Deak <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0
drivers/gpu/drm/i915/intel_dp.c intel_dp_detect(struct drm_connector *connector, · line 5292
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +1
-2@@ -5289,8 +5289,7 @@ intel_dp_detect(struct drm_connector *connector, ret =intel_dp_retrain_link (encoder, ctx);if (ret) { -intel_display_power_put (dev_priv, -intel_aux_power_domain (dig_port)); +intel_display_power_put (dev_priv, aux_domain);
Thanks for catching it.
status = ret; goto out_put_power;
and adding the label at the end would be cleaner. Either way:
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0return ret; } }Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx