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.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index e3f5e218036d..b39183bcc9fa 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -404,8 +404,7 @@ intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder
404static enum drm_connector_status intel_crt_detect(struct drm_connector *connector) 404static enum drm_connector_status intel_crt_detect(struct drm_connector *connector)
405{ 405{
406 struct drm_device *dev = connector->dev; 406 struct drm_device *dev = connector->dev;
407 struct drm_encoder *encoder = intel_attached_encoder(connector); 407 struct intel_encoder *encoder = intel_attached_encoder(connector);
408 struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
409 struct drm_crtc *crtc; 408 struct drm_crtc *crtc;
410 int dpms_mode; 409 int dpms_mode;
411 enum drm_connector_status status; 410 enum drm_connector_status status;
@@ -417,18 +416,18 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto
417 return connector_status_disconnected; 416 return connector_status_disconnected;
418 } 417 }
419 418
420 if (intel_crt_detect_ddc(encoder)) 419 if (intel_crt_detect_ddc(&encoder->base))
421 return connector_status_connected; 420 return connector_status_connected;
422 421
423 /* for pre-945g platforms use load detect */ 422 /* for pre-945g platforms use load detect */
424 if (encoder->crtc && encoder->crtc->enabled) { 423 if (encoder->base.crtc && encoder->base.crtc->enabled) {
425 status = intel_crt_load_detect(encoder->crtc, intel_encoder); 424 status = intel_crt_load_detect(encoder->base.crtc, encoder);
426 } else { 425 } else {
427 crtc = intel_get_load_detect_pipe(intel_encoder, connector, 426 crtc = intel_get_load_detect_pipe(encoder, connector,
428 NULL, &dpms_mode); 427 NULL, &dpms_mode);
429 if (crtc) { 428 if (crtc) {
430 status = intel_crt_load_detect(crtc, intel_encoder); 429 status = intel_crt_load_detect(crtc, encoder);
431 intel_release_load_detect_pipe(intel_encoder, 430 intel_release_load_detect_pipe(encoder,
432 connector, dpms_mode); 431 connector, dpms_mode);
433 } else 432 } else
434 status = connector_status_unknown; 433 status = connector_status_unknown;
@@ -447,13 +446,12 @@ static void intel_crt_destroy(struct drm_connector *connector)
447static int intel_crt_get_modes(struct drm_connector *connector) 446static int intel_crt_get_modes(struct drm_connector *connector)
448{ 447{
449 int ret; 448 int ret;
450 struct drm_encoder *encoder = intel_attached_encoder(connector); 449 struct intel_encoder *encoder = intel_attached_encoder(connector);
451 struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
452 struct i2c_adapter *ddc_bus; 450 struct i2c_adapter *ddc_bus;
453 struct drm_device *dev = connector->dev; 451 struct drm_device *dev = connector->dev;
454 452
455 453
456 ret = intel_ddc_get_modes(connector, intel_encoder->ddc_bus); 454 ret = intel_ddc_get_modes(connector, encoder->ddc_bus);
457 if (ret || !IS_G4X(dev)) 455 if (ret || !IS_G4X(dev))
458 goto end; 456 goto end;
459 457
@@ -504,7 +502,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = {
504static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = { 502static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
505 .mode_valid = intel_crt_mode_valid, 503 .mode_valid = intel_crt_mode_valid,
506 .get_modes = intel_crt_get_modes, 504 .get_modes = intel_crt_get_modes,
507 .best_encoder = intel_attached_encoder, 505 .best_encoder = intel_best_encoder,
508}; 506};
509 507
510static const struct drm_encoder_funcs intel_crt_enc_funcs = { 508static const struct drm_encoder_funcs intel_crt_enc_funcs = {
@@ -536,8 +534,7 @@ void intel_crt_init(struct drm_device *dev)
536 drm_encoder_init(dev, &intel_encoder->base, &intel_crt_enc_funcs, 534 drm_encoder_init(dev, &intel_encoder->base, &intel_crt_enc_funcs,
537 DRM_MODE_ENCODER_DAC); 535 DRM_MODE_ENCODER_DAC);
538 536
539 drm_mode_connector_attach_encoder(&intel_connector->base, 537 intel_connector_attach_encoder(intel_connector, intel_encoder);
540 &intel_encoder->base);
541 538
542 /* Set up the DDC bus. */ 539 /* Set up the DDC bus. */
543 if (HAS_PCH_SPLIT(dev)) 540 if (HAS_PCH_SPLIT(dev))