nouveau: don't save channel context if it has recently become invalid

Bug exposed by DDX change d9da090c
main
Stuart Bennett 2009-01-29 23:39:50 +00:00
parent 408fc85a21
commit 854bd8f2ca
1 changed files with 7 additions and 2 deletions

View File

@ -707,6 +707,7 @@ static int nouveau_suspend(struct drm_device *dev)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_suspend_resume *susres = &dev_priv->susres;
struct nouveau_engine *engine = &dev_priv->Engine;
struct nouveau_channel *current_fifo;
int i;
if (dev_priv->card_type >= NV_50) {
@ -758,8 +759,12 @@ static int nouveau_suspend(struct drm_device *dev)
susres->graph_ctx_control = NV_READ(NV04_PGRAPH_CTX_CONTROL);
}
engine->fifo.save_context(dev_priv->fifos[engine->fifo.channel_id(dev)]);
engine->graph.save_context(dev_priv->fifos[engine->fifo.channel_id(dev)]);
current_fifo = dev_priv->fifos[engine->fifo.channel_id(dev)];
/* channel may have been deleted but no replacement yet loaded */
if (current_fifo) {
engine->fifo.save_context(current_fifo);
engine->graph.save_context(current_fifo);
}
nouveau_wait_for_idle(dev);
for (i = 0; i < susres->ramin_size / 4; i++)