Commit f64425a8 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Track active streams also for DP SST

s/active_mst_links/active_streams/ and use it also for SST. We can then
use this information in the hpd handling to see if the link is active
or not, and thus whether we may need to retrain.

Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: Jim Bride <jim.bride@linux.intel.com>
Cc: Manasi D Navare <manasi.d.navare@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1469717448-4297-6-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 477321e0
...@@ -1641,6 +1641,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) ...@@ -1641,6 +1641,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
intel_ddi_init_dp_buf_reg(intel_encoder); intel_ddi_init_dp_buf_reg(intel_encoder);
WARN_ON(intel_dp->active_streams != 0);
intel_dp->active_streams++;
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
if (port != PORT_A || INTEL_INFO(dev_priv)->gen >= 9) if (port != PORT_A || INTEL_INFO(dev_priv)->gen >= 9)
...@@ -1767,6 +1770,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder) ...@@ -1767,6 +1770,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)
intel_psr_disable(intel_dp); intel_psr_disable(intel_dp);
intel_edp_backlight_off(intel_dp); intel_edp_backlight_off(intel_dp);
} }
if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
intel_dp->active_streams--;
WARN_ON(intel_dp->active_streams != 0);
}
} }
bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv, bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,
......
...@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) ...@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder)
lane_mask); lane_mask);
} }
WARN_ON(intel_dp->active_streams != 0);
intel_dp->active_streams++;
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
...@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp) ...@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("\n"); DRM_DEBUG_KMS("\n");
intel_dp->active_streams--;
WARN_ON(intel_dp->active_streams != 0);
if ((IS_GEN7(dev) && port == PORT_A) || if ((IS_GEN7(dev) && port == PORT_A) ||
(HAS_PCH_CPT(dev) && port != PORT_A)) { (HAS_PCH_CPT(dev) && port != PORT_A)) {
DP &= ~DP_LINK_TRAIN_MASK_CPT; DP &= ~DP_LINK_TRAIN_MASK_CPT;
...@@ -3833,7 +3839,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) ...@@ -3833,7 +3839,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
if (bret == true) { if (bret == true) {
/* check link status - esi[10] = 0x200c */ /* check link status - esi[10] = 0x200c */
if (intel_dp->active_mst_links && if (intel_dp->active_streams &&
!drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) { !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
DRM_DEBUG_KMS("channel EQ not ok, retraining\n"); DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
......
...@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder) ...@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)
struct intel_dp *intel_dp = &intel_dig_port->dp; struct intel_dp *intel_dp = &intel_dig_port->dp;
int ret; int ret;
DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
drm_dp_mst_reset_vcpi_slots(&intel_dp->mst_mgr, intel_mst->connector->port); drm_dp_mst_reset_vcpi_slots(&intel_dp->mst_mgr, intel_mst->connector->port);
...@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder) ...@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)
struct intel_digital_port *intel_dig_port = intel_mst->primary; struct intel_digital_port *intel_dig_port = intel_mst->primary;
struct intel_dp *intel_dp = &intel_dig_port->dp; struct intel_dp *intel_dp = &intel_dig_port->dp;
DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
/* this can fail */ /* this can fail */
drm_dp_check_act_status(&intel_dp->mst_mgr); drm_dp_check_act_status(&intel_dp->mst_mgr);
...@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder) ...@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)
drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, intel_mst->connector->port); drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, intel_mst->connector->port);
intel_dp->active_mst_links--; intel_dp->active_streams--;
intel_mst->connector = NULL; intel_mst->connector = NULL;
if (intel_dp->active_mst_links == 0) { if (intel_dp->active_streams == 0) {
intel_dig_port->base.post_disable(&intel_dig_port->base); intel_dig_port->base.post_disable(&intel_dig_port->base);
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
} }
...@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) ...@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
*/ */
found->encoder = encoder; found->encoder = encoder;
DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
intel_mst->connector = found; intel_mst->connector = found;
if (intel_dp->active_mst_links == 0) { if (intel_dp->active_streams == 0) {
intel_ddi_clk_select(&intel_dig_port->base, intel_crtc->config); intel_ddi_clk_select(&intel_dig_port->base, intel_crtc->config);
intel_prepare_dp_ddi_buffers(&intel_dig_port->base); intel_prepare_dp_ddi_buffers(&intel_dig_port->base);
...@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) ...@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
} }
intel_dp->active_mst_links++; intel_dp->active_streams++;
temp = I915_READ(DP_TP_STATUS(port)); temp = I915_READ(DP_TP_STATUS(port));
I915_WRITE(DP_TP_STATUS(port), temp); I915_WRITE(DP_TP_STATUS(port), temp);
...@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder) ...@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)
enum port port = intel_dig_port->port; enum port port = intel_dig_port->port;
int ret; int ret;
DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
if (intel_wait_for_register(dev_priv, if (intel_wait_for_register(dev_priv,
DP_TP_STATUS(port), DP_TP_STATUS(port),
......
...@@ -894,7 +894,7 @@ struct intel_dp { ...@@ -894,7 +894,7 @@ struct intel_dp {
bool can_mst; /* this port supports mst */ bool can_mst; /* this port supports mst */
bool is_mst; bool is_mst;
int active_mst_links; int active_streams; /* number of active streams (for SST and MST both) */
/* connector directly attached - won't be use for modeset in mst world */ /* connector directly attached - won't be use for modeset in mst world */
struct intel_connector *attached_connector; struct intel_connector *attached_connector;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment