aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_mem.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-01-14 18:24:20 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-01-14 18:29:38 -0500
commitac8fb975e8c88d312a376b035494be17548d01c6 (patch)
tree961ea3f6dcbc5483a676daa8c91d6fc27adf068f /drivers/gpu/drm/nouveau/nouveau_mem.c
parentb8780e2ad20feb8d086bc961a678e8fdb4fa296b (diff)
drm/nouveau: reserve VGA area for the moment
This is to prevent things such as GART tables and other important GPU structures being allocated there before we take over fbcon ourselves. This is more of a workaround for the moment, a better solution will require some more invasive changes, but it'll be done at some point. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_mem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index be4c7781d761..186f34b01f2e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -383,6 +383,9 @@ void nouveau_mem_close(struct drm_device *dev)
383{ 383{
384 struct drm_nouveau_private *dev_priv = dev->dev_private; 384 struct drm_nouveau_private *dev_priv = dev->dev_private;
385 385
386 nouveau_bo_unpin(dev_priv->vga_ram);
387 nouveau_bo_ref(NULL, &dev_priv->vga_ram);
388
386 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM); 389 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM);
387 ttm_bo_device_release(&dev_priv->ttm.bdev); 390 ttm_bo_device_release(&dev_priv->ttm.bdev);
388 391
@@ -619,6 +622,15 @@ nouveau_mem_init(struct drm_device *dev)
619 return ret; 622 return ret;
620 } 623 }
621 624
625 ret = nouveau_bo_new(dev, NULL, 256*1024, 0, TTM_PL_FLAG_VRAM,
626 0, 0, true, true, &dev_priv->vga_ram);
627 if (ret == 0)
628 ret = nouveau_bo_pin(dev_priv->vga_ram, TTM_PL_FLAG_VRAM);
629 if (ret) {
630 NV_WARN(dev, "failed to reserve VGA memory\n");
631 nouveau_bo_ref(NULL, &dev_priv->vga_ram);
632 }
633
622 /* GART */ 634 /* GART */
623#if !defined(__powerpc__) && !defined(__ia64__) 635#if !defined(__powerpc__) && !defined(__ia64__)
624 if (drm_device_is_agp(dev) && dev->agp) { 636 if (drm_device_is_agp(dev) && dev->agp) {
@@ -650,6 +662,7 @@ nouveau_mem_init(struct drm_device *dev)
650 dev_priv->fb_mtrr = drm_mtrr_add(drm_get_resource_start(dev, 1), 662 dev_priv->fb_mtrr = drm_mtrr_add(drm_get_resource_start(dev, 1),
651 drm_get_resource_len(dev, 1), 663 drm_get_resource_len(dev, 1),
652 DRM_MTRR_WC); 664 DRM_MTRR_WC);
665
653 return 0; 666 return 0;
654} 667}
655 668