diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-06-06 23:17:45 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-06-23 02:00:04 -0400 |
commit | 0b7187335fc2f38691cc169b202ff436abbefd68 (patch) | |
tree | a2d82409203536fc6bd607318c36e54274602c8b | |
parent | 45143cb53c793b11b875d555eb96ca32bcbea1c7 (diff) |
drm/nv50-nvc0: explicitly map notifier bo into channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_notifier.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_fbcon.c | 4 |
3 files changed, 15 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 23be8cb8ff54..78d6899a8388 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -249,6 +249,7 @@ struct nouveau_channel { | |||
249 | 249 | ||
250 | /* Notifier memory */ | 250 | /* Notifier memory */ |
251 | struct nouveau_bo *notifier_bo; | 251 | struct nouveau_bo *notifier_bo; |
252 | struct nouveau_vma notifier_vma; | ||
252 | struct drm_mm notifier_heap; | 253 | struct drm_mm notifier_heap; |
253 | 254 | ||
254 | /* PFIFO context */ | 255 | /* PFIFO context */ |
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c index 81b54e0bb822..6abdbe6530a7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_notifier.c +++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c | |||
@@ -34,6 +34,7 @@ int | |||
34 | nouveau_notifier_init_channel(struct nouveau_channel *chan) | 34 | nouveau_notifier_init_channel(struct nouveau_channel *chan) |
35 | { | 35 | { |
36 | struct drm_device *dev = chan->dev; | 36 | struct drm_device *dev = chan->dev; |
37 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
37 | struct nouveau_bo *ntfy = NULL; | 38 | struct nouveau_bo *ntfy = NULL; |
38 | uint32_t flags, ttmpl; | 39 | uint32_t flags, ttmpl; |
39 | int ret; | 40 | int ret; |
@@ -58,14 +59,22 @@ nouveau_notifier_init_channel(struct nouveau_channel *chan) | |||
58 | if (ret) | 59 | if (ret) |
59 | goto out_err; | 60 | goto out_err; |
60 | 61 | ||
62 | if (dev_priv->card_type >= NV_50) { | ||
63 | ret = nouveau_bo_vma_add(ntfy, chan->vm, &chan->notifier_vma); | ||
64 | if (ret) | ||
65 | goto out_err; | ||
66 | } | ||
67 | |||
61 | ret = drm_mm_init(&chan->notifier_heap, 0, ntfy->bo.mem.size); | 68 | ret = drm_mm_init(&chan->notifier_heap, 0, ntfy->bo.mem.size); |
62 | if (ret) | 69 | if (ret) |
63 | goto out_err; | 70 | goto out_err; |
64 | 71 | ||
65 | chan->notifier_bo = ntfy; | 72 | chan->notifier_bo = ntfy; |
66 | out_err: | 73 | out_err: |
67 | if (ret) | 74 | if (ret) { |
75 | nouveau_bo_vma_del(ntfy, &chan->notifier_vma); | ||
68 | drm_gem_object_unreference_unlocked(ntfy->gem); | 76 | drm_gem_object_unreference_unlocked(ntfy->gem); |
77 | } | ||
69 | 78 | ||
70 | return ret; | 79 | return ret; |
71 | } | 80 | } |
@@ -78,6 +87,7 @@ nouveau_notifier_takedown_channel(struct nouveau_channel *chan) | |||
78 | if (!chan->notifier_bo) | 87 | if (!chan->notifier_bo) |
79 | return; | 88 | return; |
80 | 89 | ||
90 | nouveau_bo_vma_del(chan->notifier_bo, &chan->notifier_vma); | ||
81 | nouveau_bo_unmap(chan->notifier_bo); | 91 | nouveau_bo_unmap(chan->notifier_bo); |
82 | mutex_lock(&dev->struct_mutex); | 92 | mutex_lock(&dev->struct_mutex); |
83 | nouveau_bo_unpin(chan->notifier_bo); | 93 | nouveau_bo_unpin(chan->notifier_bo); |
@@ -125,7 +135,7 @@ nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, | |||
125 | offset = chan->notifier_bo->bo.offset; | 135 | offset = chan->notifier_bo->bo.offset; |
126 | } else { | 136 | } else { |
127 | target = NV_MEM_TARGET_VM; | 137 | target = NV_MEM_TARGET_VM; |
128 | offset = chan->notifier_bo->vma.offset; | 138 | offset = chan->notifier_vma.offset; |
129 | } | 139 | } |
130 | offset += mem->start; | 140 | offset += mem->start; |
131 | 141 | ||
diff --git a/drivers/gpu/drm/nouveau/nvc0_fbcon.c b/drivers/gpu/drm/nouveau/nvc0_fbcon.c index 5e64a9bcd318..a495e48197ca 100644 --- a/drivers/gpu/drm/nouveau/nvc0_fbcon.c +++ b/drivers/gpu/drm/nouveau/nvc0_fbcon.c | |||
@@ -203,8 +203,8 @@ nvc0_fbcon_accel_init(struct fb_info *info) | |||
203 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0000, 1); | 203 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0000, 1); |
204 | OUT_RING (chan, 0x0000902d); | 204 | OUT_RING (chan, 0x0000902d); |
205 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0104, 2); | 205 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0104, 2); |
206 | OUT_RING (chan, upper_32_bits(chan->notifier_bo->vma.offset)); | 206 | OUT_RING (chan, upper_32_bits(chan->notifier_vma.offset)); |
207 | OUT_RING (chan, lower_32_bits(chan->notifier_bo->vma.offset)); | 207 | OUT_RING (chan, lower_32_bits(chan->notifier_vma.offset)); |
208 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0290, 1); | 208 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0290, 1); |
209 | OUT_RING (chan, 0); | 209 | OUT_RING (chan, 0); |
210 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0888, 1); | 210 | BEGIN_NVC0(chan, 2, NvSub2D, 0x0888, 1); |