Skip to content

Commit

Permalink
drm/nv50: delete ramfc object after disabling fifo, not before
Browse files Browse the repository at this point in the history
ramfc is zero'ed upon destruction, so it's safer to do things in the right
order.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Maarten Maathuis authored and Ben Skeggs committed Feb 9, 2010
1 parent a51a3bf commit a87ff62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/nouveau/nv50_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,20 @@ void
nv50_fifo_destroy_context(struct nouveau_channel *chan)
{
struct drm_device *dev = chan->dev;
struct nouveau_gpuobj_ref *ramfc = chan->ramfc;

NV_DEBUG(dev, "ch%d\n", chan->id);

nouveau_gpuobj_ref_del(dev, &chan->ramfc);
nouveau_gpuobj_ref_del(dev, &chan->cache);

/* This will ensure the channel is seen as disabled. */
chan->ramfc = NULL;
nv50_fifo_channel_disable(dev, chan->id, false);

/* Dummy channel, also used on ch 127 */
if (chan->id == 0)
nv50_fifo_channel_disable(dev, 127, false);

nouveau_gpuobj_ref_del(dev, &ramfc);
nouveau_gpuobj_ref_del(dev, &chan->cache);
}

int
Expand Down

0 comments on commit a87ff62

Please sign in to comment.