]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/powerplay: enable dpm under pass-through
authorYintian Tao <yttao@amd.com>
Mon, 20 Aug 2018 03:11:48 +0000 (11:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Aug 2018 19:18:21 +0000 (14:18 -0500)
Repeat enable dpm under pass-through because there is no actually
hardware-fini and real power-off when guest vm shutdown or reboot.
Otherwise, under pass-through it will be failed to populate populate
and upload SCLK MCLK DPM levels due to zero of pcie_speed_table.count.

Signed-off-by: Yintian Tao <yttao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c

index 53207e76b0f348a9ba82cb7bc347e78a6c7daab3..6ef3c875fedd555edbd667267639a6ed4aeb4485 100644 (file)
@@ -75,10 +75,12 @@ int phm_set_power_state(struct pp_hwmgr *hwmgr,
 
 int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr)
 {
+       struct amdgpu_device *adev = NULL;
        int ret = -EINVAL;;
        PHM_FUNC_CHECK(hwmgr);
+       adev = hwmgr->adev;
 
-       if (smum_is_dpm_running(hwmgr)) {
+       if (smum_is_dpm_running(hwmgr) && !amdgpu_passthrough(adev)) {
                pr_info("dpm has been enabled\n");
                return 0;
        }