提交 ac8fb975 编写于 作者: B Ben Skeggs

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: NBen Skeggs <bskeggs@redhat.com>
上级 b8780e2a
...@@ -509,6 +509,8 @@ struct drm_nouveau_private { ...@@ -509,6 +509,8 @@ struct drm_nouveau_private {
void __iomem *ramin; void __iomem *ramin;
uint32_t ramin_size; uint32_t ramin_size;
struct nouveau_bo *vga_ram;
struct workqueue_struct *wq; struct workqueue_struct *wq;
struct work_struct irq_work; struct work_struct irq_work;
......
...@@ -383,6 +383,9 @@ void nouveau_mem_close(struct drm_device *dev) ...@@ -383,6 +383,9 @@ void nouveau_mem_close(struct drm_device *dev)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
nouveau_bo_unpin(dev_priv->vga_ram);
nouveau_bo_ref(NULL, &dev_priv->vga_ram);
ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM); ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM);
ttm_bo_device_release(&dev_priv->ttm.bdev); ttm_bo_device_release(&dev_priv->ttm.bdev);
...@@ -619,6 +622,15 @@ nouveau_mem_init(struct drm_device *dev) ...@@ -619,6 +622,15 @@ nouveau_mem_init(struct drm_device *dev)
return ret; return ret;
} }
ret = nouveau_bo_new(dev, NULL, 256*1024, 0, TTM_PL_FLAG_VRAM,
0, 0, true, true, &dev_priv->vga_ram);
if (ret == 0)
ret = nouveau_bo_pin(dev_priv->vga_ram, TTM_PL_FLAG_VRAM);
if (ret) {
NV_WARN(dev, "failed to reserve VGA memory\n");
nouveau_bo_ref(NULL, &dev_priv->vga_ram);
}
/* GART */ /* GART */
#if !defined(__powerpc__) && !defined(__ia64__) #if !defined(__powerpc__) && !defined(__ia64__)
if (drm_device_is_agp(dev) && dev->agp) { if (drm_device_is_agp(dev) && dev->agp) {
...@@ -650,6 +662,7 @@ nouveau_mem_init(struct drm_device *dev) ...@@ -650,6 +662,7 @@ nouveau_mem_init(struct drm_device *dev)
dev_priv->fb_mtrr = drm_mtrr_add(drm_get_resource_start(dev, 1), dev_priv->fb_mtrr = drm_mtrr_add(drm_get_resource_start(dev, 1),
drm_get_resource_len(dev, 1), drm_get_resource_len(dev, 1),
DRM_MTRR_WC); DRM_MTRR_WC);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册