drm/amd/pm: fix workload mismatch on vega10
authorKenneth Feng <kenneth.feng@amd.com>
Tue, 16 Mar 2021 02:28:00 +0000 (10:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:25 +0000 (14:47 +0200)
[ Upstream commit 0979d43259e13846d86ba17e451e17fec185d240 ]

Workload number mapped to the correct one.
This issue is only on vega10.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c

index ed4eafc744d3da6d9d2e3ece6cf2a1ce4116a7d2..132c269c7c89391c49b00889bf5a4ab4ac60ac70 100644 (file)
@@ -5159,7 +5159,7 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui
 
 out:
        smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,
-                                               1 << power_profile_mode,
+                                               (!power_profile_mode) ? 0 : 1 << (power_profile_mode - 1),
                                                NULL);
        hwmgr->power_profile_mode = power_profile_mode;