[Intel-gfx] [PATCH 3/3] drm/i915: allow PCH PWM override on IVB

Jesse Barnes jbarnes at virtuousgeek.org
Tue Apr 10 20:58:05 CEST 2012


On IVB, there are two sets of panel backlight regs: one in the CPU and
one in the PCH.  The CPU ones aren't generally used, so on IVB make sure
we allow the PCH regs to actually control the backlight.

Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_panel.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index cad45ff..b007c4e 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -306,6 +306,18 @@ static void intel_panel_init_backlight(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	/*
+	 * IVB has CPU eDP backlight regs too, set things up to let the
+	 * PCH regs control the backlight
+	 */
+	if (IS_IVYBRIDGE(dev)) {
+		u32 pwm;
+
+		I915_WRITE(BLC_PWM_CPU_CTL2, PWM_ENABLE);
+		I915_WRITE(BLC_PWM_CPU_CTL, 0);
+		I915_WRITE(BLC_PWM_PCH_CTL1, PWM_ENABLE | (1<<30));
+	}
+
 	dev_priv->backlight_level = intel_panel_get_backlight(dev);
 	dev_priv->backlight_enabled = dev_priv->backlight_level != 0;
 }
-- 
1.7.4.1




More information about the Intel-gfx mailing list