summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-09-09 04:06:56 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-09-09 04:06:56 +0000
commit6cf13c37aadc94ab4f1c52cc2b8822a49e3cde80 (patch)
treeeb38227c7119b91e1d469bfa8e79cb875e17660b /sys/dev/pci/drm
parentb6fdb07ac0337874d5189a32e3995b4e09a6b433 (diff)
drm/amd/pm: change the workload type for some cards
From Kenneth Feng b00ca567579a4c2f9a4cd6f9a63946f793e8b506 in linux 5.10.y/5.10.62 93c5701b00d50d192ce2247cb10d6c0b3fe25cd8 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
index 2f766a48c45..f2654cc87e0 100644
--- a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
+++ b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
@@ -5122,6 +5122,13 @@ static int vega10_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf)
return size;
}
+static bool vega10_get_power_profile_mode_quirks(struct pp_hwmgr *hwmgr)
+{
+ struct amdgpu_device *adev = hwmgr->adev;
+
+ return (adev->pdev->device == 0x6860);
+}
+
static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uint32_t size)
{
struct vega10_hwmgr *data = hwmgr->backend;
@@ -5158,9 +5165,15 @@ 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,
+ if (vega10_get_power_profile_mode_quirks(hwmgr))
+ smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,
1 << power_profile_mode,
NULL);
+ else
+ smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,
+ (!power_profile_mode) ? 0 : 1 << (power_profile_mode - 1),
+ NULL);
+
hwmgr->power_profile_mode = power_profile_mode;
return 0;