diff options
author | Keith Packard <keithp@keithp.com> | 2011-11-01 23:25:21 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-11-16 23:26:26 -0500 |
commit | 21264c638b4f9179655a39436d0340bd0d4ab1de (patch) | |
tree | baab19c8497b8fef24bfdf0c77ed0309fa446094 /drivers | |
parent | 99ea7127a30bda29354e1ed3a75d80d5f9cfc2a7 (diff) |
drm/i915: Make DP prepare/commit consistent with DP dpms
Make sure the sequence of operations in all three functions makes
sense:
1) The backlight must be off unless the screen is running
2) The link must be running to turn the eDP panel on/off
3) The CPU eDP PLL must be running until everything is off
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 56106101d3f8..8e37fdd1fa2f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1222,17 +1222,18 @@ static void intel_dp_prepare(struct drm_encoder *encoder) | |||
1222 | { | 1222 | { |
1223 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 1223 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
1224 | 1224 | ||
1225 | ironlake_edp_backlight_off(intel_dp); | ||
1226 | ironlake_edp_panel_off(intel_dp); | ||
1227 | |||
1225 | /* Wake up the sink first */ | 1228 | /* Wake up the sink first */ |
1226 | ironlake_edp_panel_vdd_on(intel_dp); | 1229 | ironlake_edp_panel_vdd_on(intel_dp); |
1227 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); | 1230 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); |
1231 | intel_dp_link_down(intel_dp); | ||
1228 | ironlake_edp_panel_vdd_off(intel_dp, false); | 1232 | ironlake_edp_panel_vdd_off(intel_dp, false); |
1229 | 1233 | ||
1230 | /* Make sure the panel is off before trying to | 1234 | /* Make sure the panel is off before trying to |
1231 | * change the mode | 1235 | * change the mode |
1232 | */ | 1236 | */ |
1233 | ironlake_edp_backlight_off(intel_dp); | ||
1234 | intel_dp_link_down(intel_dp); | ||
1235 | ironlake_edp_panel_off(intel_dp); | ||
1236 | } | 1237 | } |
1237 | 1238 | ||
1238 | static void intel_dp_commit(struct drm_encoder *encoder) | 1239 | static void intel_dp_commit(struct drm_encoder *encoder) |
@@ -1264,16 +1265,20 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
1264 | uint32_t dp_reg = I915_READ(intel_dp->output_reg); | 1265 | uint32_t dp_reg = I915_READ(intel_dp->output_reg); |
1265 | 1266 | ||
1266 | if (mode != DRM_MODE_DPMS_ON) { | 1267 | if (mode != DRM_MODE_DPMS_ON) { |
1268 | ironlake_edp_backlight_off(intel_dp); | ||
1269 | ironlake_edp_panel_off(intel_dp); | ||
1270 | |||
1267 | ironlake_edp_panel_vdd_on(intel_dp); | 1271 | ironlake_edp_panel_vdd_on(intel_dp); |
1268 | if (is_edp(intel_dp)) | ||
1269 | ironlake_edp_backlight_off(intel_dp); | ||
1270 | intel_dp_sink_dpms(intel_dp, mode); | 1272 | intel_dp_sink_dpms(intel_dp, mode); |
1271 | intel_dp_link_down(intel_dp); | 1273 | intel_dp_link_down(intel_dp); |
1272 | ironlake_edp_panel_off(intel_dp); | ||
1273 | if (is_edp(intel_dp) && !is_pch_edp(intel_dp)) | ||
1274 | ironlake_edp_pll_off(encoder); | ||
1275 | ironlake_edp_panel_vdd_off(intel_dp, false); | 1274 | ironlake_edp_panel_vdd_off(intel_dp, false); |
1275 | |||
1276 | if (is_cpu_edp(intel_dp)) | ||
1277 | ironlake_edp_pll_off(encoder); | ||
1276 | } else { | 1278 | } else { |
1279 | if (is_cpu_edp(intel_dp)) | ||
1280 | ironlake_edp_pll_on(encoder); | ||
1281 | |||
1277 | ironlake_edp_panel_vdd_on(intel_dp); | 1282 | ironlake_edp_panel_vdd_on(intel_dp); |
1278 | intel_dp_sink_dpms(intel_dp, mode); | 1283 | intel_dp_sink_dpms(intel_dp, mode); |
1279 | if (!(dp_reg & DP_PORT_EN)) { | 1284 | if (!(dp_reg & DP_PORT_EN)) { |
@@ -1281,7 +1286,6 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
1281 | ironlake_edp_panel_on(intel_dp); | 1286 | ironlake_edp_panel_on(intel_dp); |
1282 | ironlake_edp_panel_vdd_off(intel_dp, true); | 1287 | ironlake_edp_panel_vdd_off(intel_dp, true); |
1283 | intel_dp_complete_link_train(intel_dp); | 1288 | intel_dp_complete_link_train(intel_dp); |
1284 | ironlake_edp_backlight_on(intel_dp); | ||
1285 | } else | 1289 | } else |
1286 | ironlake_edp_panel_vdd_off(intel_dp, false); | 1290 | ironlake_edp_panel_vdd_off(intel_dp, false); |
1287 | ironlake_edp_backlight_on(intel_dp); | 1291 | ironlake_edp_backlight_on(intel_dp); |