aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2025-01-30 15:12:58 -0500
committerAlex Deucher <alexander.deucher@amd.com>2025-02-12 21:04:08 -0500
commit8b0d068e7dd177eca506d908622095b4a6c9d168 (patch)
tree0d7f30b5f4b5639f942361b0406941031df6ca4c /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parentdrm/amdgpu: Make VBIOS image read optional (diff)
downloadlinux-rng-8b0d068e7dd177eca506d908622095b4a6c9d168.tar.xz
linux-rng-8b0d068e7dd177eca506d908622095b4a6c9d168.zip
drm/amdkfd: add a new flag to manage where VRAM allocations go
On big and small APUs we send KFD VRAM allocations to GTT since the carve out is either non-existent or relatively small. However, if someone sets the carve out size to be relatively large, we may end up using GTT rather than VRAM. No change of logic with this patch, but it allows the driver to determine which logic to use based on the carve out size in the future. Reviewed-by: Mario Limonciello <mario.limonciello@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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 3f61c999fde3..e68324ee4b25 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1987,6 +1987,9 @@ 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;
+
/* Initialize doorbell pool on PCI BAR */
r = amdgpu_ttm_init_on_chip(adev, AMDGPU_PL_DOORBELL, adev->doorbell.size / PAGE_SIZE);
if (r) {