diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2005-06-24 08:56:12 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2005-06-24 08:56:12 +0000 |
commit | cdc50eba6ac666447a93471fb2db25959f9c2775 (patch) | |
tree | ac4c3fa466285e3312f6bc81a86f8ff6f9a97806 /shared-core | |
parent | 7586a655fc7d8e89a4fe37ec7926f4fbc13f358d (diff) |
Fix suspend problem when i915 private hasn't been initialized yet.
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/i915_pm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shared-core/i915_pm.c b/shared-core/i915_pm.c index 13fe168e..2f49d583 100644 --- a/shared-core/i915_pm.c +++ b/shared-core/i915_pm.c @@ -45,6 +45,8 @@ static int i915_set_dpms(drm_device_t *dev, int mode) DRM_DEBUG("%s mode=%d\n", __FUNCTION__, mode); + if (!dev_priv) return 0; + I915_WRITE( SRX_INDEX, SR01 ); sr01 = I915_READ( SRX_DATA ); @@ -136,6 +138,9 @@ int i915_suspend( struct pci_dev *pdev, unsigned state ) break; } + pci_disable_device(pdev); + pci_set_power_state(pdev, state); + return 0; } @@ -143,6 +148,9 @@ int i915_resume( struct pci_dev *pdev ) { drm_device_t *dev = (drm_device_t *)pci_get_drvdata(pdev); + pci_enable_device(pdev); + pci_set_power_state(pdev, 0); + /* D0: set DPMS mode on */ i915_set_dpms(dev, 0); |