Commit 5f97fc0e authored by Roger He's avatar Roger He Committed by Alex Deucher

drm/amd/amdgpu: set gtt size according to system memory size only

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarRoger He <Hongbo.He@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cebb52b7
...@@ -1330,11 +1330,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) ...@@ -1330,11 +1330,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
struct sysinfo si; struct sysinfo si;
si_meminfo(&si); si_meminfo(&si);
gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20), gtt_size = max(AMDGPU_DEFAULT_GTT_SIZE_MB << 20,
adev->mc.mc_vram_size), (uint64_t)si.totalram * si.mem_unit * 3/4);
((uint64_t)si.totalram * si.mem_unit * 3/4)); } else
}
else
gtt_size = (uint64_t)amdgpu_gtt_size << 20; gtt_size = (uint64_t)amdgpu_gtt_size << 20;
r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT); r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT);
if (r) { if (r) {
......
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