Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nv50-nvc0: explicitly map notifier bo into channel vm

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+15 -4
+1
drivers/gpu/drm/nouveau/nouveau_drv.h
··· 249 249 250 250 /* Notifier memory */ 251 251 struct nouveau_bo *notifier_bo; 252 + struct nouveau_vma notifier_vma; 252 253 struct drm_mm notifier_heap; 253 254 254 255 /* PFIFO context */
+12 -2
drivers/gpu/drm/nouveau/nouveau_notifier.c
··· 34 34 nouveau_notifier_init_channel(struct nouveau_channel *chan) 35 35 { 36 36 struct drm_device *dev = chan->dev; 37 + struct drm_nouveau_private *dev_priv = dev->dev_private; 37 38 struct nouveau_bo *ntfy = NULL; 38 39 uint32_t flags, ttmpl; 39 40 int ret; ··· 59 58 if (ret) 60 59 goto out_err; 61 60 61 + if (dev_priv->card_type >= NV_50) { 62 + ret = nouveau_bo_vma_add(ntfy, chan->vm, &chan->notifier_vma); 63 + if (ret) 64 + goto out_err; 65 + } 66 + 62 67 ret = drm_mm_init(&chan->notifier_heap, 0, ntfy->bo.mem.size); 63 68 if (ret) 64 69 goto out_err; 65 70 66 71 chan->notifier_bo = ntfy; 67 72 out_err: 68 - if (ret) 73 + if (ret) { 74 + nouveau_bo_vma_del(ntfy, &chan->notifier_vma); 69 75 drm_gem_object_unreference_unlocked(ntfy->gem); 76 + } 70 77 71 78 return ret; 72 79 } ··· 87 78 if (!chan->notifier_bo) 88 79 return; 89 80 81 + nouveau_bo_vma_del(chan->notifier_bo, &chan->notifier_vma); 90 82 nouveau_bo_unmap(chan->notifier_bo); 91 83 mutex_lock(&dev->struct_mutex); 92 84 nouveau_bo_unpin(chan->notifier_bo); ··· 135 125 offset = chan->notifier_bo->bo.offset; 136 126 } else { 137 127 target = NV_MEM_TARGET_VM; 138 - offset = chan->notifier_bo->vma.offset; 128 + offset = chan->notifier_vma.offset; 139 129 } 140 130 offset += mem->start; 141 131
+2 -2
drivers/gpu/drm/nouveau/nvc0_fbcon.c
··· 203 203 BEGIN_NVC0(chan, 2, NvSub2D, 0x0000, 1); 204 204 OUT_RING (chan, 0x0000902d); 205 205 BEGIN_NVC0(chan, 2, NvSub2D, 0x0104, 2); 206 - OUT_RING (chan, upper_32_bits(chan->notifier_bo->vma.offset)); 207 - OUT_RING (chan, lower_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_vma.offset)); 208 208 BEGIN_NVC0(chan, 2, NvSub2D, 0x0290, 1); 209 209 OUT_RING (chan, 0); 210 210 BEGIN_NVC0(chan, 2, NvSub2D, 0x0888, 1);