aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_notifier.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-02-09 21:59:51 -0500
committerBen Skeggs <bskeggs@redhat.com>2011-02-24 15:46:01 -0500
commit26c0c9e33a2eb44b345d22d5928d5c8b7b261226 (patch)
treed15305e77bfc4547a36cfa9755aeeffb15dd59ce /drivers/gpu/drm/nouveau/nouveau_notifier.c
parentd5f423947a11103c43ad26ebb680d049c2d8edd6 (diff)
drm/nv50-nvc0: delay GART binding until move_notify time
The immediate benefit of doing this is that on NV50 and up, the GPU virtual address of any buffer is now constant, regardless of what memtype they're placed in. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_notifier.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_notifier.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c
index dc8349a3317a..a86f27655fc4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_notifier.c
+++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c
@@ -98,6 +98,7 @@ nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle,
98 int size, uint32_t *b_offset) 98 int size, uint32_t *b_offset)
99{ 99{
100 struct drm_device *dev = chan->dev; 100 struct drm_device *dev = chan->dev;
101 struct drm_nouveau_private *dev_priv = dev->dev_private;
101 struct nouveau_gpuobj *nobj = NULL; 102 struct nouveau_gpuobj *nobj = NULL;
102 struct drm_mm_node *mem; 103 struct drm_mm_node *mem;
103 uint32_t offset; 104 uint32_t offset;
@@ -111,11 +112,16 @@ nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle,
111 return -ENOMEM; 112 return -ENOMEM;
112 } 113 }
113 114
114 if (chan->notifier_bo->bo.mem.mem_type == TTM_PL_VRAM) 115 if (dev_priv->card_type < NV_50) {
115 target = NV_MEM_TARGET_VRAM; 116 if (chan->notifier_bo->bo.mem.mem_type == TTM_PL_VRAM)
116 else 117 target = NV_MEM_TARGET_VRAM;
117 target = NV_MEM_TARGET_GART; 118 else
118 offset = chan->notifier_bo->bo.mem.start << PAGE_SHIFT; 119 target = NV_MEM_TARGET_GART;
120 offset = chan->notifier_bo->bo.mem.start << PAGE_SHIFT;
121 } else {
122 target = NV_MEM_TARGET_VM;
123 offset = chan->notifier_bo->vma.offset;
124 }
119 offset += mem->start; 125 offset += mem->start;
120 126
121 ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY, offset, 127 ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY, offset,