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;
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) {
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);
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;
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;