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

yakui_zhao yakui.zhao at intel.com
Fri Jun 26 10:41:26 CEST 2009


On Fri, 2009-06-26 at 11:32 +0800, Li Peng wrote:
> >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.
Is it necessary to call the dpms hook functin for every output
connector?
Is it enough to call it for the connector that uses the crtc?

how about the crtc register?
Thanks.
> 
> 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 */




More information about the Intel-gfx mailing list