aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-07-28 10:50:41 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-08-04 08:56:39 -0400
commitf64425a82bdb5c3d7e09ba765716da88a9b00eec (patch)
tree15f89e3a20a44c65e106363d638f6c945267fe82 /drivers/gpu/drm/i915
parent477321e0130c58f7fc3e41753ad95e934aaa7abc (diff)
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: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1469717448-4297-6-git-send-email-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c10
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c8
-rw-r--r--drivers/gpu/drm/i915/intel_dp_mst.c16
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h2
4 files changed, 26 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 0400825a9d2e..ac8700b4e6e2 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1641,6 +1641,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
1641 1641
1642 intel_ddi_init_dp_buf_reg(intel_encoder); 1642 intel_ddi_init_dp_buf_reg(intel_encoder);
1643 1643
1644 WARN_ON(intel_dp->active_streams != 0);
1645 intel_dp->active_streams++;
1646
1644 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); 1647 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
1645 intel_dp_start_link_train(intel_dp); 1648 intel_dp_start_link_train(intel_dp);
1646 if (port != PORT_A || INTEL_INFO(dev_priv)->gen >= 9) 1649 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 intel_psr_disable(intel_dp); 1770 intel_psr_disable(intel_dp);
1768 intel_edp_backlight_off(intel_dp); 1771 intel_edp_backlight_off(intel_dp);
1769 } 1772 }
1773
1774 if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
1775 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
1776
1777 intel_dp->active_streams--;
1778 WARN_ON(intel_dp->active_streams != 0);
1779 }
1770} 1780}
1771 1781
1772bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv, 1782bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b2458705de6e..38f20339ad10 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder)
2685 lane_mask); 2685 lane_mask);
2686 } 2686 }
2687 2687
2688 WARN_ON(intel_dp->active_streams != 0);
2689 intel_dp->active_streams++;
2690
2688 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); 2691 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
2689 intel_dp_start_link_train(intel_dp); 2692 intel_dp_start_link_train(intel_dp);
2690 intel_dp_stop_link_train(intel_dp); 2693 intel_dp_stop_link_train(intel_dp);
@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)
3344 3347
3345 DRM_DEBUG_KMS("\n"); 3348 DRM_DEBUG_KMS("\n");
3346 3349
3350 intel_dp->active_streams--;
3351 WARN_ON(intel_dp->active_streams != 0);
3352
3347 if ((IS_GEN7(dev) && port == PORT_A) || 3353 if ((IS_GEN7(dev) && port == PORT_A) ||
3348 (HAS_PCH_CPT(dev) && port != PORT_A)) { 3354 (HAS_PCH_CPT(dev) && port != PORT_A)) {
3349 DP &= ~DP_LINK_TRAIN_MASK_CPT; 3355 DP &= ~DP_LINK_TRAIN_MASK_CPT;
@@ -3833,7 +3839,7 @@ go_again:
3833 if (bret == true) { 3839 if (bret == true) {
3834 3840
3835 /* check link status - esi[10] = 0x200c */ 3841 /* check link status - esi[10] = 0x200c */
3836 if (intel_dp->active_mst_links && 3842 if (intel_dp->active_streams &&
3837 !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) { 3843 !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
3838 DRM_DEBUG_KMS("channel EQ not ok, retraining\n"); 3844 DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
3839 intel_dp_start_link_train(intel_dp); 3845 intel_dp_start_link_train(intel_dp);
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 629337dbca3d..0beca9197a1f 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)
99 struct intel_dp *intel_dp = &intel_dig_port->dp; 99 struct intel_dp *intel_dp = &intel_dig_port->dp;
100 int ret; 100 int ret;
101 101
102 DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); 102 DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
103 103
104 drm_dp_mst_reset_vcpi_slots(&intel_dp->mst_mgr, intel_mst->connector->port); 104 drm_dp_mst_reset_vcpi_slots(&intel_dp->mst_mgr, intel_mst->connector->port);
105 105
@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)
115 struct intel_digital_port *intel_dig_port = intel_mst->primary; 115 struct intel_digital_port *intel_dig_port = intel_mst->primary;
116 struct intel_dp *intel_dp = &intel_dig_port->dp; 116 struct intel_dp *intel_dp = &intel_dig_port->dp;
117 117
118 DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); 118 DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
119 119
120 /* this can fail */ 120 /* this can fail */
121 drm_dp_check_act_status(&intel_dp->mst_mgr); 121 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 124
125 drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, intel_mst->connector->port); 125 drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, intel_mst->connector->port);
126 126
127 intel_dp->active_mst_links--; 127 intel_dp->active_streams--;
128 128
129 intel_mst->connector = NULL; 129 intel_mst->connector = NULL;
130 if (intel_dp->active_mst_links == 0) { 130 if (intel_dp->active_streams == 0) {
131 intel_dig_port->base.post_disable(&intel_dig_port->base); 131 intel_dig_port->base.post_disable(&intel_dig_port->base);
132 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); 132 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
133 } 133 }
@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
165 */ 165 */
166 found->encoder = encoder; 166 found->encoder = encoder;
167 167
168 DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); 168 DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
169 169
170 intel_mst->connector = found; 170 intel_mst->connector = found;
171 171
172 if (intel_dp->active_mst_links == 0) { 172 if (intel_dp->active_streams == 0) {
173 intel_ddi_clk_select(&intel_dig_port->base, intel_crtc->config); 173 intel_ddi_clk_select(&intel_dig_port->base, intel_crtc->config);
174 174
175 intel_prepare_dp_ddi_buffers(&intel_dig_port->base); 175 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 } 193 }
194 194
195 195
196 intel_dp->active_mst_links++; 196 intel_dp->active_streams++;
197 temp = I915_READ(DP_TP_STATUS(port)); 197 temp = I915_READ(DP_TP_STATUS(port));
198 I915_WRITE(DP_TP_STATUS(port), temp); 198 I915_WRITE(DP_TP_STATUS(port), temp);
199 199
@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)
210 enum port port = intel_dig_port->port; 210 enum port port = intel_dig_port->port;
211 int ret; 211 int ret;
212 212
213 DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); 213 DRM_DEBUG_KMS("%d\n", intel_dp->active_streams);
214 214
215 if (intel_wait_for_register(dev_priv, 215 if (intel_wait_for_register(dev_priv,
216 DP_TP_STATUS(port), 216 DP_TP_STATUS(port),
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 55af7f088a4a..b846623a5a1f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -894,7 +894,7 @@ struct intel_dp {
894 894
895 bool can_mst; /* this port supports mst */ 895 bool can_mst; /* this port supports mst */
896 bool is_mst; 896 bool is_mst;
897 int active_mst_links; 897 int active_streams; /* number of active streams (for SST and MST both) */
898 /* connector directly attached - won't be use for modeset in mst world */ 898 /* connector directly attached - won't be use for modeset in mst world */
899 struct intel_connector *attached_connector; 899 struct intel_connector *attached_connector;
900 900