aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvc0_instmem.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-06-08 04:17:41 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-06-23 02:01:41 -0400
commit5de8037ab466d397df17ff72382c33a908f42f6c (patch)
treed9cb70739f15d39effafa3e205557ca82b16134b /drivers/gpu/drm/nouveau/nvc0_instmem.c
parentad9ac437a500f8c0822bd5fe139af8ee2c132e15 (diff)
drm/nvc0: enable per-client address spaces
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.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c
index 82357d2df1f4..b701c439c92e 100644
--- a/drivers/gpu/drm/nouveau/nvc0_instmem.c
+++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c
@@ -32,7 +32,6 @@ 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;
36}; 35};
37 36
38int 37int
@@ -181,17 +180,11 @@ nvc0_instmem_init(struct drm_device *dev)
181 goto error; 180 goto error;
182 181
183 /* channel vm */ 182 /* channel vm */
184 ret = nouveau_vm_new(dev, 0, (1ULL << 40), 0x0008000000ULL, &vm); 183 ret = nouveau_vm_new(dev, 0, (1ULL << 40), 0x0008000000ULL,
184 &dev_priv->chan_vm);
185 if (ret) 185 if (ret)
186 goto error; 186 goto error;
187 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
195 nvc0_instmem_resume(dev); 188 nvc0_instmem_resume(dev);
196 return 0; 189 return 0;
197error: 190error:
@@ -211,8 +204,7 @@ nvc0_instmem_takedown(struct drm_device *dev)
211 nv_wr32(dev, 0x1704, 0x00000000); 204 nv_wr32(dev, 0x1704, 0x00000000);
212 nv_wr32(dev, 0x1714, 0x00000000); 205 nv_wr32(dev, 0x1714, 0x00000000);
213 206
214 nouveau_vm_ref(NULL, &dev_priv->chan_vm, priv->chan_pgd); 207 nouveau_vm_ref(NULL, &dev_priv->chan_vm, NULL);
215 nouveau_gpuobj_ref(NULL, &priv->chan_pgd);
216 208
217 nvc0_channel_del(&priv->bar1); 209 nvc0_channel_del(&priv->bar1);
218 nouveau_vm_ref(NULL, &dev_priv->bar1_vm, priv->bar1_pgd); 210 nouveau_vm_ref(NULL, &dev_priv->bar1_vm, priv->bar1_pgd);