diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index aa2307080be2..8f4f6bd33ee9 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -106,7 +106,7 @@ static void intel_lvds_enable(struct intel_lvds *intel_lvds) | |||
106 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) | POWER_TARGET_ON); | 106 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) | POWER_TARGET_ON); |
107 | POSTING_READ(lvds_reg); | 107 | POSTING_READ(lvds_reg); |
108 | 108 | ||
109 | intel_panel_set_backlight(dev, dev_priv->backlight_level); | 109 | intel_panel_enable_backlight(dev); |
110 | } | 110 | } |
111 | 111 | ||
112 | static void intel_lvds_disable(struct intel_lvds *intel_lvds) | 112 | static void intel_lvds_disable(struct intel_lvds *intel_lvds) |
@@ -123,8 +123,7 @@ static void intel_lvds_disable(struct intel_lvds *intel_lvds) | |||
123 | lvds_reg = LVDS; | 123 | lvds_reg = LVDS; |
124 | } | 124 | } |
125 | 125 | ||
126 | dev_priv->backlight_level = intel_panel_get_backlight(dev); | 126 | intel_panel_disable_backlight(dev); |
127 | intel_panel_set_backlight(dev, 0); | ||
128 | 127 | ||
129 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); | 128 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); |
130 | 129 | ||
@@ -375,6 +374,10 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
375 | } | 374 | } |
376 | 375 | ||
377 | out: | 376 | out: |
377 | if ((pfit_control & PFIT_ENABLE) == 0) { | ||
378 | pfit_control = 0; | ||
379 | pfit_pgm_ratios = 0; | ||
380 | } | ||
378 | if (pfit_control != intel_lvds->pfit_control || | 381 | if (pfit_control != intel_lvds->pfit_control || |
379 | pfit_pgm_ratios != intel_lvds->pfit_pgm_ratios) { | 382 | pfit_pgm_ratios != intel_lvds->pfit_pgm_ratios) { |
380 | intel_lvds->pfit_control = pfit_control; | 383 | intel_lvds->pfit_control = pfit_control; |
@@ -398,8 +401,6 @@ static void intel_lvds_prepare(struct drm_encoder *encoder) | |||
398 | struct drm_i915_private *dev_priv = dev->dev_private; | 401 | struct drm_i915_private *dev_priv = dev->dev_private; |
399 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); | 402 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); |
400 | 403 | ||
401 | dev_priv->backlight_level = intel_panel_get_backlight(dev); | ||
402 | |||
403 | /* We try to do the minimum that is necessary in order to unlock | 404 | /* We try to do the minimum that is necessary in order to unlock |
404 | * the registers for mode setting. | 405 | * the registers for mode setting. |
405 | * | 406 | * |
@@ -430,9 +431,6 @@ static void intel_lvds_commit(struct drm_encoder *encoder) | |||
430 | struct drm_i915_private *dev_priv = dev->dev_private; | 431 | struct drm_i915_private *dev_priv = dev->dev_private; |
431 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); | 432 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); |
432 | 433 | ||
433 | if (dev_priv->backlight_level == 0) | ||
434 | dev_priv->backlight_level = intel_panel_get_max_backlight(dev); | ||
435 | |||
436 | /* Undo any unlocking done in prepare to prevent accidental | 434 | /* Undo any unlocking done in prepare to prevent accidental |
437 | * adjustment of the registers. | 435 | * adjustment of the registers. |
438 | */ | 436 | */ |