diff options
author | John Brooks <john@fastquake.com> | 2017-06-27 22:33:17 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:32 -0400 |
commit | 218b5dcde4d30e071eec4201a36af665ccfa7e1c (patch) | |
tree | 0889785bfbeed0e0342c41feb9852e9c9bc6785d /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |
parent | f9321cc4408bd90bb0adcd929c04322aaf6afdcc (diff) |
drm/amdgpu: Add vis_vramlimit module parameter
Allow specifying a limit on visible VRAM via a module parameter. This is
helpful for testing performance under visible VRAM pressure.
v2: Add cast to 64-bit (Christian König)
Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index b5420b20c2f5..e238084b7142 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -1099,6 +1099,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) | |||
1099 | { | 1099 | { |
1100 | uint64_t gtt_size; | 1100 | uint64_t gtt_size; |
1101 | int r; | 1101 | int r; |
1102 | u64 vis_vram_limit; | ||
1102 | 1103 | ||
1103 | r = amdgpu_ttm_global_init(adev); | 1104 | r = amdgpu_ttm_global_init(adev); |
1104 | if (r) { | 1105 | if (r) { |
@@ -1122,6 +1123,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) | |||
1122 | DRM_ERROR("Failed initializing VRAM heap.\n"); | 1123 | DRM_ERROR("Failed initializing VRAM heap.\n"); |
1123 | return r; | 1124 | return r; |
1124 | } | 1125 | } |
1126 | |||
1127 | /* Reduce size of CPU-visible VRAM if requested */ | ||
1128 | vis_vram_limit = (u64)amdgpu_vis_vram_limit * 1024 * 1024; | ||
1129 | if (amdgpu_vis_vram_limit > 0 && | ||
1130 | vis_vram_limit <= adev->mc.visible_vram_size) | ||
1131 | adev->mc.visible_vram_size = vis_vram_limit; | ||
1132 | |||
1125 | /* Change the size here instead of the init above so only lpfn is affected */ | 1133 | /* Change the size here instead of the init above so only lpfn is affected */ |
1126 | amdgpu_ttm_set_active_vram_size(adev, adev->mc.visible_vram_size); | 1134 | amdgpu_ttm_set_active_vram_size(adev, adev->mc.visible_vram_size); |
1127 | 1135 | ||