summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-04-22 09:46:10 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-04-22 09:46:10 +0000
commit89db859bddf77c00479587fbf944ff360cbda2f0 (patch)
tree04c370b99e798b3c29f06c5328c1a459e4d1aeb7 /sys
parent3b0641bfbabde169b35decfc663456c2669c4ca1 (diff)
drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled
From Sergei Lopatin 9959d615b715972002ed1ec9961486ded26e2ef4 in linux 4.19.y/4.19.117 8c7f0a44b4b4ef16df8f44fbaee6d1f5d1593c83 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index f02a19c79eb..bd83791d2df 100644
--- a/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3788,9 +3788,12 @@ static int smu7_trim_single_dpm_states(struct pp_hwmgr *hwmgr,
{
uint32_t i;
+ /* force the trim if mclk_switching is disabled to prevent flicker */
+ bool force_trim = (low_limit == high_limit);
for (i = 0; i < dpm_table->count; i++) {
/*skip the trim if od is enabled*/
- if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit
+ if ((!hwmgr->od_enabled || force_trim)
+ && (dpm_table->dpm_levels[i].value < low_limit
|| dpm_table->dpm_levels[i].value > high_limit))
dpm_table->dpm_levels[i].enabled = false;
else