Commit ebd4c110 authored by Michel Dänzer's avatar Michel Dänzer Committed by Greg Kroah-Hartman

drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO ioctl

commit 51964e9e upstream.

vram_size is supposed to be the total amount of VRAM that can be used by
userspace, which corresponds to the TTM VRAM manager size (which is
normally the full amount of VRAM, but can be just the visible VRAM when
DMA can't be used for BO migration for some reason).

The above was incorrectly used for vram_visible before, resulting in
generally too large values being reported.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent acc771fd
...@@ -97,9 +97,10 @@ ...@@ -97,9 +97,10 @@
* 2.46.0 - Add PFP_SYNC_ME support on evergreen * 2.46.0 - Add PFP_SYNC_ME support on evergreen
* 2.47.0 - Add UVD_NO_OP register support * 2.47.0 - Add UVD_NO_OP register support
* 2.48.0 - TA_CS_BC_BASE_ADDR allowed on SI * 2.48.0 - TA_CS_BC_BASE_ADDR allowed on SI
* 2.49.0 - DRM_RADEON_GEM_INFO ioctl returns correct vram_size/visible values
*/ */
#define KMS_DRIVER_MAJOR 2 #define KMS_DRIVER_MAJOR 2
#define KMS_DRIVER_MINOR 48 #define KMS_DRIVER_MINOR 49
#define KMS_DRIVER_PATCHLEVEL 0 #define KMS_DRIVER_PATCHLEVEL 0
int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
int radeon_driver_unload_kms(struct drm_device *dev); int radeon_driver_unload_kms(struct drm_device *dev);
......
...@@ -220,8 +220,8 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data, ...@@ -220,8 +220,8 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data,
man = &rdev->mman.bdev.man[TTM_PL_VRAM]; man = &rdev->mman.bdev.man[TTM_PL_VRAM];
args->vram_size = rdev->mc.real_vram_size; args->vram_size = (u64)man->size << PAGE_SHIFT;
args->vram_visible = (u64)man->size << PAGE_SHIFT; args->vram_visible = rdev->mc.visible_vram_size;
args->vram_visible -= rdev->vram_pin_size; args->vram_visible -= rdev->vram_pin_size;
args->gart_size = rdev->mc.gtt_size; args->gart_size = rdev->mc.gtt_size;
args->gart_size -= rdev->gart_pin_size; args->gart_size -= rdev->gart_pin_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment