Commit a87ff62a authored by Maarten Maathuis's avatar Maarten Maathuis Committed by Ben Skeggs

drm/nv50: delete ramfc object after disabling fifo, not before

ramfc is zero'ed upon destruction, so it's safer to do things in the right
order.
Signed-off-by: default avatarMaarten Maathuis <madman2003@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a51a3bf5
...@@ -317,17 +317,20 @@ void ...@@ -317,17 +317,20 @@ void
nv50_fifo_destroy_context(struct nouveau_channel *chan) nv50_fifo_destroy_context(struct nouveau_channel *chan)
{ {
struct drm_device *dev = chan->dev; struct drm_device *dev = chan->dev;
struct nouveau_gpuobj_ref *ramfc = chan->ramfc;
NV_DEBUG(dev, "ch%d\n", chan->id); NV_DEBUG(dev, "ch%d\n", chan->id);
nouveau_gpuobj_ref_del(dev, &chan->ramfc); /* This will ensure the channel is seen as disabled. */
nouveau_gpuobj_ref_del(dev, &chan->cache); chan->ramfc = NULL;
nv50_fifo_channel_disable(dev, chan->id, false); nv50_fifo_channel_disable(dev, chan->id, false);
/* Dummy channel, also used on ch 127 */ /* Dummy channel, also used on ch 127 */
if (chan->id == 0) if (chan->id == 0)
nv50_fifo_channel_disable(dev, 127, false); nv50_fifo_channel_disable(dev, 127, false);
nouveau_gpuobj_ref_del(dev, &ramfc);
nouveau_gpuobj_ref_del(dev, &chan->cache);
} }
int int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment