Reviewed-by: Evan Quan <evan.quan@xxxxxxx> -----Original Message----- From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Tiecheng Zhou Sent: Thursday, April 2, 2020 1:40 PM To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx Cc: Zhou, Tiecheng <Tiecheng.Zhou@xxxxxxx> Subject: [PATCH] drm/amd/powerplay: determine pm_en at amd_powerplay_create Need to determine pm_en at amd_powerplay_create of early_init stage. Signed-off-by: Tiecheng Zhou <Tiecheng.Zhou@xxxxxxx> --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 3 +++ drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 71b843f542d8..a37dc37dfe49 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -48,6 +48,9 @@ static int amd_powerplay_create(struct amdgpu_device *adev) hwmgr->adev = adev; hwmgr->not_vf = !amdgpu_sriov_vf(adev); + hwmgr->pp_one_vf = amdgpu_sriov_is_pp_one_vf(adev); + hwmgr->pm_en = (amdgpu_dpm && (hwmgr->not_vf || hwmgr->pp_one_vf)) + ? true : false; hwmgr->device = amdgpu_cgs_create_device(adev); mutex_init(&hwmgr->smu_lock); mutex_init(&hwmgr->msg_lock); diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c index f48fdc7f0382..7aee382fc1f9 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c @@ -221,9 +221,6 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr) { int ret = 0; - hwmgr->pp_one_vf = amdgpu_sriov_is_pp_one_vf((struct amdgpu_device *)hwmgr->adev); - hwmgr->pm_en = (amdgpu_dpm && (hwmgr->not_vf || hwmgr->pp_one_vf)) - ? true : false; if (!hwmgr->pm_en) return 0; -- 2.17.1 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7C879eafc288894347147c08d7d6c845b0%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637214028875355960&sdata=35oaGAN8RHzU4biNt7wWUZpskOehIQ0h%2Fao5HiVduBM%3D&reserved=0 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx