aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_crt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c46
1 files changed, 21 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 437339f5d098..9f31aea51dff 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -119,6 +119,8 @@ static unsigned int intel_crt_get_flags(struct intel_encoder *encoder)
119static void intel_crt_get_config(struct intel_encoder *encoder, 119static void intel_crt_get_config(struct intel_encoder *encoder,
120 struct intel_crtc_state *pipe_config) 120 struct intel_crtc_state *pipe_config)
121{ 121{
122 pipe_config->output_types |= BIT(INTEL_OUTPUT_ANALOG);
123
122 pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder); 124 pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder);
123 125
124 pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; 126 pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock;
@@ -217,11 +219,9 @@ static void hsw_disable_crt(struct intel_encoder *encoder,
217 const struct intel_crtc_state *old_crtc_state, 219 const struct intel_crtc_state *old_crtc_state,
218 const struct drm_connector_state *old_conn_state) 220 const struct drm_connector_state *old_conn_state)
219{ 221{
220 struct drm_crtc *crtc = old_crtc_state->base.crtc; 222 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
221 struct drm_i915_private *dev_priv = to_i915(crtc->dev);
222 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
223 223
224 WARN_ON(!intel_crtc->config->has_pch_encoder); 224 WARN_ON(!old_crtc_state->has_pch_encoder);
225 225
226 intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false); 226 intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false);
227} 227}
@@ -245,46 +245,42 @@ static void hsw_post_disable_crt(struct intel_encoder *encoder,
245} 245}
246 246
247static void hsw_pre_pll_enable_crt(struct intel_encoder *encoder, 247static void hsw_pre_pll_enable_crt(struct intel_encoder *encoder,
248 const struct intel_crtc_state *pipe_config, 248 const struct intel_crtc_state *crtc_state,
249 const struct drm_connector_state *conn_state) 249 const struct drm_connector_state *conn_state)
250{ 250{
251 struct drm_crtc *crtc = pipe_config->base.crtc; 251 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
252 struct drm_i915_private *dev_priv = to_i915(crtc->dev);
253 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
254 252
255 WARN_ON(!intel_crtc->config->has_pch_encoder); 253 WARN_ON(!crtc_state->has_pch_encoder);
256 254
257 intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false); 255 intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false);
258} 256}
259 257
260static void hsw_pre_enable_crt(struct intel_encoder *encoder, 258static void hsw_pre_enable_crt(struct intel_encoder *encoder,
261 const struct intel_crtc_state *pipe_config, 259 const struct intel_crtc_state *crtc_state,
262 const struct drm_connector_state *conn_state) 260 const struct drm_connector_state *conn_state)
263{ 261{
264 struct drm_crtc *crtc = pipe_config->base.crtc; 262 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
265 struct drm_i915_private *dev_priv = to_i915(crtc->dev); 263 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
266 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 264 enum pipe pipe = crtc->pipe;
267 int pipe = intel_crtc->pipe;
268 265
269 WARN_ON(!intel_crtc->config->has_pch_encoder); 266 WARN_ON(!crtc_state->has_pch_encoder);
270 267
271 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false); 268 intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
272 269
273 dev_priv->display.fdi_link_train(intel_crtc, pipe_config); 270 dev_priv->display.fdi_link_train(crtc, crtc_state);
274} 271}
275 272
276static void hsw_enable_crt(struct intel_encoder *encoder, 273static void hsw_enable_crt(struct intel_encoder *encoder,
277 const struct intel_crtc_state *pipe_config, 274 const struct intel_crtc_state *crtc_state,
278 const struct drm_connector_state *conn_state) 275 const struct drm_connector_state *conn_state)
279{ 276{
280 struct drm_crtc *crtc = pipe_config->base.crtc; 277 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
281 struct drm_i915_private *dev_priv = to_i915(crtc->dev); 278 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
282 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 279 enum pipe pipe = crtc->pipe;
283 int pipe = intel_crtc->pipe;
284 280
285 WARN_ON(!intel_crtc->config->has_pch_encoder); 281 WARN_ON(!crtc_state->has_pch_encoder);
286 282
287 intel_crt_set_dpms(encoder, pipe_config, DRM_MODE_DPMS_ON); 283 intel_crt_set_dpms(encoder, crtc_state, DRM_MODE_DPMS_ON);
288 284
289 intel_wait_for_vblank(dev_priv, pipe); 285 intel_wait_for_vblank(dev_priv, pipe);
290 intel_wait_for_vblank(dev_priv, pipe); 286 intel_wait_for_vblank(dev_priv, pipe);
@@ -293,10 +289,10 @@ static void hsw_enable_crt(struct intel_encoder *encoder,
293} 289}
294 290
295static void intel_enable_crt(struct intel_encoder *encoder, 291static void intel_enable_crt(struct intel_encoder *encoder,
296 const struct intel_crtc_state *pipe_config, 292 const struct intel_crtc_state *crtc_state,
297 const struct drm_connector_state *conn_state) 293 const struct drm_connector_state *conn_state)
298{ 294{
299 intel_crt_set_dpms(encoder, pipe_config, DRM_MODE_DPMS_ON); 295 intel_crt_set_dpms(encoder, crtc_state, DRM_MODE_DPMS_ON);
300} 296}
301 297
302static enum drm_mode_status 298static enum drm_mode_status