If the user has configured a large carveout on a small APU, only use GTT for VRAM allocations if GTT is larger than VRAM. v2: fix reversed check (Philip)
Unified · Split
| @@ -1987,8 +1987,10 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) · 1986 unmodified lines | |||
| 1987 | DRM_INFO("amdgpu: %uM of GTT memory ready.\n", | 1987 | DRM_INFO("amdgpu: %uM of GTT memory ready.\n", |
| 1988 | (unsigned int)(gtt_size / (1024 * 1024))); | 1988 | (unsigned int)(gtt_size / (1024 * 1024))); |
| 1989 | 1989 | ||
| 1990 | if (adev->flags & AMD_IS_APU) | 1990 | if (adev->flags & AMD_IS_APU) { |
| 1991 | adev->apu_prefer_gtt = true; | 1991 | if (adev->gmc.real_vram_size < gtt_size) |
| 1992 | adev->apu_prefer_gtt = true; | ||
| 1993 | } | ||
| 1992 | 1994 | ||
| 1993 | /* Initialize doorbell pool on PCI BAR */ | 1995 | /* Initialize doorbell pool on PCI BAR */ |
| 1994 | r = amdgpu_ttm_init_on_chip(adev, AMDGPU_PL_DOORBELL, adev->doorbell.size / PAGE_SIZE); | 1996 | r = amdgpu_ttm_init_on_chip(adev, AMDGPU_PL_DOORBELL, adev->doorbell.size / PAGE_SIZE); |