diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-08-21 17:58:25 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-24 17:48:41 +0200 |
commit | db63042b332ae048ca640b3d1aed508973c40c8c (patch) | |
tree | ef9233923f28ae1b69a34eec64fec82fbde5cd9c /drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | |
parent | drm/amdgpu/gfx8: fix spelling typo in mqd allocation (diff) | |
download | linux-db63042b332ae048ca640b3d1aed508973c40c8c.tar.xz linux-db63042b332ae048ca640b3d1aed508973c40c8c.zip |
drm/amdgpu: add automatic per asic settings for gart_size
We need a larger gart for asics that do not support GPUVM on all
engines (e.g., MM) to make sure we have enough space for all
gtt buffers in physical mode. Change the default size based on
the asic type.
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_gart.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index 94c1e2e8e34c..b9b9f680fc08 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c @@ -65,7 +65,21 @@ */ void amdgpu_gart_set_defaults(struct amdgpu_device *adev) { - adev->mc.gart_size = (uint64_t)amdgpu_gart_size << 20; + u64 gart_size; + + if (amdgpu_gart_size == -1) { + /* make the GART larger for chips that + * dont' support VM for all rings + */ + if (adev->asic_type <= CHIP_STONEY) + gart_size = 1024; + else + gart_size = 256; + } else { + gart_size = amdgpu_gart_size; + } + + adev->mc.gart_size = gart_size << 20; } /** |