summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bennett <sb476@cam.ac.uk>2009-01-29 23:39:50 +0000
committerStuart Bennett <sb476@cam.ac.uk>2009-01-29 23:59:47 +0000
commit854bd8f2cae8389d1152993a1d751687632df323 (patch)
treeadbbf53dd0ef6ed4184a210d1b52e542765e5497
parent408fc85a21689ee9859b64cb90902242bbc7e314 (diff)
nouveau: don't save channel context if it has recently become invalid
Bug exposed by DDX change d9da090c
-rw-r--r--shared-core/nouveau_state.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c
index e0419423..4e0140a5 100644
--- a/shared-core/nouveau_state.c
+++ b/shared-core/nouveau_state.c
@@ -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++)