aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-26 13:25:46 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-06 02:00:05 -0400
commit24e804ba9731bf4b05bc17a6702d802e76b3bbc4 (patch)
treeb85af400b0ec4f7fa0b6d16f85ce4c5010127424 /drivers/gpu/drm/i915/intel_dp.c
parent84bb65bded92028a6c803fef332586fedbe092b2 (diff)
drm/i915: rip out intel_dp->dpms_mode
We now track the connector state in encoder->connectors_active, and because the DP output can't be cloned, that is sufficient to track the link state. Hence use this instead of adding yet another modeset state variable with dubious semantics at driver load and resume time. Also, connectors_active should only ever be set when the encoder is linked to a crtc, hence convert that crtc test into a WARN. v2: Rebase on top of struct intel_dp moving. v3: The rebase accidentally killed the newly-introduced intel_dp->port Noticed by Paulo Zanoni. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 96fd1e7ff02e..b07d4b4fca6e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1309,8 +1309,6 @@ static void intel_disable_dp(struct intel_encoder *encoder)
1309 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); 1309 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
1310 ironlake_edp_panel_off(intel_dp); 1310 ironlake_edp_panel_off(intel_dp);
1311 intel_dp_link_down(intel_dp); 1311 intel_dp_link_down(intel_dp);
1312
1313 intel_dp->dpms_mode = DRM_MODE_DPMS_OFF;
1314} 1312}
1315 1313
1316static void intel_enable_dp(struct intel_encoder *encoder) 1314static void intel_enable_dp(struct intel_encoder *encoder)
@@ -1330,8 +1328,6 @@ static void intel_enable_dp(struct intel_encoder *encoder)
1330 } else 1328 } else
1331 ironlake_edp_panel_vdd_off(intel_dp, false); 1329 ironlake_edp_panel_vdd_off(intel_dp, false);
1332 ironlake_edp_backlight_on(intel_dp); 1330 ironlake_edp_backlight_on(intel_dp);
1333
1334 intel_dp->dpms_mode = DRM_MODE_DPMS_ON;
1335} 1331}
1336 1332
1337static void 1333static void
@@ -1356,7 +1352,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
1356 1352
1357 if (mode != DRM_MODE_DPMS_ON) { 1353 if (mode != DRM_MODE_DPMS_ON) {
1358 intel_encoder_dpms(&intel_dp->base, mode); 1354 intel_encoder_dpms(&intel_dp->base, mode);
1359 WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_OFF);
1360 1355
1361 if (is_cpu_edp(intel_dp)) 1356 if (is_cpu_edp(intel_dp))
1362 ironlake_edp_pll_off(&intel_dp->base.base); 1357 ironlake_edp_pll_off(&intel_dp->base.base);
@@ -1365,7 +1360,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
1365 ironlake_edp_pll_on(&intel_dp->base.base); 1360 ironlake_edp_pll_on(&intel_dp->base.base);
1366 1361
1367 intel_encoder_dpms(&intel_dp->base, mode); 1362 intel_encoder_dpms(&intel_dp->base, mode);
1368 WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_ON);
1369 } 1363 }
1370 1364
1371 intel_connector_check_state(to_intel_connector(connector)); 1365 intel_connector_check_state(to_intel_connector(connector));
@@ -2069,10 +2063,10 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
2069 u8 sink_irq_vector; 2063 u8 sink_irq_vector;
2070 u8 link_status[DP_LINK_STATUS_SIZE]; 2064 u8 link_status[DP_LINK_STATUS_SIZE];
2071 2065
2072 if (intel_dp->dpms_mode != DRM_MODE_DPMS_ON) 2066 if (!intel_dp->base.connectors_active)
2073 return; 2067 return;
2074 2068
2075 if (!intel_dp->base.base.crtc) 2069 if (WARN_ON(!intel_dp->base.base.crtc))
2076 return; 2070 return;
2077 2071
2078 /* Try to read receiver status if the link appears to be up */ 2072 /* Try to read receiver status if the link appears to be up */
@@ -2490,7 +2484,6 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
2490 2484
2491 intel_dp->output_reg = output_reg; 2485 intel_dp->output_reg = output_reg;
2492 intel_dp->port = port; 2486 intel_dp->port = port;
2493 intel_dp->dpms_mode = -1;
2494 2487
2495 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); 2488 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
2496 if (!intel_connector) { 2489 if (!intel_connector) {