Skip to contentSkip to conversation

drm/amd/pp: Fix logic error of disable mclk switch on Vega10

PATCH In review Rex Zhu 2 participants 2 messages Feb 2, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amd/pp: Fix logic error of disable mclk switch on Vega10

Change-Id I38b60d0be9dc800a3492dd9fb17dc56ade77c0db
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +4 -7
index 292f013..dfaadab 100644
@@ -3164,16 +3164,14 @@ static int vega10_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
 		minimum_clocks.memoryClock = stable_pstate_mclk;
 	}
 
-	disable_mclk_switching_for_frame_lock = phm_cap_enabled(
-				    hwmgr->platform_descriptor.platformCaps,
-				    PHM_PlatformCaps_DisableMclkSwitchingForFrameLock);
+	disable_mclk_switching_for_frame_lock = PP_CAP(PHM_PlatformCaps_DisableMclkSwitchingForFrameLock);
 	disable_mclk_switching_for_vr = PP_CAP(PHM_PlatformCaps_DisableMclkSwitchForVR);
 	force_mclk_high = PP_CAP(PHM_PlatformCaps_ForceMclkHigh);
 
-	disable_mclk_switching = (info.display_count > 1) ||
-				    disable_mclk_switching_for_frame_lock ||
+	disable_mclk_switching = (info.display_count > 1) &&
+				    (disable_mclk_switching_for_frame_lock ||
 				    disable_mclk_switching_for_vr ||
-				    force_mclk_high;
+				    force_mclk_high);
 
 	sclk = vega10_ps->performance_levels[0].gfx_clock;
 	mclk = vega10_ps->performance_levels[0].mem_clock;
@@ -5160,6 +5158,5 @@ int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
 {
 	hwmgr->hwmgr_func = &vega10_hwmgr_funcs;
 	hwmgr->pptable_func = &vega10_pptable_funcs;
-
 	return 0;
 }
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1517554575-32538-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 18 lines · Rex Zhu
Change-Id I38b60d0be9dc800a3492dd9fb17dc56ade77c0db
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -3
index 292f013..dfaadab 100644
@@ -3164,16 +3164,14 @@ static int vega10_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
                minimum_clocks.memoryClock = stable_pstate_mclk;
        }
 
-       disable_mclk_switching_for_frame_lock = phm_cap_enabled(
-                                   hwmgr->platform_descriptor.platformCaps,
-                                   PHM_PlatformCaps_DisableMclkSwitchingForFrameLock);
+       disable_mclk_switching_for_frame_lock = PP_CAP(PHM_PlatformCaps_DisableMclkSwitchingForFrameLock);

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_apply_state_adjust_rules(struct pp_hwmgr *hwmgr, · line 3174

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +3 -3
        disable_mclk_switching_for_vr = PP_CAP(PHM_PlatformCaps_DisableMclkSwitchForVR);
        force_mclk_high = PP_CAP(PHM_PlatformCaps_ForceMclkHigh);
 
-       disable_mclk_switching = (info.display_count > 1) ||
-                                   disable_mclk_switching_for_frame_lock ||
+       disable_mclk_switching = (info.display_count > 1) &&
+                                   (disable_mclk_switching_for_frame_lock ||
                                    disable_mclk_switching_for_vr ||
-                                   force_mclk_high;
+                                   force_mclk_high);

I think this breaks the single display logic. In this case, we probably display_count >= 1 if we switch the logic to &&.

Alex

Quoted 13 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -2
        sclk = vega10_ps->performance_levels[0].gfx_clock;
        mclk = vega10_ps->performance_levels[0].mem_clock;
@@ -5160,6 +5158,5 @@ int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
 {
        hwmgr->hwmgr_func = &vega10_hwmgr_funcs;
        hwmgr->pptable_func = &vega10_pptable_funcs;
-
        return 0;
 }
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx