[Intel-gfx] [PATCH] drm/i915 : Turn off/on connector dpms across suspend/resume

Li Peng peng.li at linux.intel.com
Fri Jun 26 05:32:05 CEST 2009


>From f8858c66fb2729c7a8fbaf00f34d0706e5bff11b Mon Sep 17 00:00:00 2001
From: Li Peng <peng.li at intel.com>
Date: Fri, 26 Jun 2009 11:39:20 +0800
Subject: Turn off/on connector dpms across suspend/resume

For SDVO output, save/restore registers is not enough to
make suspend/resume work. we need to call connector's dpms
func to enable the output, This fixes suspend/resume from
console on Asus Eeetop, which has a SDVO-LVDS output.

Signed-off-by: Li Peng <peng.li at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e3cb402..b3d8ef8 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -55,6 +55,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 static int i915_suspend(struct drm_device *dev, pm_message_t state)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_connector *connector;
 
 	if (!dev || !dev_priv) {
 		printk(KERN_ERR "dev: %p, dev_priv: %p\n", dev, dev_priv);
@@ -75,6 +76,9 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
 		drm_irq_uninstall(dev);
 	}
 
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+		connector->funcs->dpms(connector, DRM_MODE_DPMS_OFF);
+
 	i915_save_state(dev);
 
 	intel_opregion_free(dev, 1);
@@ -91,6 +95,7 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
 static int i915_resume(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_connector *connector;
 	int ret = 0;
 
 	pci_set_power_state(dev->pdev, PCI_D0);
@@ -101,6 +106,9 @@ static int i915_resume(struct drm_device *dev)
 
 	i915_restore_state(dev);
 
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+		connector->funcs->dpms(connector, DRM_MODE_DPMS_ON);
+
 	intel_opregion_init(dev, 1);
 
 	/* KMS EnterVT equivalent */
-- 
1.6.1.3






More information about the Intel-gfx mailing list