aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvc0_instmem.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-11-15 23:58:42 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-12-21 02:17:21 -0500
commit99805566d93d69b7daf2373aba9fae52a62396f4 (patch)
tree3b9f2da9ed81dab3568de61dc7060058f8226e81 /drivers/gpu/drm/nouveau/nvc0_instmem.c
parent8984e046153eb1d6b0b24626169f9c6e58232e1b (diff)
drm/nvc0: create shared channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_instmem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_instmem.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c
index 211099736553..c09091749054 100644
--- a/drivers/gpu/drm/nouveau/nvc0_instmem.c
+++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c
@@ -32,6 +32,7 @@ struct nvc0_instmem_priv {
32 struct nouveau_channel *bar1; 32 struct nouveau_channel *bar1;
33 struct nouveau_gpuobj *bar3_pgd; 33 struct nouveau_gpuobj *bar3_pgd;
34 struct nouveau_channel *bar3; 34 struct nouveau_channel *bar3;
35 struct nouveau_gpuobj *chan_pgd;
35}; 36};
36 37
37int 38int
@@ -179,6 +180,18 @@ nvc0_instmem_init(struct drm_device *dev)
179 if (ret) 180 if (ret)
180 goto error; 181 goto error;
181 182
183 /* channel vm */
184 ret = nouveau_vm_new(dev, 0, (1ULL << 40), 0x0008000000ULL, &vm);
185 if (ret)
186 goto error;
187
188 ret = nouveau_gpuobj_new(dev, NULL, 0x8000, 4096, 0, &priv->chan_pgd);
189 if (ret)
190 goto error;
191
192 nouveau_vm_ref(vm, &dev_priv->chan_vm, priv->chan_pgd);
193 nouveau_vm_ref(NULL, &vm, NULL);
194
182 nvc0_instmem_resume(dev); 195 nvc0_instmem_resume(dev);
183 return 0; 196 return 0;
184error: 197error:
@@ -198,6 +211,9 @@ nvc0_instmem_takedown(struct drm_device *dev)
198 nv_wr32(dev, 0x1704, 0x00000000); 211 nv_wr32(dev, 0x1704, 0x00000000);
199 nv_wr32(dev, 0x1714, 0x00000000); 212 nv_wr32(dev, 0x1714, 0x00000000);
200 213
214 nouveau_vm_ref(NULL, &dev_priv->chan_vm, priv->chan_pgd);
215 nouveau_gpuobj_ref(NULL, &priv->chan_pgd);
216
201 nvc0_channel_del(&priv->bar1); 217 nvc0_channel_del(&priv->bar1);
202 nouveau_vm_ref(NULL, &dev_priv->bar1_vm, priv->bar1_pgd); 218 nouveau_vm_ref(NULL, &dev_priv->bar1_vm, priv->bar1_pgd);
203 nouveau_gpuobj_ref(NULL, &priv->bar1_pgd); 219 nouveau_gpuobj_ref(NULL, &priv->bar1_pgd);