diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-06-07 13:20:43 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-06-23 16:00:09 +1000 |
commit | ce163f6967121d77e3983aa06d416afacf3070c2 (patch) | |
tree | b1b61dc0412a020c4ab41cd87a19514ed26dd2f6 /drivers/gpu/drm/nouveau/nouveau_channel.c | |
parent | 0b7187335fc2f38691cc169b202ff436abbefd68 (diff) | |
download | talos-op-linux-ce163f6967121d77e3983aa06d416afacf3070c2.tar.gz talos-op-linux-ce163f6967121d77e3983aa06d416afacf3070c2.zip |
drm/nv50-nvc0: explicitly map pushbuf bo into channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_channel.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_channel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c index d0e458336c75..c03fa7b6944e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_channel.c +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c @@ -56,6 +56,11 @@ nouveau_channel_pushbuf_init(struct nouveau_channel *chan) */ chan->pushbuf_base = chan->pushbuf_bo->bo.offset; if (dev_priv->card_type >= NV_50) { + ret = nouveau_bo_vma_add(chan->pushbuf_bo, chan->vm, + &chan->pushbuf_vma); + if (ret) + goto out; + if (dev_priv->card_type < NV_C0) { ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY, 0, @@ -64,7 +69,7 @@ nouveau_channel_pushbuf_init(struct nouveau_channel *chan) NV_MEM_TARGET_VM, &chan->pushbuf); } - chan->pushbuf_base = chan->pushbuf_bo->vma.offset; + chan->pushbuf_base = chan->pushbuf_vma.offset; } else if (chan->pushbuf_bo->bo.mem.mem_type == TTM_PL_TT) { ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY, 0, @@ -95,6 +100,7 @@ nouveau_channel_pushbuf_init(struct nouveau_channel *chan) out: if (ret) { NV_ERROR(dev, "error initialising pushbuf: %d\n", ret); + nouveau_bo_vma_del(chan->pushbuf_bo, &chan->pushbuf_vma); nouveau_gpuobj_ref(NULL, &chan->pushbuf); if (chan->pushbuf_bo) { nouveau_bo_unmap(chan->pushbuf_bo); @@ -295,6 +301,7 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan) /* destroy any resources the channel owned */ nouveau_gpuobj_ref(NULL, &chan->pushbuf); if (chan->pushbuf_bo) { + nouveau_bo_vma_del(chan->pushbuf_bo, &chan->pushbuf_vma); nouveau_bo_unmap(chan->pushbuf_bo); nouveau_bo_unpin(chan->pushbuf_bo); nouveau_bo_ref(NULL, &chan->pushbuf_bo); |