diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2008-06-25 16:45:41 +1000 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2008-06-25 09:55:19 +0200 |
commit | be7276281694145e7c947b91a1c8e6e347de666c (patch) | |
tree | b5a2aca1d8562f0833b14180a63b25b2232e53d4 /shared-core | |
parent | 5a0164d1e1799b68b3131efd7b9fcaf20c578257 (diff) |
nv50: when destroying a channel make sure it's not still current on PFIFO
We won't get a PFIFO context switch when the same channel ID is recreated if
the hw still thinks the channel is already active, which causes fun issues.
Should allow X to be stopped and started without tearing down the entire
card state in lastclose().
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/nv50_fifo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/shared-core/nv50_fifo.c b/shared-core/nv50_fifo.c index edf4edbf..d6810666 100644 --- a/shared-core/nv50_fifo.c +++ b/shared-core/nv50_fifo.c @@ -289,6 +289,7 @@ void nv50_fifo_destroy_context(struct nouveau_channel *chan) { struct drm_device *dev = chan->dev; + struct drm_nouveau_private *dev_priv = dev->dev_private; DRM_DEBUG("ch%d\n", chan->id); @@ -298,6 +299,9 @@ nv50_fifo_destroy_context(struct nouveau_channel *chan) if (chan->id == 0) nv50_fifo_channel_disable(dev, 127, 0); + if ((NV_READ(NV03_PFIFO_CACHE1_PUSH1) & 0xffff) == chan->id) + NV_WRITE(NV03_PFIFO_CACHE1_PUSH1, 127); + nouveau_gpuobj_ref_del(dev, &chan->ramfc); } |