mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 12:52:52 +00:00
drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr on unsupported ASICs
Otherwise, the error message prompted will confuse user. Signed-off-by: Evan Quan <evan.quan@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a310a1b4c1
commit
1ac38dbf6e
1 changed files with 18 additions and 5 deletions
|
@ -3477,18 +3477,31 @@ static int smu7_get_pp_table_entry(struct pp_hwmgr *hwmgr,
|
||||||
|
|
||||||
static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)
|
static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)
|
||||||
{
|
{
|
||||||
|
struct amdgpu_device *adev = hwmgr->adev;
|
||||||
int i;
|
int i;
|
||||||
u32 tmp = 0;
|
u32 tmp = 0;
|
||||||
|
|
||||||
if (!query)
|
if (!query)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
|
/*
|
||||||
tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
|
* PPSMC_MSG_GetCurrPkgPwr is not supported on:
|
||||||
*query = tmp;
|
* - Hawaii
|
||||||
|
* - Bonaire
|
||||||
|
* - Fiji
|
||||||
|
* - Tonga
|
||||||
|
*/
|
||||||
|
if ((adev->asic_type != CHIP_HAWAII) &&
|
||||||
|
(adev->asic_type != CHIP_BONAIRE) &&
|
||||||
|
(adev->asic_type != CHIP_FIJI) &&
|
||||||
|
(adev->asic_type != CHIP_TONGA)) {
|
||||||
|
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
|
||||||
|
tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
|
||||||
|
*query = tmp;
|
||||||
|
|
||||||
if (tmp != 0)
|
if (tmp != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);
|
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);
|
||||||
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
|
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue