diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-08-05 00:19:51 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-02 11:37:10 +1000 |
commit | 38e1492130c42ac806ffd8b21ccf64eb1c997d10 (patch) | |
tree | b83e8f1c23148a7b46ef39691b0bbbe7fcbeb347 /drivers/gpu/drm/radeon/radeon_gem.c | |
parent | 47381156a8f0d793bacfa346cc4cc515399525f7 (diff) | |
download | blackbird-op-linux-38e1492130c42ac806ffd8b21ccf64eb1c997d10.tar.gz blackbird-op-linux-38e1492130c42ac806ffd8b21ccf64eb1c997d10.zip |
drm/radeon: Give userspace more accurate information about available memory.
This patch varies from the original and just removes memory for kernel
pinned objects.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gem.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_gem.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index d880edf254db..9c4f895a026e 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -158,9 +158,13 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data, struct drm_radeon_gem_info *args = data; args->vram_size = rdev->mc.real_vram_size; - /* FIXME: report somethings that makes sense */ - args->vram_visible = rdev->mc.real_vram_size - (4 * 1024 * 1024); - args->gart_size = rdev->mc.gtt_size; + args->vram_visible = rdev->mc.real_vram_size; + if (rdev->stollen_vga_memory) + args->vram_visible -= radeon_object_size(rdev->stollen_vga_memory); + if (rdev->fbdev_robj) + args->vram_visible -= radeon_object_size(rdev->fbdev_robj); + args->gart_size = rdev->mc.gtt_size - rdev->cp.ring_size - 4096 - + RADEON_IB_POOL_SIZE*64*1024; return 0; } |