This patch is used for virtualization support. In virtualization,
only SMU manager is needed, DPM should be disabled. This is a
use case for commit
2f9346b6f984
("drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.")
Signed-off-by: Trigger Huang <trigger.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
ret = adev->powerplay.ip_funcs->hw_init(
adev->powerplay.pp_handle);
- if (amdgpu_dpm != 0)
+ if ((amdgpu_dpm != 0) && !amdgpu_sriov_vf(adev))
adev->pm.dpm_enabled = true;
return ret;
amd_pp->pp_handle = handle;
- if (amdgpu_dpm == 0)
+ if ((amdgpu_dpm == 0)
+ || cgs_is_virtualization_enabled(pp_init->device))
return 0;
ret = hwmgr_init(pp_init, handle);
if (instance == NULL)
return -EINVAL;
- if (amdgpu_dpm != 0) {
+ if ((amdgpu_dpm != 0)
+ && !cgs_is_virtualization_enabled(instance->smu_mgr->device)) {
eventmgr_fini(instance->eventmgr);
hwmgr_fini(instance->hwmgr);
}
hw_init_power_state_table(instance->hwmgr);
- if (amdgpu_dpm == 0)
+ if ((amdgpu_dpm == 0)
+ || cgs_is_virtualization_enabled(instance->smu_mgr->device))
return 0;
if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL)