drm/amdgpu:fix powerplay logic
authorMonk Liu <Monk.Liu@amd.com>
Wed, 25 Jan 2017 07:55:30 +0000 (15:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:52:37 +0000 (23:52 -0400)
1,like pp_hw_init, we shouldn't report error if PP disabled
2,disable pp_en if sriov

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 8856eccc37fad48959e031ea4aa0581910db26ec..d56d200a3646b412d22b64a96faa19e2c6c55d39 100644 (file)
@@ -43,7 +43,7 @@ static int amdgpu_create_pp_handle(struct amdgpu_device *adev)
        amd_pp = &(adev->powerplay);
        pp_init.chip_family = adev->family;
        pp_init.chip_id = adev->asic_type;
-       pp_init.pm_en = amdgpu_dpm != 0 ? true : false;
+       pp_init.pm_en = (amdgpu_dpm != 0 && !amdgpu_sriov_vf(adev)) ? true : false;
        pp_init.feature_mask = amdgpu_pp_feature_mask;
        pp_init.device = amdgpu_cgs_create_device(adev);
        ret = amd_powerplay_create(&pp_init, &(amd_pp->pp_handle));
index 429f18b9932345ff31c9e8a3b8897a1761f2a5fa..e9cf207b9dcf3ba5d89c4385a5956826875543f9 100644 (file)
@@ -286,7 +286,7 @@ static int pp_resume(void *handle)
        }
 
        if (ret1 == PP_DPM_DISABLED)
-               return ret1;
+               return 0;
 
        eventmgr = pp_handle->eventmgr;