diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index 155ebdcbf06f..02c6f37d8bd7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c | |||
@@ -162,11 +162,10 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state) | |||
162 | struct drm_device *dev = pci_get_drvdata(pdev); | 162 | struct drm_device *dev = pci_get_drvdata(pdev); |
163 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 163 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
164 | struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem; | 164 | struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem; |
165 | struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; | ||
166 | struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; | 165 | struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; |
167 | struct nouveau_channel *chan; | 166 | struct nouveau_channel *chan; |
168 | struct drm_crtc *crtc; | 167 | struct drm_crtc *crtc; |
169 | int ret, i; | 168 | int ret, i, e; |
170 | 169 | ||
171 | if (pm_state.event == PM_EVENT_PRETHAW) | 170 | if (pm_state.event == PM_EVENT_PRETHAW) |
172 | return 0; | 171 | return 0; |
@@ -206,12 +205,17 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state) | |||
206 | nouveau_channel_idle(chan); | 205 | nouveau_channel_idle(chan); |
207 | } | 206 | } |
208 | 207 | ||
209 | pgraph->fifo_access(dev, false); | ||
210 | nouveau_wait_for_idle(dev); | ||
211 | pfifo->reassign(dev, false); | 208 | pfifo->reassign(dev, false); |
212 | pfifo->disable(dev); | 209 | pfifo->disable(dev); |
213 | pfifo->unload_context(dev); | 210 | pfifo->unload_context(dev); |
214 | pgraph->unload_context(dev); | 211 | |
212 | for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) { | ||
213 | if (dev_priv->eng[e]) { | ||
214 | ret = dev_priv->eng[e]->fini(dev, e); | ||
215 | if (ret) | ||
216 | goto out_abort; | ||
217 | } | ||
218 | } | ||
215 | 219 | ||
216 | ret = pinstmem->suspend(dev); | 220 | ret = pinstmem->suspend(dev); |
217 | if (ret) { | 221 | if (ret) { |
@@ -242,9 +246,12 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state) | |||
242 | 246 | ||
243 | out_abort: | 247 | out_abort: |
244 | NV_INFO(dev, "Re-enabling acceleration..\n"); | 248 | NV_INFO(dev, "Re-enabling acceleration..\n"); |
249 | for (e = e + 1; e < NVOBJ_ENGINE_NR; e++) { | ||
250 | if (dev_priv->eng[e]) | ||
251 | dev_priv->eng[e]->init(dev, e); | ||
252 | } | ||
245 | pfifo->enable(dev); | 253 | pfifo->enable(dev); |
246 | pfifo->reassign(dev, true); | 254 | pfifo->reassign(dev, true); |
247 | pgraph->fifo_access(dev, true); | ||
248 | return ret; | 255 | return ret; |
249 | } | 256 | } |
250 | 257 | ||
@@ -299,8 +306,10 @@ nouveau_pci_resume(struct pci_dev *pdev) | |||
299 | engine->mc.init(dev); | 306 | engine->mc.init(dev); |
300 | engine->timer.init(dev); | 307 | engine->timer.init(dev); |
301 | engine->fb.init(dev); | 308 | engine->fb.init(dev); |
302 | engine->graph.init(dev); | 309 | for (i = 0; i < NVOBJ_ENGINE_NR; i++) { |
303 | engine->crypt.init(dev); | 310 | if (dev_priv->eng[i]) |
311 | dev_priv->eng[i]->init(dev, i); | ||
312 | } | ||
304 | engine->fifo.init(dev); | 313 | engine->fifo.init(dev); |
305 | 314 | ||
306 | nouveau_irq_postinstall(dev); | 315 | nouveau_irq_postinstall(dev); |