aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2025-01-30 20:20:05 +0000
committerAlex Deucher <[email protected]>2025-02-13 02:04:08 +0000
commit759e764f7d587283b4e0b01ff930faca64370e59 (patch)
tree48ebd7e09d09b636a5be0635e817b5e302171137 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parentdrm/amdkfd: add a new flag to manage where VRAM allocations go (diff)
downloadkernel-759e764f7d587283b4e0b01ff930faca64370e59.tar.gz
kernel-759e764f7d587283b4e0b01ff930faca64370e59.zip
drm/amdkfd: use GTT for VRAM on APUs only if GTT is larger
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) Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index e68324ee4b25..bcb4bcc4ab75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1987,8 +1987,10 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
DRM_INFO("amdgpu: %uM of GTT memory ready.\n",
(unsigned int)(gtt_size / (1024 * 1024)));
- if (adev->flags & AMD_IS_APU)
- adev->apu_prefer_gtt = true;
+ if (adev->flags & AMD_IS_APU) {
+ if (adev->gmc.real_vram_size < gtt_size)
+ adev->apu_prefer_gtt = true;
+ }
/* Initialize doorbell pool on PCI BAR */
r = amdgpu_ttm_init_on_chip(adev, AMDGPU_PL_DOORBELL, adev->doorbell.size / PAGE_SIZE);