[Intel-gfx] [Patch 5/5]: DRM/I915: Sync the LVDS save/restore function with intel driver

yakui_zhao yakui.zhao at intel.com
Tue Mar 3 11:09:55 CET 2009


Subject: Patch DRM/I915: Sync the LVDS save/restore function with intel driver
From: Zhao Yakui <yakui.zhao at intel.com>

    Sync the LVDS save/restore functin with intel driver. At the same time
the possible_crtcs/clones for LVDS is added explicitly.

Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h   |    2 ++
 drivers/gpu/drm/i915/intel_lvds.c |   21 ++++++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/intel_lvds.c
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_lvds.c	2009-03-03 17:58:26.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_lvds.c	2009-03-03 18:01:19.000000000 +0800
@@ -58,9 +58,17 @@
 static u32 intel_lvds_get_max_backlight(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	u32 value, pm_ctl;
 
-	return ((I915_READ(BLC_PWM_CTL) & BACKLIGHT_MODULATION_FREQ_MASK) >>
-		BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
+	pm_ctl = I915_READ(BLC_PWM_CTL);
+
+	if (IS_I965GM(dev) || IS_GM45(dev))
+		value = (pm_ctl & BACKLIGHT_MODULATION_FREQ_MASK2) >>
+			BACKLIGHT_MODULATION_FREQ_SHIFT2;
+	else
+		value = ((pm_ctl & BACKLIGHT_MODULATION_FREQ_MASK) >>
+			BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
+	return value;
 }
 
 /**
@@ -107,6 +115,9 @@
 	struct drm_device *dev = connector->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_I965GM(dev) || IS_GM45(dev))
+		dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
+
 	dev_priv->savePP_ON = I915_READ(PP_ON_DELAYS);
 	dev_priv->savePP_OFF = I915_READ(PP_OFF_DELAYS);
 	dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
@@ -128,6 +139,9 @@
 	struct drm_device *dev = connector->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_I965GM(dev) || IS_GM45(dev))
+		I915_WRITE(BLC_PWM_CTL2, dev_priv->saveBLC_PWM_CTL2);
+
 	I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
 	I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON);
 	I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF);
@@ -440,7 +454,8 @@
 	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
-
+	encoder->possible_crtcs = (1 << 1);
+	encoder->possible_clones = (1 << INTEL_OUTPUT_LVDS);
 
 	/*
 	 * LVDS discovery:
Index: linux-2.6/drivers/gpu/drm/i915/i915_reg.h
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/i915_reg.h	2009-03-03 18:01:04.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/i915_reg.h	2009-03-03 18:01:19.000000000 +0800
@@ -815,6 +815,7 @@
 /* Backlight control */
 #define BLC_PWM_CTL		0x61254
 #define   BACKLIGHT_MODULATION_FREQ_SHIFT		(17)
+#define   BACKLIGHT_MODULATION_FREQ_SHIFT2		(16)
 #define BLC_PWM_CTL2		0x61250 /* 965+ only */
 #define   BLM_COMBINATION_MODE (1 << 30)
 /*
@@ -824,6 +825,7 @@
  * The actual value is this field multiplied by two.
  */
 #define   BACKLIGHT_MODULATION_FREQ_MASK		(0x7fff << 17)
+#define   BACKLIGHT_MODULATION_FREQ_MASK2		(0xffff << 17)
 #define   BLM_LEGACY_MODE				(1 << 16)
 /*
  * This is the number of cycles out of the backlight modulation cycle for which





More information about the Intel-gfx mailing list