summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2007-04-17 22:27:46 +0200
committerJakob Bornecrantz <wallbraker@gmail.com>2007-04-17 22:27:46 +0200
commita45fa264f2b60185ae797f85d2084d57de49bbca (patch)
treedb8d90d0b47f24fd5e0d05163d806d9e55440f36
parent1c7f895fa6531b16e7e9fd4568d4f6a50ca5711e (diff)
Lvds now power up backlight on commit
Now saves previous power level in prepare and sets that power level in commit, should power level be 0 it will set maximum level.
-rw-r--r--linux-core/intel_display.c2
-rw-r--r--linux-core/intel_lvds.c28
2 files changed, 28 insertions, 2 deletions
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index 48239329..d0a3a465 100644
--- a/linux-core/intel_display.c
+++ b/linux-core/intel_display.c
@@ -539,11 +539,13 @@ static void intel_crtc_commit (struct drm_crtc *crtc)
void intel_output_prepare (struct drm_output *output)
{
+ /* lvds has its own version of prepare see intel_lvds_prepare */
output->funcs->dpms(output, DPMSModeOff);
}
void intel_output_commit (struct drm_output *output)
{
+ /* lvds has its own version of commit see intel_lvds_commit */
output->funcs->dpms(output, DPMSModeOn);
}
diff --git a/linux-core/intel_lvds.c b/linux-core/intel_lvds.c
index db025417..8454bbcf 100644
--- a/linux-core/intel_lvds.c
+++ b/linux-core/intel_lvds.c
@@ -209,6 +209,30 @@ static bool intel_lvds_mode_fixup(struct drm_output *output,
return true;
}
+static void intel_lvds_prepare(struct drm_output *output)
+{
+ struct drm_device *dev = output->dev;
+ drm_i915_private_t *dev_priv = dev->dev_private;
+
+ dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
+ dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL &
+ BACKLIGHT_DUTY_CYCLE_MASK);
+
+ intel_lvds_set_power(dev, false);
+}
+
+static void intel_lvds_commit( struct drm_output *output)
+{
+ struct drm_device *dev = output->dev;
+ drm_i915_private_t *dev_priv = dev->dev_private;
+
+ if (dev_priv->backlight_duty_cycle == 0)
+ dev_priv->backlight_duty_cycle =
+ intel_lvds_get_max_backlight(dev);
+
+ intel_lvds_set_power(dev, true);
+}
+
static void intel_lvds_mode_set(struct drm_output *output,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
@@ -321,9 +345,9 @@ static const struct drm_output_funcs intel_lvds_output_funcs = {
.restore = intel_lvds_restore,
.mode_valid = intel_lvds_mode_valid,
.mode_fixup = intel_lvds_mode_fixup,
- .prepare = intel_output_prepare,
+ .prepare = intel_lvds_prepare,
.mode_set = intel_lvds_mode_set,
- .commit = intel_output_commit,
+ .commit = intel_lvds_commit,
.detect = intel_lvds_detect,
.get_modes = intel_lvds_get_modes,
.cleanup = intel_lvds_destroy