Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Disable DPM in virtualization

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>

authored by

Trigger Huang and committed by
Alex Deucher
7b1e8cad 617859e0

+7 -4
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
··· 184 184 ret = adev->powerplay.ip_funcs->hw_init( 185 185 adev->powerplay.pp_handle); 186 186 187 - if (amdgpu_dpm != 0) 187 + if ((amdgpu_dpm != 0) && !amdgpu_sriov_vf(adev)) 188 188 adev->pm.dpm_enabled = true; 189 189 190 190 return ret;
+6 -3
drivers/gpu/drm/amd/powerplay/amd_powerplay.c
··· 911 911 912 912 amd_pp->pp_handle = handle; 913 913 914 - if (amdgpu_dpm == 0) 914 + if ((amdgpu_dpm == 0) 915 + || cgs_is_virtualization_enabled(pp_init->device)) 915 916 return 0; 916 917 917 918 ret = hwmgr_init(pp_init, handle); ··· 941 940 if (instance == NULL) 942 941 return -EINVAL; 943 942 944 - if (amdgpu_dpm != 0) { 943 + if ((amdgpu_dpm != 0) 944 + && !cgs_is_virtualization_enabled(instance->smu_mgr->device)) { 945 945 eventmgr_fini(instance->eventmgr); 946 946 hwmgr_fini(instance->hwmgr); 947 947 } ··· 1006 1004 1007 1005 hw_init_power_state_table(instance->hwmgr); 1008 1006 1009 - if (amdgpu_dpm == 0) 1007 + if ((amdgpu_dpm == 0) 1008 + || cgs_is_virtualization_enabled(instance->smu_mgr->device)) 1010 1009 return 0; 1011 1010 1012 1011 if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL)