aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_instmem.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-06-01 01:32:24 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-12 20:12:51 -0400
commitb833ac26f1f1c8e8d9149d83dbdd91432f2807d5 (patch)
tree2899ec81e2c41c6942d75d9039748c0a882ce321 /drivers/gpu/drm/nouveau/nv50_instmem.c
parentd17f395cdcec39033a481f96d75e8b3d3c41d43a (diff)
drm/nouveau: use drm_mm in preference to custom code doing the same thing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_instmem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_instmem.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c
index 71c01b6e5731..a361d1612bd7 100644
--- a/drivers/gpu/drm/nouveau/nv50_instmem.c
+++ b/drivers/gpu/drm/nouveau/nv50_instmem.c
@@ -147,7 +147,7 @@ nv50_instmem_init(struct drm_device *dev)
147 if (ret) 147 if (ret)
148 return ret; 148 return ret;
149 149
150 if (nouveau_mem_init_heap(&chan->ramin_heap, c_base, c_size - c_base)) 150 if (drm_mm_init(&chan->ramin_heap, c_base, c_size - c_base))
151 return -ENOMEM; 151 return -ENOMEM;
152 152
153 /* RAMFC + zero channel's PRAMIN up to start of VM pagedir */ 153 /* RAMFC + zero channel's PRAMIN up to start of VM pagedir */
@@ -276,9 +276,7 @@ nv50_instmem_init(struct drm_device *dev)
276 nv_wr32(dev, NV50_PUNK_BAR0_PRAMIN, save_nv001700); 276 nv_wr32(dev, NV50_PUNK_BAR0_PRAMIN, save_nv001700);
277 277
278 /* Global PRAMIN heap */ 278 /* Global PRAMIN heap */
279 if (nouveau_mem_init_heap(&dev_priv->ramin_heap, 279 if (drm_mm_init(&dev_priv->ramin_heap, c_size, dev_priv->ramin_size - c_size)) {
280 c_size, dev_priv->ramin_size - c_size)) {
281 dev_priv->ramin_heap = NULL;
282 NV_ERROR(dev, "Failed to init RAMIN heap\n"); 280 NV_ERROR(dev, "Failed to init RAMIN heap\n");
283 } 281 }
284 282
@@ -321,7 +319,7 @@ nv50_instmem_takedown(struct drm_device *dev)
321 nouveau_gpuobj_del(dev, &chan->vm_pd); 319 nouveau_gpuobj_del(dev, &chan->vm_pd);
322 nouveau_gpuobj_ref_del(dev, &chan->ramfc); 320 nouveau_gpuobj_ref_del(dev, &chan->ramfc);
323 nouveau_gpuobj_ref_del(dev, &chan->ramin); 321 nouveau_gpuobj_ref_del(dev, &chan->ramin);
324 nouveau_mem_takedown(&chan->ramin_heap); 322 drm_mm_takedown(&chan->ramin_heap);
325 323
326 dev_priv->fifos[0] = dev_priv->fifos[127] = NULL; 324 dev_priv->fifos[0] = dev_priv->fifos[127] = NULL;
327 kfree(chan); 325 kfree(chan);
@@ -436,14 +434,14 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
436 if (!gpuobj->im_backing || !gpuobj->im_pramin || gpuobj->im_bound) 434 if (!gpuobj->im_backing || !gpuobj->im_pramin || gpuobj->im_bound)
437 return -EINVAL; 435 return -EINVAL;
438 436
439 NV_DEBUG(dev, "st=0x%0llx sz=0x%0llx\n", 437 NV_DEBUG(dev, "st=0x%lx sz=0x%lx\n",
440 gpuobj->im_pramin->start, gpuobj->im_pramin->size); 438 gpuobj->im_pramin->start, gpuobj->im_pramin->size);
441 439
442 pte = (gpuobj->im_pramin->start >> 12) << 1; 440 pte = (gpuobj->im_pramin->start >> 12) << 1;
443 pte_end = ((gpuobj->im_pramin->size >> 12) << 1) + pte; 441 pte_end = ((gpuobj->im_pramin->size >> 12) << 1) + pte;
444 vram = gpuobj->im_backing_start; 442 vram = gpuobj->im_backing_start;
445 443
446 NV_DEBUG(dev, "pramin=0x%llx, pte=%d, pte_end=%d\n", 444 NV_DEBUG(dev, "pramin=0x%lx, pte=%d, pte_end=%d\n",
447 gpuobj->im_pramin->start, pte, pte_end); 445 gpuobj->im_pramin->start, pte, pte_end);
448 NV_DEBUG(dev, "first vram page: 0x%08x\n", gpuobj->im_backing_start); 446 NV_DEBUG(dev, "first vram page: 0x%08x\n", gpuobj->im_backing_start);
449 447