aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2017-11-29 04:12:03 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-06 12:48:31 -0500
commit5f97fc0e032594212459f63e9c6229cd79ccb697 (patch)
treefe1c79dc661c35e263f57b535c58e4cdbb19bcbb /drivers/gpu/drm/amd/amdgpu
parentcebb52b7bc325863600aff930407bba773010938 (diff)
drm/amd/amdgpu: set gtt size according to system memory size only
Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Roger He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 3385694a97cc..952e0bf3bc84 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1330,11 +1330,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
1330 struct sysinfo si; 1330 struct sysinfo si;
1331 1331
1332 si_meminfo(&si); 1332 si_meminfo(&si);
1333 gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20), 1333 gtt_size = max(AMDGPU_DEFAULT_GTT_SIZE_MB << 20,
1334 adev->mc.mc_vram_size), 1334 (uint64_t)si.totalram * si.mem_unit * 3/4);
1335 ((uint64_t)si.totalram * si.mem_unit * 3/4)); 1335 } else
1336 }
1337 else
1338 gtt_size = (uint64_t)amdgpu_gtt_size << 20; 1336 gtt_size = (uint64_t)amdgpu_gtt_size << 20;
1339 r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT); 1337 r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT);
1340 if (r) { 1338 if (r) {