From cdc50eba6ac666447a93471fb2db25959f9c2775 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 24 Jun 2005 08:56:12 +0000 Subject: Fix suspend problem when i915 private hasn't been initialized yet. --- shared-core/i915_pm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'shared-core/i915_pm.c') 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); -- cgit v1.2.3