mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
drm/amdkfd: Refactor migrate init to support partition switch
Rename smv_migrate_init to a better name kgd2kfd_init_zone_device because it setup zone devive pgmap for page migration and keep it in kfd_migrate.c to access static functions svm_migrate_pgmap_ops. Call it only once in amdgpu_device_ip_init after adev ip blocks are initialized, but before amdgpu_amdkfd_device_init initialize kfd nodes which enable SVM support based on pgmap. svm_range_set_max_pages is called by kgd2kfd_device_init everytime after switching compute partition mode. 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:
committed by
Alex Deucher
parent
44a9766555
commit
84b4dd3f84
@@ -988,7 +988,7 @@ static const struct dev_pagemap_ops svm_migrate_pgmap_ops = {
|
||||
/* Each VRAM page uses sizeof(struct page) on system memory */
|
||||
#define SVM_HMM_PAGE_STRUCT_SIZE(size) ((size)/PAGE_SIZE * sizeof(struct page))
|
||||
|
||||
int svm_migrate_init(struct amdgpu_device *adev)
|
||||
int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_kfd_dev *kfddev = &adev->kfd;
|
||||
struct dev_pagemap *pgmap;
|
||||
@@ -996,12 +996,10 @@ int svm_migrate_init(struct amdgpu_device *adev)
|
||||
unsigned long size;
|
||||
void *r;
|
||||
|
||||
/* Page migration works on Vega10 or newer */
|
||||
if (!KFD_IS_SOC15(kfddev->dev))
|
||||
/* Page migration works on gfx9 or newer */
|
||||
if (adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 1))
|
||||
return -EINVAL;
|
||||
|
||||
svm_range_set_max_pages(adev);
|
||||
|
||||
if (adev->gmc.is_app_apu)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user