aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_dma.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-03-17 10:40:41 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-03-22 03:17:46 -0400
commit48aca13f0167ae78c28c6b48d82a157a6692eecb (patch)
tree54937c4fc0e8f19fcf2d8abfb35a82798f85ce96 /drivers/gpu/drm/nouveau/nouveau_dma.c
parentd5316e251230c4e54a157349a362229c3d4daa32 (diff)
drm/nouveau: remove m2mf creation on userspace channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_dma.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_dma.c61
1 files changed, 1 insertions, 60 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c
index 4c2e4e5925fe..295932e66ac5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dma.c
@@ -31,7 +31,7 @@
31#include "nouveau_ramht.h" 31#include "nouveau_ramht.h"
32 32
33void 33void
34nouveau_dma_pre_init(struct nouveau_channel *chan) 34nouveau_dma_init(struct nouveau_channel *chan)
35{ 35{
36 struct drm_nouveau_private *dev_priv = chan->dev->dev_private; 36 struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
37 struct nouveau_bo *pushbuf = chan->pushbuf_bo; 37 struct nouveau_bo *pushbuf = chan->pushbuf_bo;
@@ -54,65 +54,6 @@ nouveau_dma_pre_init(struct nouveau_channel *chan)
54 chan->dma.free = chan->dma.max - chan->dma.cur; 54 chan->dma.free = chan->dma.max - chan->dma.cur;
55} 55}
56 56
57int
58nouveau_dma_init(struct nouveau_channel *chan)
59{
60 struct drm_device *dev = chan->dev;
61 struct drm_nouveau_private *dev_priv = dev->dev_private;
62 int ret, i;
63
64 if (dev_priv->card_type >= NV_C0) {
65 ret = nouveau_gpuobj_gr_new(chan, 0x9039, 0x9039);
66 if (ret)
67 return ret;
68
69 ret = RING_SPACE(chan, 2);
70 if (ret)
71 return ret;
72
73 BEGIN_NVC0(chan, 2, NvSubM2MF, 0x0000, 1);
74 OUT_RING (chan, 0x00009039);
75 FIRE_RING (chan);
76 return 0;
77 }
78
79 /* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */
80 ret = nouveau_gpuobj_gr_new(chan, NvM2MF, dev_priv->card_type < NV_50 ?
81 0x0039 : 0x5039);
82 if (ret)
83 return ret;
84
85 /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */
86 ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfe0, 0x1000,
87 &chan->m2mf_ntfy);
88 if (ret)
89 return ret;
90
91 /* Insert NOPS for NOUVEAU_DMA_SKIPS */
92 ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS);
93 if (ret)
94 return ret;
95
96 for (i = 0; i < NOUVEAU_DMA_SKIPS; i++)
97 OUT_RING(chan, 0);
98
99 /* Initialise NV_MEMORY_TO_MEMORY_FORMAT */
100 ret = RING_SPACE(chan, 6);
101 if (ret)
102 return ret;
103 BEGIN_RING(chan, NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_NAME, 1);
104 OUT_RING (chan, NvM2MF);
105 BEGIN_RING(chan, NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 3);
106 OUT_RING (chan, NvNotify0);
107 OUT_RING (chan, chan->vram_handle);
108 OUT_RING (chan, chan->gart_handle);
109
110 /* Sit back and pray the channel works.. */
111 FIRE_RING(chan);
112
113 return 0;
114}
115
116void 57void
117OUT_RINGp(struct nouveau_channel *chan, const void *data, unsigned nr_dwords) 58OUT_RINGp(struct nouveau_channel *chan, const void *data, unsigned nr_dwords)
118{ 59{