38 static struct mutex power_mutex;
61 if (dev_priv->
ops->init_pm)
62 dev_priv->
ops->init_pm(dev);
73 pm_runtime_disable(&dev->pdev->dev);
74 pm_runtime_set_suspended(&dev->pdev->dev);
89 dev_priv->
ops->save_regs(dev);
90 dev_priv->
ops->power_down(dev);
100 static void gma_resume_display(
struct pci_dev *pdev)
102 struct drm_device *dev = pci_get_drvdata(pdev);
106 dev_priv->
ops->power_up(dev);
113 dev_priv->
ops->restore_regs(dev);
122 static void gma_suspend_pci(
struct pci_dev *pdev)
124 struct drm_device *dev = pci_get_drvdata(pdev);
132 pci_read_config_dword(pdev, 0x5C, &bsm);
133 dev_priv->
regs.saveBSM = bsm;
134 pci_read_config_dword(pdev, 0xFC, &vbt);
135 dev_priv->
regs.saveVBT = vbt;
152 static bool gma_resume_pci(
struct pci_dev *pdev)
154 struct drm_device *dev = pci_get_drvdata(pdev);
163 pci_write_config_dword(pdev, 0x5c, dev_priv->
regs.saveBSM);
164 pci_write_config_dword(pdev, 0xFC, dev_priv->
regs.saveVBT);
171 dev_err(&pdev->
dev,
"pci_enable failed: %d\n", ret);
189 struct drm_device *dev = pci_get_drvdata(pdev);
196 dev_err(dev->dev,
"GPU hardware busy, cannot suspend\n");
200 gma_suspend_display(dev);
201 gma_suspend_pci(pdev);
216 struct drm_device *dev = pci_get_drvdata(pdev);
219 gma_resume_pci(pdev);
220 gma_resume_display(pdev);
257 pm_runtime_get(&dev->pdev->dev);
258 spin_unlock_irqrestore(&power_ctrl_lock, flags);
261 if (force_on ==
false)
265 ret = gma_resume_pci(dev->pdev);
269 pm_runtime_get(&dev->pdev->dev);
271 spin_unlock_irqrestore(&power_ctrl_lock, flags);
275 spin_unlock_irqrestore(&power_ctrl_lock, flags);
293 spin_unlock_irqrestore(&power_ctrl_lock, flags);
294 pm_runtime_put(&dev->pdev->dev);