Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321662
b: refs/heads/master
c: 2064db7
h: refs/heads/master
v: v3
  • Loading branch information
Maxim Levitsky authored and Ben Skeggs committed Aug 13, 2012
1 parent 254c3f5 commit 3860daf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe0aac129c247be62fd8ad697ff510523fd71f74
refs/heads/master: 2064db725cc6d4ea19a24c138bc37939b63e3ae6
9 changes: 9 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv84_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,22 @@ nv84_fifo_context_del(struct nouveau_channel *chan, int engine)
struct drm_device *dev = chan->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private;
unsigned long flags;
u32 save;

/* remove channel from playlist, will context switch if active */
spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
nv_mask(dev, 0x002600 + (chan->id * 4), 0x80000000, 0x00000000);
nv50_fifo_playlist_update(dev);

save = nv_mask(dev, 0x002520, 0x0000003f, 0x15);

/* tell any engines on this channel to unload their contexts */
nv_wr32(dev, 0x0032fc, chan->ramin->vinst >> 12);
if (!nv_wait_ne(dev, 0x0032fc, 0xffffffff, 0xffffffff))
NV_INFO(dev, "PFIFO: channel %d unload timeout\n", chan->id);

nv_wr32(dev, 0x002520, save);

nv_wr32(dev, 0x002600 + (chan->id * 4), 0x00000000);
spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);

Expand Down Expand Up @@ -184,10 +189,13 @@ nv84_fifo_fini(struct drm_device *dev, int engine, bool suspend)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nv84_fifo_priv *priv = nv_engine(dev, engine);
int i;
u32 save;

/* set playlist length to zero, fifo will unload context */
nv_wr32(dev, 0x0032ec, 0);

save = nv_mask(dev, 0x002520, 0x0000003f, 0x15);

/* tell all connected engines to unload their contexts */
for (i = 0; i < priv->base.channels; i++) {
struct nouveau_channel *chan = dev_priv->channels.ptr[i];
Expand All @@ -199,6 +207,7 @@ nv84_fifo_fini(struct drm_device *dev, int engine, bool suspend)
}
}

nv_wr32(dev, 0x002520, save);
nv_wr32(dev, 0x002140, 0);
return 0;
}
Expand Down

0 comments on commit 3860daf

Please sign in to comment.