drm/amd/amdgpu: set gtt size according to system memory size only
authorRoger He <Hongbo.He@amd.com>
Wed, 29 Nov 2017 09:12:03 +0000 (17:12 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:48:31 +0000 (12:48 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 3385694a97cc7312f6e3586e7761e0df0f715df8..952e0bf3bc8426c54fa531c121709ce60b9eea17 100644 (file)
@@ -1330,11 +1330,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
                struct sysinfo si;
 
                si_meminfo(&si);
-               gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
-                              adev->mc.mc_vram_size),
-                              ((uint64_t)si.totalram * si.mem_unit * 3/4));
-       }
-       else
+               gtt_size = max(AMDGPU_DEFAULT_GTT_SIZE_MB << 20,
+                       (uint64_t)si.totalram * si.mem_unit * 3/4);
+       } else
                gtt_size = (uint64_t)amdgpu_gtt_size << 20;
        r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT);
        if (r) {