drm/amd/pp: Refine get_gpu_power for VI
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 4 Apr 2018 06:17:09 +0000 (14:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:43:17 +0000 (13:43 -0500)
commitb89c71d1eb1c43c6c61f6d74d7454702d367f18b
treeaf713e0a2d9680e7b704291142a1340e29ee3558
parenta0701722b68e69443dd3dd7970a9f343b7560a2c
drm/amd/pp: Refine get_gpu_power for VI

pkgpwr is the average gpu power of 100ms. it is calculated by
firmware in real time.

1. we can send smu message PPSMC_MSG_GetCurrPkgPwr to read currentpkgpwr directly.

2. On Fiji/tonga/bonaire/hawwii, without PPSMC_MSG_GetCurrPkgPwr support.
   Send PPSMC_MSG_PmStatusLogStart/Sample to let smu write currentpkgpwr
   to ixSMU_PM_STATUS_94. driver can read pkgpwr from ixSMU_PM_STATUS_94.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c