diff options
-rw-r--r-- | linux-core/radeon_fb.c | 5 | ||||
-rw-r--r-- | linux-core/radeon_gem.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/linux-core/radeon_fb.c b/linux-core/radeon_fb.c index d3722c37..9d30d1f7 100644 --- a/linux-core/radeon_fb.c +++ b/linux-core/radeon_fb.c @@ -707,6 +707,7 @@ int radeonfb_create(struct drm_device *dev, uint32_t fb_width, uint32_t fb_heigh uint32_t surface_width, uint32_t surface_height, struct radeon_framebuffer **radeon_fb_p) { + struct drm_radeon_private *dev_priv = dev->dev_private; struct fb_info *info; struct radeonfb_par *par; struct drm_framebuffer *fb; @@ -743,6 +744,8 @@ int radeonfb_create(struct drm_device *dev, uint32_t fb_width, uint32_t fb_heigh goto out_unref; } + dev_priv->mm.vram_visible -= aligned_size; + mutex_lock(&dev->struct_mutex); fb = radeon_framebuffer_create(dev, &mode_cmd, fbo); if (!fb) { @@ -1136,6 +1139,7 @@ EXPORT_SYMBOL(radeonfb_probe); int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb) { + struct drm_radeon_private *dev_priv = dev->dev_private; struct fb_info *info; struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); @@ -1147,6 +1151,7 @@ int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb) if (info) { unregister_framebuffer(info); drm_bo_kunmap(&radeon_fb->kmap_obj); + dev_priv->mm.vram_visible += radeon_fb->obj->size; mutex_lock(&dev->struct_mutex); drm_gem_object_unreference(radeon_fb->obj); radeon_fb->obj = NULL; diff --git a/linux-core/radeon_gem.c b/linux-core/radeon_gem.c index 2e20de3c..85185232 100644 --- a/linux-core/radeon_gem.c +++ b/linux-core/radeon_gem.c @@ -586,6 +586,9 @@ static int radeon_gart_init(struct drm_device *dev) if (ret) return -EINVAL; + /* subtract from VRAM value reporting to userspace */ + dev_priv->mm.vram_visible -= RADEON_PCIGART_TABLE_SIZE; + dev_priv->mm.pcie_table_backup = kzalloc(RADEON_PCIGART_TABLE_SIZE, GFP_KERNEL); if (!dev_priv->mm.pcie_table_backup) return -EINVAL; |