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

yakui_zhao yakui.zhao at intel.com
Mon Jun 29 07:05:36 CEST 2009


On Mon, 2009-06-29 at 10:44 +0800, Li Peng wrote: 
> On Fri, 2009-06-26 at 16:41 +0800, yakui_zhao wrote:
> > 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?
> 
> I have test VGA and LVDS output, both works well with this patch
Maybe there exist some other output devices and their status is
disconnected. In such case it is unnecessary to call the dpms hook
function for them.

IMO it is enough to call the dpms hook function only for the activated
output device.(Its status is connected). The activated output device
will have a corresponding crtc.

It seems that the function of drm_helper_connector_dpms will firstly
check whether the output device is activated.

So you patch will be OK.
> 
> > Is it enough to call it for the connector that uses the crtc?
> 
> sorry, what would you mean ?
> 
> > how about the crtc register?
> 
> Actually, all connector's dpms func are drm_helper_connector_dpms.
> it will first call crtc dpms, then encoder dpms. 
Yes. What you said is right. The crtc dpms hook function is also called
when calling the connector's dpms functions. 
> 
> > 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