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/amdgpu: update xgmi info and vram_base_offset on resume
For SRIOV VM env with XGMI enabled systems, XGMI physical node id may change when hibernate and resume with different VF. Update XGMI info and vram_base_offset on resume for gfx444 SRIOV env. Add amdgpu_virt_xgmi_migrate_enabled() as the feature flag. Signed-off-by: Jiang Liu <gerry@linux.alibaba.com> Signed-off-by: Samuel Zhang <guoqing.zhang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
78d7032b08
commit
855a2a029a
@@ -2773,6 +2773,12 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
|
||||
if (!amdgpu_device_pcie_dynamic_switching_supported(adev))
|
||||
adev->pm.pp_feature &= ~PP_PCIE_DPM_MASK;
|
||||
|
||||
adev->virt.is_xgmi_node_migrate_enabled = false;
|
||||
if (amdgpu_sriov_vf(adev)) {
|
||||
adev->virt.is_xgmi_node_migrate_enabled =
|
||||
amdgpu_ip_version((adev), GC_HWIP, 0) == IP_VERSION(9, 4, 4);
|
||||
}
|
||||
|
||||
total = true;
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
ip_block = &adev->ip_blocks[i];
|
||||
@@ -5098,6 +5104,25 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int amdgpu_virt_resume(struct amdgpu_device *adev)
|
||||
{
|
||||
int r;
|
||||
unsigned int prev_physical_node_id = adev->gmc.xgmi.physical_node_id;
|
||||
|
||||
r = adev->gfxhub.funcs->get_xgmi_info(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
dev_info(adev->dev, "xgmi node, old id %d, new id %d\n",
|
||||
prev_physical_node_id, adev->gmc.xgmi.physical_node_id);
|
||||
|
||||
adev->vm_manager.vram_base_offset = adev->gfxhub.funcs->get_mc_fb_offset(adev);
|
||||
adev->vm_manager.vram_base_offset +=
|
||||
adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_device_resume - initiate device resume
|
||||
*
|
||||
@@ -5119,6 +5144,12 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (amdgpu_virt_xgmi_migrate_enabled(adev)) {
|
||||
r = amdgpu_virt_resume(adev);
|
||||
if (r)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user