drm/amdkfd: APU mode set max svm range pages

svm_migrate_init set the max svm range pages based on the KFD nodes
partition size. APU mode don't init pgmap because there is no migration.

kgd2kfd_device_init calls svm_migrate_init after KFD nodes allocation
and initialization.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Philip Yang
2023-03-23 08:45:56 -04:00
committed by Alex Deucher
parent 1c77527a69
commit 25f5070434
3 changed files with 17 additions and 10 deletions

View File

@@ -1000,6 +1000,11 @@ int svm_migrate_init(struct amdgpu_device *adev)
if (!KFD_IS_SOC15(kfddev->dev))
return -EINVAL;
svm_range_set_max_pages(adev);
if (adev->gmc.is_app_apu)
return 0;
pgmap = &kfddev->pgmap;
memset(pgmap, 0, sizeof(*pgmap));
@@ -1042,8 +1047,6 @@ int svm_migrate_init(struct amdgpu_device *adev)
amdgpu_amdkfd_reserve_system_mem(SVM_HMM_PAGE_STRUCT_SIZE(size));
svm_range_set_max_pages(adev);
pr_info("HMM registered %ldMB device memory\n", size >> 20);
return 0;