aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-11-15 16:55:53 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-12-06 18:08:21 -0500
commit70b5c5aae57c1625b15dd2e63ecc40b8805b1ec0 (patch)
tree7f6ecc3f696dc9d8721dcf9240123a472143b31e /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parent197aa6ed522cc44710687d3b02dd4e4573991416 (diff)
Revert "drm/amdgpu: use the kernel zone memory size as the max remote memory in amdgpu"
This reverts commit a693e050edfe794fea81d7cfe72429a406aa380b. This breaks on systems with huge amounts of system memory as we do not have enough vram to store the page tables. Additionally, this is less of an issue with the recent gtt manager changes. Reviewed-by: Christian König <christian.koenig@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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 8f18b8ed2b3a..bc70f80260d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -34,7 +34,6 @@
34#include <ttm/ttm_placement.h> 34#include <ttm/ttm_placement.h>
35#include <ttm/ttm_module.h> 35#include <ttm/ttm_module.h>
36#include <ttm/ttm_page_alloc.h> 36#include <ttm/ttm_page_alloc.h>
37#include <ttm/ttm_memory.h>
38#include <drm/drmP.h> 37#include <drm/drmP.h>
39#include <drm/amdgpu_drm.h> 38#include <drm/amdgpu_drm.h>
40#include <linux/seq_file.h> 39#include <linux/seq_file.h>
@@ -65,7 +64,7 @@ static void amdgpu_ttm_mem_global_release(struct drm_global_reference *ref)
65 ttm_mem_global_release(ref->object); 64 ttm_mem_global_release(ref->object);
66} 65}
67 66
68int amdgpu_ttm_global_init(struct amdgpu_device *adev) 67static int amdgpu_ttm_global_init(struct amdgpu_device *adev)
69{ 68{
70 struct drm_global_reference *global_ref; 69 struct drm_global_reference *global_ref;
71 struct amdgpu_ring *ring; 70 struct amdgpu_ring *ring;
@@ -1151,6 +1150,10 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
1151 unsigned i, j; 1150 unsigned i, j;
1152 int r; 1151 int r;
1153 1152
1153 r = amdgpu_ttm_global_init(adev);
1154 if (r) {
1155 return r;
1156 }
1154 /* No others user of address space so set it to 0 */ 1157 /* No others user of address space so set it to 0 */
1155 r = ttm_bo_device_init(&adev->mman.bdev, 1158 r = ttm_bo_device_init(&adev->mman.bdev,
1156 adev->mman.bo_global_ref.ref.object, 1159 adev->mman.bo_global_ref.ref.object,
@@ -1650,8 +1653,3 @@ static void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev)
1650 1653
1651#endif 1654#endif
1652} 1655}
1653
1654u64 amdgpu_ttm_get_gtt_mem_size(struct amdgpu_device *adev)
1655{
1656 return ttm_get_kernel_zone_memory_size(adev->mman.mem_global_ref.object);
1657}