aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-03-31 23:26:35 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-05-15 20:48:42 -0400
commit92abe7499239f7b570194b34c50e3772783e2640 (patch)
treeefa78f9ed632e198ff7be30ed09e5114a3c3ab0a
parent39a654d5b90b69acb9423fd9569c9a468737bcb8 (diff)
drm/nouveau: fix suspend failure path to reinitialise all engines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index ba871736fc14..126216fbd789 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,19 +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
212 for (i = NVOBJ_ENGINE_NR - 1; i >= 0; i--) {
213 if (dev_priv->eng[i])
214 dev_priv->eng[i]->fini(dev, i);
215 }
216
217 pfifo->reassign(dev, false); 208 pfifo->reassign(dev, false);
218 pfifo->disable(dev); 209 pfifo->disable(dev);
219 pfifo->unload_context(dev); 210 pfifo->unload_context(dev);
220 if (pgraph->unload_context) 211
221 pgraph->unload_context(dev); 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 }
222 219
223 ret = pinstmem->suspend(dev); 220 ret = pinstmem->suspend(dev);
224 if (ret) { 221 if (ret) {
@@ -249,9 +246,12 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state)
249 246
250out_abort: 247out_abort:
251 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 }
252 pfifo->enable(dev); 253 pfifo->enable(dev);
253 pfifo->reassign(dev, true); 254 pfifo->reassign(dev, true);
254 pgraph->fifo_access(dev, true);
255 return ret; 255 return ret;
256} 256}
257 257