summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_gem.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2014-07-17 18:16:20 +0200
committerAlex Deucher <alexander.deucher@amd.com>2014-08-05 14:53:34 +0200
commitccbe0060aabb097bdb96510dc0390ed8f79326ea (patch)
treefda23f6a9ea3e48fda7819538d6ee9b3a7f8ac01 /drivers/gpu/drm/radeon/radeon_gem.c
parentdrm/radeon: track pinned memory (v2) (diff)
downloadlinux-ccbe0060aabb097bdb96510dc0390ed8f79326ea.tar.xz
linux-ccbe0060aabb097bdb96510dc0390ed8f79326ea.zip
drm/radeon: use vram/gart pinned size in radeon_gem_info_ioctl
Gives a more accurate limit than the previous code. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gem.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index ce1d61efa1f9..1ec62444e32e 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -209,18 +209,15 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data,
struct radeon_device *rdev = dev->dev_private;
struct drm_radeon_gem_info *args = data;
struct ttm_mem_type_manager *man;
- unsigned i;
man = &rdev->mman.bdev.man[TTM_PL_VRAM];
args->vram_size = rdev->mc.real_vram_size;
args->vram_visible = (u64)man->size << PAGE_SHIFT;
- if (rdev->stollen_vga_memory)
- args->vram_visible -= radeon_bo_size(rdev->stollen_vga_memory);
- args->vram_visible -= radeon_fbdev_total_size(rdev);
- args->gart_size = rdev->mc.gtt_size - 4096 - RADEON_IB_POOL_SIZE*64*1024;
- for(i = 0; i < RADEON_NUM_RINGS; ++i)
- args->gart_size -= rdev->ring[i].ring_size;
+ args->vram_visible -= rdev->vram_pin_size;
+ args->gart_size = rdev->mc.gtt_size;
+ args->gart_size -= rdev->gart_pin_size;
+
return 0;
}