aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-08-09 11:04:04 -0400
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-08-23 05:06:50 -0400
commitfd6bbda9c7a46bec6462878787335d2ac6294040 (patch)
treec717e51b7000f4c13477b8b1256ab66429a43657 /drivers
parentfb1c98b181ae139412eca6b7ef727b655b6125da (diff)
drm/i915: Pass crtc_state and connector_state to encoder functions
This is mostly code churn, with exception of a few places: - intel_display.c has changes in intel_sanitize_encoder - intel_ddi.c has intel_ddi_fdi_disable calling intel_ddi_post_disable, and required a function change. Also affects intel_display.c - intel_dp_mst.c passes a NULL crtc_state and conn_state to intel_ddi_post_disable for shutting down the real encoder. If we would pass conn_state, then conn_state->connector != intel_dig_port->connector and conn_state->best_encoder != to_intel_encoder(intel_dig_port). We also shouldn't pass crtc_state, because in that case the disabling sequence may potentially be different depending on which crtc is disabled last. Nice way to introduce bugs. No other functional changes are done, diff stat is already huge. Each encoder type will need to be fixed to use the atomic states separately. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470755054-32699-6-git-send-email-maarten.lankhorst@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c18
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c31
-rw-r--r--drivers/gpu/drm/i915/intel_display.c102
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c48
-rw-r--r--drivers/gpu/drm/i915/intel_dp_mst.c20
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h28
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c16
-rw-r--r--drivers/gpu/drm/i915/intel_dvo.c12
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c72
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c29
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c22
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c12
12 files changed, 284 insertions, 126 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 827b6ef4e9ae..6e6c4bde105a 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -193,21 +193,29 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
193 I915_WRITE(crt->adpa_reg, adpa); 193 I915_WRITE(crt->adpa_reg, adpa);
194} 194}
195 195
196static void intel_disable_crt(struct intel_encoder *encoder) 196static void intel_disable_crt(struct intel_encoder *encoder,
197 struct intel_crtc_state *old_crtc_state,
198 struct drm_connector_state *old_conn_state)
197{ 199{
198 intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF); 200 intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF);
199} 201}
200 202
201static void pch_disable_crt(struct intel_encoder *encoder) 203static void pch_disable_crt(struct intel_encoder *encoder,
204 struct intel_crtc_state *old_crtc_state,
205 struct drm_connector_state *old_conn_state)
202{ 206{
203} 207}
204 208
205static void pch_post_disable_crt(struct intel_encoder *encoder) 209static void pch_post_disable_crt(struct intel_encoder *encoder,
210 struct intel_crtc_state *old_crtc_state,
211 struct drm_connector_state *old_conn_state)
206{ 212{
207 intel_disable_crt(encoder); 213 intel_disable_crt(encoder, old_crtc_state, old_conn_state);
208} 214}
209 215
210static void intel_enable_crt(struct intel_encoder *encoder) 216static void intel_enable_crt(struct intel_encoder *encoder,
217 struct intel_crtc_state *pipe_config,
218 struct drm_connector_state *conn_state)
211{ 219{
212 intel_crt_set_dpms(encoder, DRM_MODE_DPMS_ON); 220 intel_crt_set_dpms(encoder, DRM_MODE_DPMS_ON);
213} 221}
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index c2df4e429b19..66feb1eafc93 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1611,7 +1611,9 @@ void intel_ddi_clk_select(struct intel_encoder *encoder,
1611 } 1611 }
1612} 1612}
1613 1613
1614static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) 1614static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder,
1615 struct intel_crtc_state *pipe_config,
1616 struct drm_connector_state *conn_state)
1615{ 1617{
1616 struct drm_encoder *encoder = &intel_encoder->base; 1618 struct drm_encoder *encoder = &intel_encoder->base;
1617 struct drm_i915_private *dev_priv = to_i915(encoder->dev); 1619 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
@@ -1663,7 +1665,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
1663 } 1665 }
1664} 1666}
1665 1667
1666static void intel_ddi_post_disable(struct intel_encoder *intel_encoder) 1668static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
1669 struct intel_crtc_state *old_crtc_state,
1670 struct drm_connector_state *old_conn_state)
1667{ 1671{
1668 struct drm_encoder *encoder = &intel_encoder->base; 1672 struct drm_encoder *encoder = &intel_encoder->base;
1669 struct drm_device *dev = encoder->dev; 1673 struct drm_device *dev = encoder->dev;
@@ -1673,6 +1677,8 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
1673 uint32_t val; 1677 uint32_t val;
1674 bool wait = false; 1678 bool wait = false;
1675 1679
1680 /* old_crtc_state and old_conn_state are NULL when called from DP_MST */
1681
1676 val = I915_READ(DDI_BUF_CTL(port)); 1682 val = I915_READ(DDI_BUF_CTL(port));
1677 if (val & DDI_BUF_CTL_ENABLE) { 1683 if (val & DDI_BUF_CTL_ENABLE) {
1678 val &= ~DDI_BUF_CTL_ENABLE; 1684 val &= ~DDI_BUF_CTL_ENABLE;
@@ -1708,7 +1714,9 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
1708 } 1714 }
1709} 1715}
1710 1716
1711static void intel_enable_ddi(struct intel_encoder *intel_encoder) 1717static void intel_enable_ddi(struct intel_encoder *intel_encoder,
1718 struct intel_crtc_state *pipe_config,
1719 struct drm_connector_state *conn_state)
1712{ 1720{
1713 struct drm_encoder *encoder = &intel_encoder->base; 1721 struct drm_encoder *encoder = &intel_encoder->base;
1714 struct drm_crtc *crtc = encoder->crtc; 1722 struct drm_crtc *crtc = encoder->crtc;
@@ -1746,7 +1754,9 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)
1746 } 1754 }
1747} 1755}
1748 1756
1749static void intel_disable_ddi(struct intel_encoder *intel_encoder) 1757static void intel_disable_ddi(struct intel_encoder *intel_encoder,
1758 struct intel_crtc_state *old_crtc_state,
1759 struct drm_connector_state *old_conn_state)
1750{ 1760{
1751 struct drm_encoder *encoder = &intel_encoder->base; 1761 struct drm_encoder *encoder = &intel_encoder->base;
1752 struct drm_crtc *crtc = encoder->crtc; 1762 struct drm_crtc *crtc = encoder->crtc;
@@ -2052,7 +2062,9 @@ bxt_ddi_phy_calc_lane_lat_optim_mask(struct intel_encoder *encoder,
2052 } 2062 }
2053} 2063}
2054 2064
2055static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder) 2065static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder,
2066 struct intel_crtc_state *pipe_config,
2067 struct drm_connector_state *conn_state)
2056{ 2068{
2057 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 2069 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
2058 struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev); 2070 struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
@@ -2141,10 +2153,11 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
2141 udelay(600); 2153 udelay(600);
2142} 2154}
2143 2155
2144void intel_ddi_fdi_disable(struct drm_crtc *crtc) 2156void intel_ddi_fdi_disable(struct intel_encoder *intel_encoder,
2157 struct intel_crtc_state *old_crtc_state,
2158 struct drm_connector_state *old_conn_state)
2145{ 2159{
2146 struct drm_i915_private *dev_priv = to_i915(crtc->dev); 2160 struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
2147 struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
2148 uint32_t val; 2161 uint32_t val;
2149 2162
2150 /* 2163 /*
@@ -2157,7 +2170,7 @@ void intel_ddi_fdi_disable(struct drm_crtc *crtc)
2157 val &= ~FDI_RX_ENABLE; 2170 val &= ~FDI_RX_ENABLE;
2158 I915_WRITE(FDI_RX_CTL(PIPE_A), val); 2171 I915_WRITE(FDI_RX_CTL(PIPE_A), val);
2159 2172
2160 intel_ddi_post_disable(intel_encoder); 2173 intel_ddi_post_disable(intel_encoder, old_crtc_state, old_conn_state);
2161 2174
2162 val = I915_READ(FDI_RX_MISC(PIPE_A)); 2175 val = I915_READ(FDI_RX_MISC(PIPE_A));
2163 val &= ~(FDI_RX_PWRDN_LANE1_MASK | FDI_RX_PWRDN_LANE0_MASK); 2176 val &= ~(FDI_RX_PWRDN_LANE1_MASK | FDI_RX_PWRDN_LANE0_MASK);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ed187e94b02d..554b3f69f4a5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5155,6 +5155,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_mask
5155} 5155}
5156 5156
5157static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc, 5157static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc,
5158 struct intel_crtc_state *crtc_state,
5158 struct drm_atomic_state *old_state) 5159 struct drm_atomic_state *old_state)
5159{ 5160{
5160 struct drm_connector_state *old_conn_state; 5161 struct drm_connector_state *old_conn_state;
@@ -5170,11 +5171,12 @@ static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc,
5170 continue; 5171 continue;
5171 5172
5172 if (encoder->pre_pll_enable) 5173 if (encoder->pre_pll_enable)
5173 encoder->pre_pll_enable(encoder); 5174 encoder->pre_pll_enable(encoder, crtc_state, conn_state);
5174 } 5175 }
5175} 5176}
5176 5177
5177static void intel_encoders_pre_enable(struct drm_crtc *crtc, 5178static void intel_encoders_pre_enable(struct drm_crtc *crtc,
5179 struct intel_crtc_state *crtc_state,
5178 struct drm_atomic_state *old_state) 5180 struct drm_atomic_state *old_state)
5179{ 5181{
5180 struct drm_connector_state *old_conn_state; 5182 struct drm_connector_state *old_conn_state;
@@ -5190,11 +5192,12 @@ static void intel_encoders_pre_enable(struct drm_crtc *crtc,
5190 continue; 5192 continue;
5191 5193
5192 if (encoder->pre_enable) 5194 if (encoder->pre_enable)
5193 encoder->pre_enable(encoder); 5195 encoder->pre_enable(encoder, crtc_state, conn_state);
5194 } 5196 }
5195} 5197}
5196 5198
5197static void intel_encoders_enable(struct drm_crtc *crtc, 5199static void intel_encoders_enable(struct drm_crtc *crtc,
5200 struct intel_crtc_state *crtc_state,
5198 struct drm_atomic_state *old_state) 5201 struct drm_atomic_state *old_state)
5199{ 5202{
5200 struct drm_connector_state *old_conn_state; 5203 struct drm_connector_state *old_conn_state;
@@ -5209,12 +5212,13 @@ static void intel_encoders_enable(struct drm_crtc *crtc,
5209 if (conn_state->crtc != crtc) 5212 if (conn_state->crtc != crtc)
5210 continue; 5213 continue;
5211 5214
5212 encoder->enable(encoder); 5215 encoder->enable(encoder, crtc_state, conn_state);
5213 intel_opregion_notify_encoder(encoder, true); 5216 intel_opregion_notify_encoder(encoder, true);
5214 } 5217 }
5215} 5218}
5216 5219
5217static void intel_encoders_disable(struct drm_crtc *crtc, 5220static void intel_encoders_disable(struct drm_crtc *crtc,
5221 struct intel_crtc_state *old_crtc_state,
5218 struct drm_atomic_state *old_state) 5222 struct drm_atomic_state *old_state)
5219{ 5223{
5220 struct drm_connector_state *old_conn_state; 5224 struct drm_connector_state *old_conn_state;
@@ -5229,11 +5233,12 @@ static void intel_encoders_disable(struct drm_crtc *crtc,
5229 continue; 5233 continue;
5230 5234
5231 intel_opregion_notify_encoder(encoder, false); 5235 intel_opregion_notify_encoder(encoder, false);
5232 encoder->disable(encoder); 5236 encoder->disable(encoder, old_crtc_state, old_conn_state);
5233 } 5237 }
5234} 5238}
5235 5239
5236static void intel_encoders_post_disable(struct drm_crtc *crtc, 5240static void intel_encoders_post_disable(struct drm_crtc *crtc,
5241 struct intel_crtc_state *old_crtc_state,
5237 struct drm_atomic_state *old_state) 5242 struct drm_atomic_state *old_state)
5238{ 5243{
5239 struct drm_connector_state *old_conn_state; 5244 struct drm_connector_state *old_conn_state;
@@ -5248,11 +5253,12 @@ static void intel_encoders_post_disable(struct drm_crtc *crtc,
5248 continue; 5253 continue;
5249 5254
5250 if (encoder->post_disable) 5255 if (encoder->post_disable)
5251 encoder->post_disable(encoder); 5256 encoder->post_disable(encoder, old_crtc_state, old_conn_state);
5252 } 5257 }
5253} 5258}
5254 5259
5255static void intel_encoders_post_pll_disable(struct drm_crtc *crtc, 5260static void intel_encoders_post_pll_disable(struct drm_crtc *crtc,
5261 struct intel_crtc_state *old_crtc_state,
5256 struct drm_atomic_state *old_state) 5262 struct drm_atomic_state *old_state)
5257{ 5263{
5258 struct drm_connector_state *old_conn_state; 5264 struct drm_connector_state *old_conn_state;
@@ -5267,7 +5273,7 @@ static void intel_encoders_post_pll_disable(struct drm_crtc *crtc,
5267 continue; 5273 continue;
5268 5274
5269 if (encoder->post_pll_disable) 5275 if (encoder->post_pll_disable)
5270 encoder->post_pll_disable(encoder); 5276 encoder->post_pll_disable(encoder, old_crtc_state, old_conn_state);
5271 } 5277 }
5272} 5278}
5273 5279
@@ -5316,7 +5322,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
5316 5322
5317 intel_crtc->active = true; 5323 intel_crtc->active = true;
5318 5324
5319 intel_encoders_pre_enable(crtc, old_state); 5325 intel_encoders_pre_enable(crtc, pipe_config, old_state);
5320 5326
5321 if (intel_crtc->config->has_pch_encoder) { 5327 if (intel_crtc->config->has_pch_encoder) {
5322 /* Note: FDI PLL enabling _must_ be done before we enable the 5328 /* Note: FDI PLL enabling _must_ be done before we enable the
@@ -5346,7 +5352,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
5346 assert_vblank_disabled(crtc); 5352 assert_vblank_disabled(crtc);
5347 drm_crtc_vblank_on(crtc); 5353 drm_crtc_vblank_on(crtc);
5348 5354
5349 intel_encoders_enable(crtc, old_state); 5355 intel_encoders_enable(crtc, pipe_config, old_state);
5350 5356
5351 if (HAS_PCH_CPT(dev)) 5357 if (HAS_PCH_CPT(dev))
5352 cpt_verify_modeset(dev, intel_crtc->pipe); 5358 cpt_verify_modeset(dev, intel_crtc->pipe);
@@ -5381,7 +5387,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
5381 intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, 5387 intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
5382 false); 5388 false);
5383 5389
5384 intel_encoders_pre_pll_enable(crtc, old_state); 5390 intel_encoders_pre_pll_enable(crtc, pipe_config, old_state);
5385 5391
5386 if (intel_crtc->config->shared_dpll) 5392 if (intel_crtc->config->shared_dpll)
5387 intel_enable_shared_dpll(intel_crtc); 5393 intel_enable_shared_dpll(intel_crtc);
@@ -5419,7 +5425,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
5419 else 5425 else
5420 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true); 5426 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
5421 5427
5422 intel_encoders_pre_enable(crtc, old_state); 5428 intel_encoders_pre_enable(crtc, pipe_config, old_state);
5423 5429
5424 if (intel_crtc->config->has_pch_encoder) 5430 if (intel_crtc->config->has_pch_encoder)
5425 dev_priv->display.fdi_link_train(crtc); 5431 dev_priv->display.fdi_link_train(crtc);
@@ -5460,7 +5466,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
5460 assert_vblank_disabled(crtc); 5466 assert_vblank_disabled(crtc);
5461 drm_crtc_vblank_on(crtc); 5467 drm_crtc_vblank_on(crtc);
5462 5468
5463 intel_encoders_enable(crtc, old_state); 5469 intel_encoders_enable(crtc, pipe_config, old_state);
5464 5470
5465 if (intel_crtc->config->has_pch_encoder) { 5471 if (intel_crtc->config->has_pch_encoder) {
5466 intel_wait_for_vblank(dev, pipe); 5472 intel_wait_for_vblank(dev, pipe);
@@ -5513,7 +5519,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,
5513 intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, false); 5519 intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, false);
5514 } 5520 }
5515 5521
5516 intel_encoders_disable(crtc, old_state); 5522 intel_encoders_disable(crtc, old_crtc_state, old_state);
5517 5523
5518 drm_crtc_vblank_off(crtc); 5524 drm_crtc_vblank_off(crtc);
5519 assert_vblank_disabled(crtc); 5525 assert_vblank_disabled(crtc);
@@ -5525,7 +5531,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,
5525 if (intel_crtc->config->has_pch_encoder) 5531 if (intel_crtc->config->has_pch_encoder)
5526 ironlake_fdi_disable(crtc); 5532 ironlake_fdi_disable(crtc);
5527 5533
5528 intel_encoders_post_disable(crtc, old_state); 5534 intel_encoders_post_disable(crtc, old_crtc_state, old_state);
5529 5535
5530 if (intel_crtc->config->has_pch_encoder) { 5536 if (intel_crtc->config->has_pch_encoder) {
5531 ironlake_disable_pch_transcoder(dev_priv, pipe); 5537 ironlake_disable_pch_transcoder(dev_priv, pipe);
@@ -5568,7 +5574,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
5568 intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, 5574 intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
5569 false); 5575 false);
5570 5576
5571 intel_encoders_disable(crtc, old_state); 5577 intel_encoders_disable(crtc, old_crtc_state, old_state);
5572 5578
5573 drm_crtc_vblank_off(crtc); 5579 drm_crtc_vblank_off(crtc);
5574 assert_vblank_disabled(crtc); 5580 assert_vblank_disabled(crtc);
@@ -5591,12 +5597,26 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
5591 if (!transcoder_is_dsi(cpu_transcoder)) 5597 if (!transcoder_is_dsi(cpu_transcoder))
5592 intel_ddi_disable_pipe_clock(intel_crtc); 5598 intel_ddi_disable_pipe_clock(intel_crtc);
5593 5599
5594 intel_encoders_post_disable(crtc, old_state); 5600 intel_encoders_post_disable(crtc, old_crtc_state, old_state);
5595 5601
5596 if (intel_crtc->config->has_pch_encoder) { 5602 if (intel_crtc->config->has_pch_encoder) {
5603 struct drm_connector_state *old_conn_state;
5604 struct drm_connector *conn;
5605 int i;
5606
5597 lpt_disable_pch_transcoder(dev_priv); 5607 lpt_disable_pch_transcoder(dev_priv);
5598 lpt_disable_iclkip(dev_priv); 5608 lpt_disable_iclkip(dev_priv);
5599 intel_ddi_fdi_disable(crtc); 5609
5610 for_each_connector_in_state(old_state, conn, old_conn_state, i)
5611 if (old_conn_state->crtc == crtc) {
5612 struct intel_encoder *encoder =
5613 to_intel_encoder(old_conn_state->best_encoder);
5614
5615 intel_ddi_fdi_disable(encoder,
5616 old_crtc_state,
5617 old_conn_state);
5618 break;
5619 }
5600 5620
5601 intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, 5621 intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
5602 true); 5622 true);
@@ -6687,7 +6707,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
6687 6707
6688 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true); 6708 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
6689 6709
6690 intel_encoders_pre_pll_enable(crtc, old_state); 6710 intel_encoders_pre_pll_enable(crtc, pipe_config, old_state);
6691 6711
6692 if (IS_CHERRYVIEW(dev)) { 6712 if (IS_CHERRYVIEW(dev)) {
6693 chv_prepare_pll(intel_crtc, intel_crtc->config); 6713 chv_prepare_pll(intel_crtc, intel_crtc->config);
@@ -6697,7 +6717,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
6697 vlv_enable_pll(intel_crtc, intel_crtc->config); 6717 vlv_enable_pll(intel_crtc, intel_crtc->config);
6698 } 6718 }
6699 6719
6700 intel_encoders_pre_enable(crtc, old_state); 6720 intel_encoders_pre_enable(crtc, pipe_config, old_state);
6701 6721
6702 i9xx_pfit_enable(intel_crtc); 6722 i9xx_pfit_enable(intel_crtc);
6703 6723
@@ -6709,7 +6729,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
6709 assert_vblank_disabled(crtc); 6729 assert_vblank_disabled(crtc);
6710 drm_crtc_vblank_on(crtc); 6730 drm_crtc_vblank_on(crtc);
6711 6731
6712 intel_encoders_enable(crtc, old_state); 6732 intel_encoders_enable(crtc, pipe_config, old_state);
6713} 6733}
6714 6734
6715static void i9xx_set_pll_dividers(struct intel_crtc *crtc) 6735static void i9xx_set_pll_dividers(struct intel_crtc *crtc)
@@ -6748,7 +6768,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,
6748 if (!IS_GEN2(dev)) 6768 if (!IS_GEN2(dev))
6749 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true); 6769 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
6750 6770
6751 intel_encoders_pre_enable(crtc, old_state); 6771 intel_encoders_pre_enable(crtc, pipe_config, old_state);
6752 6772
6753 i9xx_enable_pll(intel_crtc); 6773 i9xx_enable_pll(intel_crtc);
6754 6774
@@ -6762,7 +6782,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,
6762 assert_vblank_disabled(crtc); 6782 assert_vblank_disabled(crtc);
6763 drm_crtc_vblank_on(crtc); 6783 drm_crtc_vblank_on(crtc);
6764 6784
6765 intel_encoders_enable(crtc, old_state); 6785 intel_encoders_enable(crtc, pipe_config, old_state);
6766} 6786}
6767 6787
6768static void i9xx_pfit_disable(struct intel_crtc *crtc) 6788static void i9xx_pfit_disable(struct intel_crtc *crtc)
@@ -6796,7 +6816,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
6796 if (IS_GEN2(dev)) 6816 if (IS_GEN2(dev))
6797 intel_wait_for_vblank(dev, pipe); 6817 intel_wait_for_vblank(dev, pipe);
6798 6818
6799 intel_encoders_disable(crtc, old_state); 6819 intel_encoders_disable(crtc, old_crtc_state, old_state);
6800 6820
6801 drm_crtc_vblank_off(crtc); 6821 drm_crtc_vblank_off(crtc);
6802 assert_vblank_disabled(crtc); 6822 assert_vblank_disabled(crtc);
@@ -6805,7 +6825,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
6805 6825
6806 i9xx_pfit_disable(intel_crtc); 6826 i9xx_pfit_disable(intel_crtc);
6807 6827
6808 intel_encoders_post_disable(crtc, old_state); 6828 intel_encoders_post_disable(crtc, old_crtc_state, old_state);
6809 6829
6810 if (!intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI)) { 6830 if (!intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI)) {
6811 if (IS_CHERRYVIEW(dev)) 6831 if (IS_CHERRYVIEW(dev))
@@ -6816,7 +6836,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
6816 i9xx_disable_pll(intel_crtc); 6836 i9xx_disable_pll(intel_crtc);
6817 } 6837 }
6818 6838
6819 intel_encoders_post_pll_disable(crtc, old_state); 6839 intel_encoders_post_pll_disable(crtc, old_crtc_state, old_state);
6820 6840
6821 if (!IS_GEN2(dev)) 6841 if (!IS_GEN2(dev))
6822 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false); 6842 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
@@ -16386,17 +16406,6 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc)
16386 return false; 16406 return false;
16387} 16407}
16388 16408
16389static bool intel_encoder_has_connectors(struct intel_encoder *encoder)
16390{
16391 struct drm_device *dev = encoder->base.dev;
16392 struct intel_connector *connector;
16393
16394 for_each_connector_on_encoder(dev, &encoder->base, connector)
16395 return true;
16396
16397 return false;
16398}
16399
16400static bool has_pch_trancoder(struct drm_i915_private *dev_priv, 16409static bool has_pch_trancoder(struct drm_i915_private *dev_priv,
16401 enum transcoder pch_transcoder) 16410 enum transcoder pch_transcoder)
16402{ 16411{
@@ -16500,6 +16509,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
16500{ 16509{
16501 struct intel_connector *connector; 16510 struct intel_connector *connector;
16502 struct drm_device *dev = encoder->base.dev; 16511 struct drm_device *dev = encoder->base.dev;
16512 bool found_connector = false;
16503 16513
16504 /* We need to check both for a crtc link (meaning that the 16514 /* We need to check both for a crtc link (meaning that the
16505 * encoder is active and trying to read from a pipe) and the 16515 * encoder is active and trying to read from a pipe) and the
@@ -16507,7 +16517,12 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
16507 bool has_active_crtc = encoder->base.crtc && 16517 bool has_active_crtc = encoder->base.crtc &&
16508 to_intel_crtc(encoder->base.crtc)->active; 16518 to_intel_crtc(encoder->base.crtc)->active;
16509 16519
16510 if (intel_encoder_has_connectors(encoder) && !has_active_crtc) { 16520 for_each_connector_on_encoder(dev, &encoder->base, connector) {
16521 found_connector = true;
16522 break;
16523 }
16524
16525 if (found_connector && !has_active_crtc) {
16511 DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n", 16526 DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n",
16512 encoder->base.base.id, 16527 encoder->base.base.id,
16513 encoder->base.name); 16528 encoder->base.name);
@@ -16516,12 +16531,14 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
16516 * fallout from our resume register restoring. Disable 16531 * fallout from our resume register restoring. Disable
16517 * the encoder manually again. */ 16532 * the encoder manually again. */
16518 if (encoder->base.crtc) { 16533 if (encoder->base.crtc) {
16534 struct drm_crtc_state *crtc_state = encoder->base.crtc->state;
16535
16519 DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n", 16536 DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n",
16520 encoder->base.base.id, 16537 encoder->base.base.id,
16521 encoder->base.name); 16538 encoder->base.name);
16522 encoder->disable(encoder); 16539 encoder->disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
16523 if (encoder->post_disable) 16540 if (encoder->post_disable)
16524 encoder->post_disable(encoder); 16541 encoder->post_disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
16525 } 16542 }
16526 encoder->base.crtc = NULL; 16543 encoder->base.crtc = NULL;
16527 16544
@@ -16529,12 +16546,9 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
16529 * a bug in one of the get_hw_state functions. Or someplace else 16546 * a bug in one of the get_hw_state functions. Or someplace else
16530 * in our code, like the register restore mess on resume. Clamp 16547 * in our code, like the register restore mess on resume. Clamp
16531 * things to off as a safer default. */ 16548 * things to off as a safer default. */
16532 for_each_intel_connector(dev, connector) { 16549
16533 if (connector->encoder != encoder) 16550 connector->base.dpms = DRM_MODE_DPMS_OFF;
16534 continue; 16551 connector->base.encoder = NULL;
16535 connector->base.dpms = DRM_MODE_DPMS_OFF;
16536 connector->base.encoder = NULL;
16537 }
16538 } 16552 }
16539 /* Enabled encoders without active connectors will be fixed in 16553 /* Enabled encoders without active connectors will be fixed in
16540 * the crtc fixup. */ 16554 * the crtc fixup. */
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 364db908c191..30cbc7e2887f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2473,7 +2473,9 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
2473 } 2473 }
2474} 2474}
2475 2475
2476static void intel_disable_dp(struct intel_encoder *encoder) 2476static void intel_disable_dp(struct intel_encoder *encoder,
2477 struct intel_crtc_state *old_crtc_state,
2478 struct drm_connector_state *old_conn_state)
2477{ 2479{
2478 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2480 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2479 struct drm_device *dev = encoder->base.dev; 2481 struct drm_device *dev = encoder->base.dev;
@@ -2497,7 +2499,9 @@ static void intel_disable_dp(struct intel_encoder *encoder)
2497 intel_dp_link_down(intel_dp); 2499 intel_dp_link_down(intel_dp);
2498} 2500}
2499 2501
2500static void ilk_post_disable_dp(struct intel_encoder *encoder) 2502static void ilk_post_disable_dp(struct intel_encoder *encoder,
2503 struct intel_crtc_state *old_crtc_state,
2504 struct drm_connector_state *old_conn_state)
2501{ 2505{
2502 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2506 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2503 enum port port = dp_to_dig_port(intel_dp)->port; 2507 enum port port = dp_to_dig_port(intel_dp)->port;
@@ -2509,14 +2513,18 @@ static void ilk_post_disable_dp(struct intel_encoder *encoder)
2509 ironlake_edp_pll_off(intel_dp); 2513 ironlake_edp_pll_off(intel_dp);
2510} 2514}
2511 2515
2512static void vlv_post_disable_dp(struct intel_encoder *encoder) 2516static void vlv_post_disable_dp(struct intel_encoder *encoder,
2517 struct intel_crtc_state *old_crtc_state,
2518 struct drm_connector_state *old_conn_state)
2513{ 2519{
2514 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2520 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2515 2521
2516 intel_dp_link_down(intel_dp); 2522 intel_dp_link_down(intel_dp);
2517} 2523}
2518 2524
2519static void chv_post_disable_dp(struct intel_encoder *encoder) 2525static void chv_post_disable_dp(struct intel_encoder *encoder,
2526 struct intel_crtc_state *old_crtc_state,
2527 struct drm_connector_state *old_conn_state)
2520{ 2528{
2521 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2529 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2522 struct drm_device *dev = encoder->base.dev; 2530 struct drm_device *dev = encoder->base.dev;
@@ -2690,7 +2698,9 @@ static void intel_enable_dp(struct intel_encoder *encoder)
2690 } 2698 }
2691} 2699}
2692 2700
2693static void g4x_enable_dp(struct intel_encoder *encoder) 2701static void g4x_enable_dp(struct intel_encoder *encoder,
2702 struct intel_crtc_state *pipe_config,
2703 struct drm_connector_state *conn_state)
2694{ 2704{
2695 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2705 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2696 2706
@@ -2698,7 +2708,9 @@ static void g4x_enable_dp(struct intel_encoder *encoder)
2698 intel_edp_backlight_on(intel_dp); 2708 intel_edp_backlight_on(intel_dp);
2699} 2709}
2700 2710
2701static void vlv_enable_dp(struct intel_encoder *encoder) 2711static void vlv_enable_dp(struct intel_encoder *encoder,
2712 struct intel_crtc_state *pipe_config,
2713 struct drm_connector_state *conn_state)
2702{ 2714{
2703 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2715 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2704 2716
@@ -2706,7 +2718,9 @@ static void vlv_enable_dp(struct intel_encoder *encoder)
2706 intel_psr_enable(intel_dp); 2718 intel_psr_enable(intel_dp);
2707} 2719}
2708 2720
2709static void g4x_pre_enable_dp(struct intel_encoder *encoder) 2721static void g4x_pre_enable_dp(struct intel_encoder *encoder,
2722 struct intel_crtc_state *pipe_config,
2723 struct drm_connector_state *conn_state)
2710{ 2724{
2711 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 2725 struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
2712 enum port port = dp_to_dig_port(intel_dp)->port; 2726 enum port port = dp_to_dig_port(intel_dp)->port;
@@ -2821,21 +2835,27 @@ static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp)
2821 intel_dp_init_panel_power_sequencer_registers(dev, intel_dp); 2835 intel_dp_init_panel_power_sequencer_registers(dev, intel_dp);
2822} 2836}
2823 2837
2824static void vlv_pre_enable_dp(struct intel_encoder *encoder) 2838static void vlv_pre_enable_dp(struct intel_encoder *encoder,
2839 struct intel_crtc_state *pipe_config,
2840 struct drm_connector_state *conn_state)
2825{ 2841{
2826 vlv_phy_pre_encoder_enable(encoder); 2842 vlv_phy_pre_encoder_enable(encoder);
2827 2843
2828 intel_enable_dp(encoder); 2844 intel_enable_dp(encoder);
2829} 2845}
2830 2846
2831static void vlv_dp_pre_pll_enable(struct intel_encoder *encoder) 2847static void vlv_dp_pre_pll_enable(struct intel_encoder *encoder,
2848 struct intel_crtc_state *pipe_config,
2849 struct drm_connector_state *conn_state)
2832{ 2850{
2833 intel_dp_prepare(encoder); 2851 intel_dp_prepare(encoder);
2834 2852
2835 vlv_phy_pre_pll_enable(encoder); 2853 vlv_phy_pre_pll_enable(encoder);
2836} 2854}
2837 2855
2838static void chv_pre_enable_dp(struct intel_encoder *encoder) 2856static void chv_pre_enable_dp(struct intel_encoder *encoder,
2857 struct intel_crtc_state *pipe_config,
2858 struct drm_connector_state *conn_state)
2839{ 2859{
2840 chv_phy_pre_encoder_enable(encoder); 2860 chv_phy_pre_encoder_enable(encoder);
2841 2861
@@ -2845,14 +2865,18 @@ static void chv_pre_enable_dp(struct intel_encoder *encoder)
2845 chv_phy_release_cl2_override(encoder); 2865 chv_phy_release_cl2_override(encoder);
2846} 2866}
2847 2867
2848static void chv_dp_pre_pll_enable(struct intel_encoder *encoder) 2868static void chv_dp_pre_pll_enable(struct intel_encoder *encoder,
2869 struct intel_crtc_state *pipe_config,
2870 struct drm_connector_state *conn_state)
2849{ 2871{
2850 intel_dp_prepare(encoder); 2872 intel_dp_prepare(encoder);
2851 2873
2852 chv_phy_pre_pll_enable(encoder); 2874 chv_phy_pre_pll_enable(encoder);
2853} 2875}
2854 2876
2855static void chv_dp_post_pll_disable(struct intel_encoder *encoder) 2877static void chv_dp_post_pll_disable(struct intel_encoder *encoder,
2878 struct intel_crtc_state *pipe_config,
2879 struct drm_connector_state *conn_state)
2856{ 2880{
2857 chv_phy_post_pll_disable(encoder); 2881 chv_phy_post_pll_disable(encoder);
2858} 2882}
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 629337dbca3d..8f7594ef39a9 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -92,7 +92,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,
92 92
93} 93}
94 94
95static void intel_mst_disable_dp(struct intel_encoder *encoder) 95static void intel_mst_disable_dp(struct intel_encoder *encoder,
96 struct intel_crtc_state *old_crtc_state,
97 struct drm_connector_state *old_conn_state)
96{ 98{
97 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); 99 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
98 struct intel_digital_port *intel_dig_port = intel_mst->primary; 100 struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -109,7 +111,9 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)
109 } 111 }
110} 112}
111 113
112static void intel_mst_post_disable_dp(struct intel_encoder *encoder) 114static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
115 struct intel_crtc_state *old_crtc_state,
116 struct drm_connector_state *old_conn_state)
113{ 117{
114 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); 118 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
115 struct intel_digital_port *intel_dig_port = intel_mst->primary; 119 struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -128,12 +132,16 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)
128 132
129 intel_mst->connector = NULL; 133 intel_mst->connector = NULL;
130 if (intel_dp->active_mst_links == 0) { 134 if (intel_dp->active_mst_links == 0) {
131 intel_dig_port->base.post_disable(&intel_dig_port->base); 135 intel_dig_port->base.post_disable(&intel_dig_port->base,
136 NULL, NULL);
137
132 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); 138 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
133 } 139 }
134} 140}
135 141
136static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) 142static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
143 struct intel_crtc_state *pipe_config,
144 struct drm_connector_state *conn_state)
137{ 145{
138 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); 146 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
139 struct intel_digital_port *intel_dig_port = intel_mst->primary; 147 struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -200,7 +208,9 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
200 ret = drm_dp_update_payload_part1(&intel_dp->mst_mgr); 208 ret = drm_dp_update_payload_part1(&intel_dp->mst_mgr);
201} 209}
202 210
203static void intel_mst_enable_dp(struct intel_encoder *encoder) 211static void intel_mst_enable_dp(struct intel_encoder *encoder,
212 struct intel_crtc_state *pipe_config,
213 struct drm_connector_state *conn_state)
204{ 214{
205 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); 215 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
206 struct intel_digital_port *intel_dig_port = intel_mst->primary; 216 struct intel_digital_port *intel_dig_port = intel_mst->primary;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 1d2beebe597e..37f36358c877 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -206,12 +206,24 @@ struct intel_encoder {
206 void (*hot_plug)(struct intel_encoder *); 206 void (*hot_plug)(struct intel_encoder *);
207 bool (*compute_config)(struct intel_encoder *, 207 bool (*compute_config)(struct intel_encoder *,
208 struct intel_crtc_state *); 208 struct intel_crtc_state *);
209 void (*pre_pll_enable)(struct intel_encoder *); 209 void (*pre_pll_enable)(struct intel_encoder *,
210 void (*pre_enable)(struct intel_encoder *); 210 struct intel_crtc_state *,
211 void (*enable)(struct intel_encoder *); 211 struct drm_connector_state *);
212 void (*disable)(struct intel_encoder *); 212 void (*pre_enable)(struct intel_encoder *,
213 void (*post_disable)(struct intel_encoder *); 213 struct intel_crtc_state *,
214 void (*post_pll_disable)(struct intel_encoder *); 214 struct drm_connector_state *);
215 void (*enable)(struct intel_encoder *,
216 struct intel_crtc_state *,
217 struct drm_connector_state *);
218 void (*disable)(struct intel_encoder *,
219 struct intel_crtc_state *,
220 struct drm_connector_state *);
221 void (*post_disable)(struct intel_encoder *,
222 struct intel_crtc_state *,
223 struct drm_connector_state *);
224 void (*post_pll_disable)(struct intel_encoder *,
225 struct intel_crtc_state *,
226 struct drm_connector_state *);
215 /* Read out the current hw state of this connector, returning true if 227 /* Read out the current hw state of this connector, returning true if
216 * the encoder is active. If the encoder is enabled it also set the pipe 228 * the encoder is active. If the encoder is enabled it also set the pipe
217 * it is connected to in the pipe parameter. */ 229 * it is connected to in the pipe parameter. */
@@ -1139,7 +1151,9 @@ bool intel_ddi_pll_select(struct intel_crtc *crtc,
1139void intel_ddi_set_pipe_settings(struct drm_crtc *crtc); 1151void intel_ddi_set_pipe_settings(struct drm_crtc *crtc);
1140void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp); 1152void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp);
1141bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector); 1153bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
1142void intel_ddi_fdi_disable(struct drm_crtc *crtc); 1154void intel_ddi_fdi_disable(struct intel_encoder *,
1155 struct intel_crtc_state *,
1156 struct drm_connector_state *);
1143void intel_ddi_get_config(struct intel_encoder *encoder, 1157void intel_ddi_get_config(struct intel_encoder *encoder,
1144 struct intel_crtc_state *pipe_config); 1158 struct intel_crtc_state *pipe_config);
1145struct intel_encoder * 1159struct intel_encoder *
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index de8e9fb51595..107b70c19333 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -535,7 +535,9 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
535 535
536static void intel_dsi_prepare(struct intel_encoder *intel_encoder); 536static void intel_dsi_prepare(struct intel_encoder *intel_encoder);
537 537
538static void intel_dsi_pre_enable(struct intel_encoder *encoder) 538static void intel_dsi_pre_enable(struct intel_encoder *encoder,
539 struct intel_crtc_state *pipe_config,
540 struct drm_connector_state *conn_state)
539{ 541{
540 struct drm_device *dev = encoder->base.dev; 542 struct drm_device *dev = encoder->base.dev;
541 struct drm_i915_private *dev_priv = to_i915(dev); 543 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -582,7 +584,9 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
582 intel_dsi_enable(encoder); 584 intel_dsi_enable(encoder);
583} 585}
584 586
585static void intel_dsi_enable_nop(struct intel_encoder *encoder) 587static void intel_dsi_enable_nop(struct intel_encoder *encoder,
588 struct intel_crtc_state *pipe_config,
589 struct drm_connector_state *conn_state)
586{ 590{
587 DRM_DEBUG_KMS("\n"); 591 DRM_DEBUG_KMS("\n");
588 592
@@ -592,7 +596,9 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)
592 */ 596 */
593} 597}
594 598
595static void intel_dsi_pre_disable(struct intel_encoder *encoder) 599static void intel_dsi_pre_disable(struct intel_encoder *encoder,
600 struct intel_crtc_state *old_crtc_state,
601 struct drm_connector_state *old_conn_state)
596{ 602{
597 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); 603 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
598 enum port port; 604 enum port port;
@@ -694,7 +700,9 @@ static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
694 intel_disable_dsi_pll(encoder); 700 intel_disable_dsi_pll(encoder);
695} 701}
696 702
697static void intel_dsi_post_disable(struct intel_encoder *encoder) 703static void intel_dsi_post_disable(struct intel_encoder *encoder,
704 struct intel_crtc_state *pipe_config,
705 struct drm_connector_state *conn_state)
698{ 706{
699 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 707 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
700 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); 708 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index 47bdf9dad0d3..52dde9b71ca5 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -174,7 +174,9 @@ static void intel_dvo_get_config(struct intel_encoder *encoder,
174 pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; 174 pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock;
175} 175}
176 176
177static void intel_disable_dvo(struct intel_encoder *encoder) 177static void intel_disable_dvo(struct intel_encoder *encoder,
178 struct intel_crtc_state *old_crtc_state,
179 struct drm_connector_state *old_conn_state)
178{ 180{
179 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 181 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
180 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); 182 struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
@@ -186,7 +188,9 @@ static void intel_disable_dvo(struct intel_encoder *encoder)
186 I915_READ(dvo_reg); 188 I915_READ(dvo_reg);
187} 189}
188 190
189static void intel_enable_dvo(struct intel_encoder *encoder) 191static void intel_enable_dvo(struct intel_encoder *encoder,
192 struct intel_crtc_state *pipe_config,
193 struct drm_connector_state *conn_state)
190{ 194{
191 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 195 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
192 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); 196 struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
@@ -253,7 +257,9 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder,
253 return true; 257 return true;
254} 258}
255 259
256static void intel_dvo_pre_enable(struct intel_encoder *encoder) 260static void intel_dvo_pre_enable(struct intel_encoder *encoder,
261 struct intel_crtc_state *pipe_config,
262 struct drm_connector_state *conn_state)
257{ 263{
258 struct drm_device *dev = encoder->base.dev; 264 struct drm_device *dev = encoder->base.dev;
259 struct drm_i915_private *dev_priv = to_i915(dev); 265 struct drm_i915_private *dev_priv = to_i915(dev);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 4df9f384910c..560eff9a3694 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -985,7 +985,9 @@ static void intel_enable_hdmi_audio(struct intel_encoder *encoder)
985 intel_audio_codec_enable(encoder); 985 intel_audio_codec_enable(encoder);
986} 986}
987 987
988static void g4x_enable_hdmi(struct intel_encoder *encoder) 988static void g4x_enable_hdmi(struct intel_encoder *encoder,
989 struct intel_crtc_state *pipe_config,
990 struct drm_connector_state *conn_state)
989{ 991{
990 struct drm_device *dev = encoder->base.dev; 992 struct drm_device *dev = encoder->base.dev;
991 struct drm_i915_private *dev_priv = to_i915(dev); 993 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1006,7 +1008,9 @@ static void g4x_enable_hdmi(struct intel_encoder *encoder)
1006 intel_enable_hdmi_audio(encoder); 1008 intel_enable_hdmi_audio(encoder);
1007} 1009}
1008 1010
1009static void ibx_enable_hdmi(struct intel_encoder *encoder) 1011static void ibx_enable_hdmi(struct intel_encoder *encoder,
1012 struct intel_crtc_state *pipe_config,
1013 struct drm_connector_state *conn_state)
1010{ 1014{
1011 struct drm_device *dev = encoder->base.dev; 1015 struct drm_device *dev = encoder->base.dev;
1012 struct drm_i915_private *dev_priv = to_i915(dev); 1016 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1055,7 +1059,9 @@ static void ibx_enable_hdmi(struct intel_encoder *encoder)
1055 intel_enable_hdmi_audio(encoder); 1059 intel_enable_hdmi_audio(encoder);
1056} 1060}
1057 1061
1058static void cpt_enable_hdmi(struct intel_encoder *encoder) 1062static void cpt_enable_hdmi(struct intel_encoder *encoder,
1063 struct intel_crtc_state *pipe_config,
1064 struct drm_connector_state *conn_state)
1059{ 1065{
1060 struct drm_device *dev = encoder->base.dev; 1066 struct drm_device *dev = encoder->base.dev;
1061 struct drm_i915_private *dev_priv = to_i915(dev); 1067 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1108,11 +1114,15 @@ static void cpt_enable_hdmi(struct intel_encoder *encoder)
1108 intel_enable_hdmi_audio(encoder); 1114 intel_enable_hdmi_audio(encoder);
1109} 1115}
1110 1116
1111static void vlv_enable_hdmi(struct intel_encoder *encoder) 1117static void vlv_enable_hdmi(struct intel_encoder *encoder,
1118 struct intel_crtc_state *pipe_config,
1119 struct drm_connector_state *conn_state)
1112{ 1120{
1113} 1121}
1114 1122
1115static void intel_disable_hdmi(struct intel_encoder *encoder) 1123static void intel_disable_hdmi(struct intel_encoder *encoder,
1124 struct intel_crtc_state *old_crtc_state,
1125 struct drm_connector_state *old_conn_state)
1116{ 1126{
1117 struct drm_device *dev = encoder->base.dev; 1127 struct drm_device *dev = encoder->base.dev;
1118 struct drm_i915_private *dev_priv = to_i915(dev); 1128 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1164,17 +1174,21 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
1164 intel_dp_dual_mode_set_tmds_output(intel_hdmi, false); 1174 intel_dp_dual_mode_set_tmds_output(intel_hdmi, false);
1165} 1175}
1166 1176
1167static void g4x_disable_hdmi(struct intel_encoder *encoder) 1177static void g4x_disable_hdmi(struct intel_encoder *encoder,
1178 struct intel_crtc_state *old_crtc_state,
1179 struct drm_connector_state *old_conn_state)
1168{ 1180{
1169 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 1181 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
1170 1182
1171 if (crtc->config->has_audio) 1183 if (crtc->config->has_audio)
1172 intel_audio_codec_disable(encoder); 1184 intel_audio_codec_disable(encoder);
1173 1185
1174 intel_disable_hdmi(encoder); 1186 intel_disable_hdmi(encoder, old_crtc_state, old_conn_state);
1175} 1187}
1176 1188
1177static void pch_disable_hdmi(struct intel_encoder *encoder) 1189static void pch_disable_hdmi(struct intel_encoder *encoder,
1190 struct intel_crtc_state *old_crtc_state,
1191 struct drm_connector_state *old_conn_state)
1178{ 1192{
1179 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 1193 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
1180 1194
@@ -1182,9 +1196,11 @@ static void pch_disable_hdmi(struct intel_encoder *encoder)
1182 intel_audio_codec_disable(encoder); 1196 intel_audio_codec_disable(encoder);
1183} 1197}
1184 1198
1185static void pch_post_disable_hdmi(struct intel_encoder *encoder) 1199static void pch_post_disable_hdmi(struct intel_encoder *encoder,
1200 struct intel_crtc_state *old_crtc_state,
1201 struct drm_connector_state *old_conn_state)
1186{ 1202{
1187 intel_disable_hdmi(encoder); 1203 intel_disable_hdmi(encoder, old_crtc_state, old_conn_state);
1188} 1204}
1189 1205
1190static int intel_hdmi_source_max_tmds_clock(struct drm_i915_private *dev_priv) 1206static int intel_hdmi_source_max_tmds_clock(struct drm_i915_private *dev_priv)
@@ -1638,7 +1654,9 @@ done:
1638 return 0; 1654 return 0;
1639} 1655}
1640 1656
1641static void intel_hdmi_pre_enable(struct intel_encoder *encoder) 1657static void intel_hdmi_pre_enable(struct intel_encoder *encoder,
1658 struct intel_crtc_state *pipe_config,
1659 struct drm_connector_state *conn_state)
1642{ 1660{
1643 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 1661 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
1644 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc); 1662 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
@@ -1651,7 +1669,9 @@ static void intel_hdmi_pre_enable(struct intel_encoder *encoder)
1651 adjusted_mode); 1669 adjusted_mode);
1652} 1670}
1653 1671
1654static void vlv_hdmi_pre_enable(struct intel_encoder *encoder) 1672static void vlv_hdmi_pre_enable(struct intel_encoder *encoder,
1673 struct intel_crtc_state *pipe_config,
1674 struct drm_connector_state *conn_state)
1655{ 1675{
1656 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 1676 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
1657 struct intel_hdmi *intel_hdmi = &dport->hdmi; 1677 struct intel_hdmi *intel_hdmi = &dport->hdmi;
@@ -1671,37 +1691,47 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder)
1671 intel_crtc->config->has_hdmi_sink, 1691 intel_crtc->config->has_hdmi_sink,
1672 adjusted_mode); 1692 adjusted_mode);
1673 1693
1674 g4x_enable_hdmi(encoder); 1694 g4x_enable_hdmi(encoder, pipe_config, conn_state);
1675 1695
1676 vlv_wait_port_ready(dev_priv, dport, 0x0); 1696 vlv_wait_port_ready(dev_priv, dport, 0x0);
1677} 1697}
1678 1698
1679static void vlv_hdmi_pre_pll_enable(struct intel_encoder *encoder) 1699static void vlv_hdmi_pre_pll_enable(struct intel_encoder *encoder,
1700 struct intel_crtc_state *pipe_config,
1701 struct drm_connector_state *conn_state)
1680{ 1702{
1681 intel_hdmi_prepare(encoder); 1703 intel_hdmi_prepare(encoder);
1682 1704
1683 vlv_phy_pre_pll_enable(encoder); 1705 vlv_phy_pre_pll_enable(encoder);
1684} 1706}
1685 1707
1686static void chv_hdmi_pre_pll_enable(struct intel_encoder *encoder) 1708static void chv_hdmi_pre_pll_enable(struct intel_encoder *encoder,
1709 struct intel_crtc_state *pipe_config,
1710 struct drm_connector_state *conn_state)
1687{ 1711{
1688 intel_hdmi_prepare(encoder); 1712 intel_hdmi_prepare(encoder);
1689 1713
1690 chv_phy_pre_pll_enable(encoder); 1714 chv_phy_pre_pll_enable(encoder);
1691} 1715}
1692 1716
1693static void chv_hdmi_post_pll_disable(struct intel_encoder *encoder) 1717static void chv_hdmi_post_pll_disable(struct intel_encoder *encoder,
1718 struct intel_crtc_state *old_crtc_state,
1719 struct drm_connector_state *old_conn_state)
1694{ 1720{
1695 chv_phy_post_pll_disable(encoder); 1721 chv_phy_post_pll_disable(encoder);
1696} 1722}
1697 1723
1698static void vlv_hdmi_post_disable(struct intel_encoder *encoder) 1724static void vlv_hdmi_post_disable(struct intel_encoder *encoder,
1725 struct intel_crtc_state *old_crtc_state,
1726 struct drm_connector_state *old_conn_state)
1699{ 1727{
1700 /* Reset lanes to avoid HDMI flicker (VLV w/a) */ 1728 /* Reset lanes to avoid HDMI flicker (VLV w/a) */
1701 vlv_phy_reset_lanes(encoder); 1729 vlv_phy_reset_lanes(encoder);
1702} 1730}
1703 1731
1704static void chv_hdmi_post_disable(struct intel_encoder *encoder) 1732static void chv_hdmi_post_disable(struct intel_encoder *encoder,
1733 struct intel_crtc_state *old_crtc_state,
1734 struct drm_connector_state *old_conn_state)
1705{ 1735{
1706 struct drm_device *dev = encoder->base.dev; 1736 struct drm_device *dev = encoder->base.dev;
1707 struct drm_i915_private *dev_priv = to_i915(dev); 1737 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1714,7 +1744,9 @@ static void chv_hdmi_post_disable(struct intel_encoder *encoder)
1714 mutex_unlock(&dev_priv->sb_lock); 1744 mutex_unlock(&dev_priv->sb_lock);
1715} 1745}
1716 1746
1717static void chv_hdmi_pre_enable(struct intel_encoder *encoder) 1747static void chv_hdmi_pre_enable(struct intel_encoder *encoder,
1748 struct intel_crtc_state *pipe_config,
1749 struct drm_connector_state *conn_state)
1718{ 1750{
1719 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 1751 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
1720 struct intel_hdmi *intel_hdmi = &dport->hdmi; 1752 struct intel_hdmi *intel_hdmi = &dport->hdmi;
@@ -1734,7 +1766,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)
1734 intel_crtc->config->has_hdmi_sink, 1766 intel_crtc->config->has_hdmi_sink,
1735 adjusted_mode); 1767 adjusted_mode);
1736 1768
1737 g4x_enable_hdmi(encoder); 1769 g4x_enable_hdmi(encoder, pipe_config, conn_state);
1738 1770
1739 vlv_wait_port_ready(dev_priv, dport, 0x0); 1771 vlv_wait_port_ready(dev_priv, dport, 0x0);
1740 1772
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 668eabb0ba1b..f8e55df98883 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -230,7 +230,9 @@ static void intel_lvds_pps_init_hw(struct drm_i915_private *dev_priv,
230 I915_WRITE(PP_DIVISOR(0), val); 230 I915_WRITE(PP_DIVISOR(0), val);
231} 231}
232 232
233static void intel_pre_enable_lvds(struct intel_encoder *encoder) 233static void intel_pre_enable_lvds(struct intel_encoder *encoder,
234 struct intel_crtc_state *pipe_config,
235 struct drm_connector_state *conn_state)
234{ 236{
235 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); 237 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
236 struct drm_device *dev = encoder->base.dev; 238 struct drm_device *dev = encoder->base.dev;
@@ -306,7 +308,9 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder)
306/** 308/**
307 * Sets the power state for the panel. 309 * Sets the power state for the panel.
308 */ 310 */
309static void intel_enable_lvds(struct intel_encoder *encoder) 311static void intel_enable_lvds(struct intel_encoder *encoder,
312 struct intel_crtc_state *pipe_config,
313 struct drm_connector_state *conn_state)
310{ 314{
311 struct drm_device *dev = encoder->base.dev; 315 struct drm_device *dev = encoder->base.dev;
312 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); 316 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
@@ -324,7 +328,9 @@ static void intel_enable_lvds(struct intel_encoder *encoder)
324 intel_panel_enable_backlight(intel_connector); 328 intel_panel_enable_backlight(intel_connector);
325} 329}
326 330
327static void intel_disable_lvds(struct intel_encoder *encoder) 331static void intel_disable_lvds(struct intel_encoder *encoder,
332 struct intel_crtc_state *old_crtc_state,
333 struct drm_connector_state *old_conn_state)
328{ 334{
329 struct drm_device *dev = encoder->base.dev; 335 struct drm_device *dev = encoder->base.dev;
330 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); 336 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
@@ -338,7 +344,10 @@ static void intel_disable_lvds(struct intel_encoder *encoder)
338 POSTING_READ(lvds_encoder->reg); 344 POSTING_READ(lvds_encoder->reg);
339} 345}
340 346
341static void gmch_disable_lvds(struct intel_encoder *encoder) 347static void gmch_disable_lvds(struct intel_encoder *encoder,
348 struct intel_crtc_state *old_crtc_state,
349 struct drm_connector_state *old_conn_state)
350
342{ 351{
343 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); 352 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
344 struct intel_connector *intel_connector = 353 struct intel_connector *intel_connector =
@@ -346,10 +355,12 @@ static void gmch_disable_lvds(struct intel_encoder *encoder)
346 355
347 intel_panel_disable_backlight(intel_connector); 356 intel_panel_disable_backlight(intel_connector);
348 357
349 intel_disable_lvds(encoder); 358 intel_disable_lvds(encoder, old_crtc_state, old_conn_state);
350} 359}
351 360
352static void pch_disable_lvds(struct intel_encoder *encoder) 361static void pch_disable_lvds(struct intel_encoder *encoder,
362 struct intel_crtc_state *old_crtc_state,
363 struct drm_connector_state *old_conn_state)
353{ 364{
354 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); 365 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
355 struct intel_connector *intel_connector = 366 struct intel_connector *intel_connector =
@@ -358,9 +369,11 @@ static void pch_disable_lvds(struct intel_encoder *encoder)
358 intel_panel_disable_backlight(intel_connector); 369 intel_panel_disable_backlight(intel_connector);
359} 370}
360 371
361static void pch_post_disable_lvds(struct intel_encoder *encoder) 372static void pch_post_disable_lvds(struct intel_encoder *encoder,
373 struct intel_crtc_state *old_crtc_state,
374 struct drm_connector_state *old_conn_state)
362{ 375{
363 intel_disable_lvds(encoder); 376 intel_disable_lvds(encoder, old_crtc_state, old_conn_state);
364} 377}
365 378
366static enum drm_mode_status 379static enum drm_mode_status
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index dd75510eba67..cff4e9dcf4be 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1192,7 +1192,9 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder,
1192 return true; 1192 return true;
1193} 1193}
1194 1194
1195static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder) 1195static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
1196 struct intel_crtc_state *crtc_state,
1197 struct drm_connector_state *conn_state)
1196{ 1198{
1197 struct drm_device *dev = intel_encoder->base.dev; 1199 struct drm_device *dev = intel_encoder->base.dev;
1198 struct drm_i915_private *dev_priv = to_i915(dev); 1200 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1434,7 +1436,9 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
1434 pipe_config->pixel_multiplier, encoder_pixel_multiplier); 1436 pipe_config->pixel_multiplier, encoder_pixel_multiplier);
1435} 1437}
1436 1438
1437static void intel_disable_sdvo(struct intel_encoder *encoder) 1439static void intel_disable_sdvo(struct intel_encoder *encoder,
1440 struct intel_crtc_state *old_crtc_state,
1441 struct drm_connector_state *conn_state)
1438{ 1442{
1439 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1443 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1440 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); 1444 struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
@@ -1477,16 +1481,22 @@ static void intel_disable_sdvo(struct intel_encoder *encoder)
1477 } 1481 }
1478} 1482}
1479 1483
1480static void pch_disable_sdvo(struct intel_encoder *encoder) 1484static void pch_disable_sdvo(struct intel_encoder *encoder,
1485 struct intel_crtc_state *old_crtc_state,
1486 struct drm_connector_state *old_conn_state)
1481{ 1487{
1482} 1488}
1483 1489
1484static void pch_post_disable_sdvo(struct intel_encoder *encoder) 1490static void pch_post_disable_sdvo(struct intel_encoder *encoder,
1491 struct intel_crtc_state *old_crtc_state,
1492 struct drm_connector_state *old_conn_state)
1485{ 1493{
1486 intel_disable_sdvo(encoder); 1494 intel_disable_sdvo(encoder, old_crtc_state, old_conn_state);
1487} 1495}
1488 1496
1489static void intel_enable_sdvo(struct intel_encoder *encoder) 1497static void intel_enable_sdvo(struct intel_encoder *encoder,
1498 struct intel_crtc_state *pipe_config,
1499 struct drm_connector_state *conn_state)
1490{ 1500{
1491 struct drm_device *dev = encoder->base.dev; 1501 struct drm_device *dev = encoder->base.dev;
1492 struct drm_i915_private *dev_priv = to_i915(dev); 1502 struct drm_i915_private *dev_priv = to_i915(dev);
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 49136ad5473e..440ce7933573 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -838,7 +838,9 @@ intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe)
838} 838}
839 839
840static void 840static void
841intel_enable_tv(struct intel_encoder *encoder) 841intel_enable_tv(struct intel_encoder *encoder,
842 struct intel_crtc_state *pipe_config,
843 struct drm_connector_state *conn_state)
842{ 844{
843 struct drm_device *dev = encoder->base.dev; 845 struct drm_device *dev = encoder->base.dev;
844 struct drm_i915_private *dev_priv = to_i915(dev); 846 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -851,7 +853,9 @@ intel_enable_tv(struct intel_encoder *encoder)
851} 853}
852 854
853static void 855static void
854intel_disable_tv(struct intel_encoder *encoder) 856intel_disable_tv(struct intel_encoder *encoder,
857 struct intel_crtc_state *old_crtc_state,
858 struct drm_connector_state *old_conn_state)
855{ 859{
856 struct drm_device *dev = encoder->base.dev; 860 struct drm_device *dev = encoder->base.dev;
857 struct drm_i915_private *dev_priv = to_i915(dev); 861 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -1010,7 +1014,9 @@ static void set_color_conversion(struct drm_i915_private *dev_priv,
1010 color_conversion->av); 1014 color_conversion->av);
1011} 1015}
1012 1016
1013static void intel_tv_pre_enable(struct intel_encoder *encoder) 1017static void intel_tv_pre_enable(struct intel_encoder *encoder,
1018 struct intel_crtc_state *pipe_config,
1019 struct drm_connector_state *conn_state)
1014{ 1020{
1015 struct drm_device *dev = encoder->base.dev; 1021 struct drm_device *dev = encoder->base.dev;
1016 struct drm_i915_private *dev_priv = to_i915(dev); 1022 struct drm_i915_private *dev_priv = to_i915(dev);