diff options
author | Dave Airlie <airlied@redhat.com> | 2010-12-06 18:20:40 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-01-04 22:45:30 -0500 |
commit | 5bcf719b7db0f9366cedaf102b081f99b1c325ae (patch) | |
tree | 6929d42e1d61a3b1bd7b130a37a80b99718e14aa /drivers/gpu/drm/nouveau/nouveau_drv.c | |
parent | 8d608aa6295242fe4c4b6105b8c59c6a5b232d89 (diff) |
drm/switcheroo: track state of switch in drivers.
We need to track the state of the switch in drivers, so that after s/r
we don't resume the card we've explicitly switched off before. Also
don't allow a userspace open to occur if we've switched the gpu off.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index bb170570938..13bb672a16f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c | |||
@@ -171,6 +171,9 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state) | |||
171 | if (pm_state.event == PM_EVENT_PRETHAW) | 171 | if (pm_state.event == PM_EVENT_PRETHAW) |
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | ||
175 | return 0; | ||
176 | |||
174 | NV_INFO(dev, "Disabling fbcon acceleration...\n"); | 177 | NV_INFO(dev, "Disabling fbcon acceleration...\n"); |
175 | nouveau_fbcon_save_disable_accel(dev); | 178 | nouveau_fbcon_save_disable_accel(dev); |
176 | 179 | ||
@@ -254,6 +257,9 @@ nouveau_pci_resume(struct pci_dev *pdev) | |||
254 | struct drm_crtc *crtc; | 257 | struct drm_crtc *crtc; |
255 | int ret, i; | 258 | int ret, i; |
256 | 259 | ||
260 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | ||
261 | return 0; | ||
262 | |||
257 | nouveau_fbcon_save_disable_accel(dev); | 263 | nouveau_fbcon_save_disable_accel(dev); |
258 | 264 | ||
259 | NV_INFO(dev, "We're back, enabling device...\n"); | 265 | NV_INFO(dev, "We're back, enabling device...\n"); |