diff options
author | Christian König <christian.koenig@amd.com> | 2017-07-07 07:17:45 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:31 -0400 |
commit | 36d3837266c53a92a909f22f6bbf0846c0e6464f (patch) | |
tree | 5b5f9bca8890ebccc39f88ba8af33da70161dbd3 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |
parent | bb84284e10ec3447b4bb74cfa493d5c384a0b798 (diff) |
drm/amdgpu: add new gttsize module parameter v2
This allows setting the gtt size independent of the gart size.
v2: fix copy and paste typo
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@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 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 4e711d9af67c..b5420b20c2f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -1097,6 +1097,7 @@ static struct ttm_bo_driver amdgpu_bo_driver = { | |||
1097 | 1097 | ||
1098 | int amdgpu_ttm_init(struct amdgpu_device *adev) | 1098 | int amdgpu_ttm_init(struct amdgpu_device *adev) |
1099 | { | 1099 | { |
1100 | uint64_t gtt_size; | ||
1100 | int r; | 1101 | int r; |
1101 | 1102 | ||
1102 | r = amdgpu_ttm_global_init(adev); | 1103 | r = amdgpu_ttm_global_init(adev); |
@@ -1143,14 +1144,19 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) | |||
1143 | } | 1144 | } |
1144 | DRM_INFO("amdgpu: %uM of VRAM memory ready\n", | 1145 | DRM_INFO("amdgpu: %uM of VRAM memory ready\n", |
1145 | (unsigned) (adev->mc.real_vram_size / (1024 * 1024))); | 1146 | (unsigned) (adev->mc.real_vram_size / (1024 * 1024))); |
1146 | r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, | 1147 | |
1147 | adev->mc.gart_size >> PAGE_SHIFT); | 1148 | if (amdgpu_gtt_size == -1) |
1149 | gtt_size = max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20), | ||
1150 | adev->mc.mc_vram_size); | ||
1151 | else | ||
1152 | gtt_size = (uint64_t)amdgpu_gtt_size << 20; | ||
1153 | r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT); | ||
1148 | if (r) { | 1154 | if (r) { |
1149 | DRM_ERROR("Failed initializing GTT heap.\n"); | 1155 | DRM_ERROR("Failed initializing GTT heap.\n"); |
1150 | return r; | 1156 | return r; |
1151 | } | 1157 | } |
1152 | DRM_INFO("amdgpu: %uM of GTT memory ready.\n", | 1158 | DRM_INFO("amdgpu: %uM of GTT memory ready.\n", |
1153 | (unsigned)(adev->mc.gart_size / (1024 * 1024))); | 1159 | (unsigned)(gtt_size / (1024 * 1024))); |
1154 | 1160 | ||
1155 | adev->gds.mem.total_size = adev->gds.mem.total_size << AMDGPU_GDS_SHIFT; | 1161 | adev->gds.mem.total_size = adev->gds.mem.total_size << AMDGPU_GDS_SHIFT; |
1156 | adev->gds.mem.gfx_partition_size = adev->gds.mem.gfx_partition_size << AMDGPU_GDS_SHIFT; | 1162 | adev->gds.mem.gfx_partition_size = adev->gds.mem.gfx_partition_size << AMDGPU_GDS_SHIFT; |