aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 44983d16bf61..b12a46fadb16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1330,9 +1330,14 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
DRM_INFO("amdgpu: %uM of VRAM memory ready\n",
(unsigned) (adev->mc.real_vram_size / (1024 * 1024)));
- if (amdgpu_gtt_size == -1)
- gtt_size = max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
- adev->mc.mc_vram_size);
+ if (amdgpu_gtt_size == -1) {
+ 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 = (uint64_t)amdgpu_gtt_size << 20;
r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT);
s Husson4-7/+22 2016-11-29mfd: axp20x: Add address extension registers for AXP806 regmapChen-Yu Tsai2-1/+4 2016-11-29mfd: intel_soc_pmic_bxtwc: Fix a typo in MODULE_DEVICE_TABLE()Wei Yongjun1-1/+1 2016-11-29mfd: core: Fix device reference leak in mfd_clone_cellJohan Hovold1-0/+2 2016-11-29mfd: bcm590xx: Simplify a testChristophe JAILLET1-1/+1 2016-11-29mfd: sun4i-gpadc: Select regmap-irqArnd Bergmann1-0/+1 2016-11-29mfd: abx500-core: drop unused MODULE_ tags from non-modular codePaul Gortmaker1-5/+2 2016-11-29mfd: ab8500: make sysctrl explicitly non-modularPaul Gortmaker1-5/+4 2016-11-29mfd: ab8500-gpadc: Make it explicitly non-modularPaul Gortmaker1-17/+2 2016-11-29mfd: ab8500-debugfs: Make it explicitly non-modularPaul Gortmaker1-19/+2 2016-11-29mfd: ab8500-core: Make it explicitly non-modularPaul Gortmaker1-31/+6 2016-11-29mfd: ab3100-core: Make it explicitly non-modularPaul Gortmaker1-36/+3 2016-11-29mfd: si476x-i2c: Fix spelling mistakes "Failet" and "gett"Colin Ian King1-1/+1 2016-11-29mfd: arizona: Use irq_find_mapping when appropriateCharles Keepax1-4/+4 2016-11-29mfd: wm8994-core: Don't use managed regulator bulk get APIViresh Kumar1-3/+11 2016-11-29mfd: davinci_voicecodec: Tidyup header difinitionsKuninori Morimoto2-4/+1 2016-11-29mfd: wm5102: Remove spurious trailing spacesRichard Fitzgerald1-706/+706 2016-11-29mfd: sun4i-gpadc: Fix 'cast from pointer to integer of different size' warningLee Jones1-1/+1 2016-11-29mfd: axp20x-i2c: Add i2c-ids to fix module auto-loadingHans de Goede1-3/+4 2016-11-29mfd: syscon: Support native-endian regmapsPaul Burton1-1/+3 2016-11-29mfd: rk808: RK818 uses DEV_OFF to power off suppliesJianhong Chen2-1/+23 2016-11-29mfd: fsl-imx25-tsadc: Fix module autoload when registered via OFJavier Martinez Canillas1-0/+1 2016-11-29mfd: hi655x-pmic: Fix module autoload when registered via OFJavier Martinez Canillas1-0/+1 2016-11-29mfd: abx500-core: Allow driver to built if COMPILE_TEST is enabledJavier Martinez Canillas1-1/+1 2016-11-29mfd: exynos-lpass: Add hardware dependencyJean Delvare1-0/+1 2016-11-29mfd: tps65912: Move regmap config into core driverArnd Bergmann2-15/+18 2016-11-29mfd: wm8994-core: Disable regulators before removing themViresh Kumar1-1/+1 2016-11-29mfd: wm8994-core: Don't split lines unnecessarilyViresh Kumar1-4/+2 2016-11-29mfd: Enable compile testing for max77620 and max77686Krzysztof Kozlowski1-2/+2 2016-11-29mfd: tc3589x: Improve function-level documentationJulia Lawall1-2/+2 2016-11-29mfd: Add support for Allwinner SoCs ADCQuentin Schulz4-0/+291