Browse Source

drm/nv50: fix two potential suspend/resume oopses

This avoids touching the dummy channel 0/127 we have on nv50.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs 15 years ago
parent
commit
3c8868d3db
2 changed files with 2 additions and 2 deletions
  1. 1 1
      drivers/gpu/drm/nouveau/nouveau_drv.c
  2. 1 1
      drivers/gpu/drm/nouveau/nv50_fifo.c

+ 1 - 1
drivers/gpu/drm/nouveau/nouveau_drv.c

@@ -277,7 +277,7 @@ nouveau_pci_resume(struct pci_dev *pdev)
 
 
 		for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
 		for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
 			chan = dev_priv->fifos[i];
 			chan = dev_priv->fifos[i];
-			if (!chan)
+			if (!chan || !chan->pushbuf_bo)
 				continue;
 				continue;
 
 
 			for (j = 0; j < NOUVEAU_DMA_SKIPS; j++)
 			for (j = 0; j < NOUVEAU_DMA_SKIPS; j++)

+ 1 - 1
drivers/gpu/drm/nouveau/nv50_fifo.c

@@ -416,7 +416,7 @@ nv50_fifo_unload_context(struct drm_device *dev)
 	NV_DEBUG(dev, "\n");
 	NV_DEBUG(dev, "\n");
 
 
 	chid = pfifo->channel_id(dev);
 	chid = pfifo->channel_id(dev);
-	if (chid < 0 || chid >= dev_priv->engine.fifo.channels)
+	if (chid < 1 || chid >= dev_priv->engine.fifo.channels - 1)
 		return 0;
 		return 0;
 
 
 	chan = dev_priv->fifos[chid];
 	chan = dev_priv->fifos[chid];