drm/nouveau: modify gpuobj/ntfy takedown ordering
authorBen Skeggs <bskeggs@redhat.com>
Mon, 6 Jun 2011 01:34:27 +0000 (11:34 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 23 Jun 2011 05:59:07 +0000 (15:59 +1000)
gpuobj really needs splitting into channel/gpuobj code instead...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_channel.c
drivers/gpu/drm/nouveau/nouveau_object.c
drivers/gpu/drm/nouveau/nv50_evo.c

index 764dd67..96ac906 100644 (file)
@@ -27,6 +27,7 @@
 #include "nouveau_drv.h"
 #include "nouveau_drm.h"
 #include "nouveau_dma.h"
+#include "nouveau_ramht.h"
 
 static int
 nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan)
@@ -316,8 +317,9 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan)
                nouveau_bo_unpin(chan->pushbuf_bo);
                nouveau_bo_ref(NULL, &chan->pushbuf_bo);
        }
-       nouveau_gpuobj_channel_takedown(chan);
+       nouveau_ramht_ref(NULL, &chan->ramht, chan);
        nouveau_notifier_takedown_channel(chan);
+       nouveau_gpuobj_channel_takedown(chan);
 
        nouveau_channel_ref(NULL, pchan);
 }
index fe95766..c56ac93 100644 (file)
@@ -844,8 +844,6 @@ nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan)
 
        NV_DEBUG(dev, "ch%d\n", chan->id);
 
-       nouveau_ramht_ref(NULL, &chan->ramht, chan);
-
        nouveau_vm_ref(NULL, &chan->vm, chan->vm_pd);
        nouveau_gpuobj_ref(NULL, &chan->vm_pd);
 
index c8e83c1..18c6192 100644 (file)
@@ -38,6 +38,7 @@ nv50_evo_channel_del(struct nouveau_channel **pevo)
                return;
        *pevo = NULL;
 
+       nouveau_ramht_ref(NULL, &evo->ramht, evo);
        nouveau_gpuobj_channel_takedown(evo);
        nouveau_bo_unmap(evo->pushbuf_bo);
        nouveau_bo_ref(NULL, &evo->pushbuf_bo);