Skip to contentSkip to conversation

drm/amd/powerplay: set uvd/vce/nb/mclk level as UMD P-state required

PATCH In review Rex Zhu 2 participants 3 messages Sep 1, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 4/4 drm/amd/powerplay: set uvd/vce/nb/mclk level as UMD P-state required

Change-Id I6e5cb169fcc22525d26cdc3f82ca011249f912ef
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +9 -3
index 573e4da..3a8bc74 100644
@@ -1138,7 +1138,11 @@ static int cz_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
 
 	cz_ps->action = cz_current_ps->action;
 
-	if (!force_high && (cz_ps->action == FORCE_HIGH))
+	if (hwmgr->request_dpm_level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
+		cz_nbdpm_pstate_enable_disable(hwmgr, false, false);
+	else if (hwmgr->request_dpm_level == AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD)
+		cz_nbdpm_pstate_enable_disable(hwmgr, false, true);
+	else if (!force_high && (cz_ps->action == FORCE_HIGH))
 		cz_ps->action = CANCEL_FORCE_HIGH;
 	else if (force_high && (cz_ps->action != FORCE_HIGH))
 		cz_ps->action = FORCE_HIGH;
@@ -1416,7 +1420,8 @@ int cz_dpm_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate)
 	if (!bgate) {
 		/* Stable Pstate is enabled and we need to set the UVD DPM to highest level */
 		if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-					 PHM_PlatformCaps_StablePState)) {
+					 PHM_PlatformCaps_StablePState)
+			|| hwmgr->en_umd_pstate) {
 			cz_hwmgr->uvd_dpm.hard_min_clk =
 				   ptable->entries[ptable->count - 1].vclk;
 
@@ -1445,7 +1450,8 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr)
 
 	/* Stable Pstate is enabled and we need to set the VCE DPM to highest level */
 	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-					 PHM_PlatformCaps_StablePState)) {
+					PHM_PlatformCaps_StablePState)
+					|| hwmgr->en_umd_pstate) {
 		cz_hwmgr->vce_dpm.hard_min_clk =
 				  ptable->entries[ptable->count - 1].ecclk;
 
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Alex Deucher
#2 lore raw
In reply to a message not in the archive
Quoted 11 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Friday, September 01, 2017 5:51 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 4/4] drm/amd/powerplay: set uvd/vce/nb/mclk level as UMD P-state required

Change-Id I6e5cb169fcc22525d26cdc3f82ca011249f912ef

This series is:

BTW, can you review my stable p-state fix for CZ?
https://patchwork.freedesktop.org/patch/174102/

Thanks,

Alex

Quoted 53 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +5 -1
index 573e4da..3a8bc74 100644
@@ -1138,7 +1138,11 @@ static int cz_apply_state_adjust_rules(struct
 pp_hwmgr *hwmgr,
 
 	cz_ps->action = cz_current_ps->action;
 
-	if (!force_high && (cz_ps->action == FORCE_HIGH))
+	if (hwmgr->request_dpm_level ==
 AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
+		cz_nbdpm_pstate_enable_disable(hwmgr, false, false);
+	else if (hwmgr->request_dpm_level ==
 AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD)
+		cz_nbdpm_pstate_enable_disable(hwmgr, false, true);
+	else if (!force_high && (cz_ps->action == FORCE_HIGH))
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
 		cz_ps->action = CANCEL_FORCE_HIGH;
 	else if (force_high && (cz_ps->action != FORCE_HIGH))
 		cz_ps->action = FORCE_HIGH;
@@ -1416,7 +1420,8 @@ int cz_dpm_update_uvd_dpm(struct pp_hwmgr
 *hwmgr, bool bgate)
 	if (!bgate) {
 		/* Stable Pstate is enabled and we need to set the UVD DPM

to highest level */
if (phm_cap_enabled(hwmgr-

Quoted 1 line

platform_descriptor.platformCaps,

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -1
-					 PHM_PlatformCaps_StablePState)) {
+					 PHM_PlatformCaps_StablePState)
+			|| hwmgr->en_umd_pstate) {
 			cz_hwmgr->uvd_dpm.hard_min_clk =
 				   ptable->entries[ptable->count - 1].vclk;
@@ -1445,7 +1450,8 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr
 *hwmgr)
 
 	/* Stable Pstate is enabled and we need to set the VCE DPM to

highest level */

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -2
 	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-					 PHM_PlatformCaps_StablePState)) {
+					PHM_PlatformCaps_StablePState)
+					|| hwmgr->en_umd_pstate) {
 		cz_hwmgr->vce_dpm.hard_min_clk =
 				  ptable->entries[ptable->count - 1].ecclk;
 
--

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

author Reviewed-by Reviewed-by Alex Deucher
#4 lore raw
In reply to a message not in the archive

Hi Alex,

》BTW, can you review my stable p-state fix for CZ? 》https://patchwork.freedesktop.org/patch/174102

Patch is

Best Regards
Rex

________________________________
From: Deucher, Alexander
Sent: Friday, September 1, 2017 11:03:10 PM
To: Zhu, Rex; [email protected]
Cc: Zhu, Rex
Subject: RE: [PATCH 4/4] drm/amd/powerplay: set uvd/vce/nb/mclk level as UMD P-state required

Quoted 11 lines

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Rex Zhu
Sent: Friday, September 01, 2017 5:51 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 4/4] drm/amd/powerplay: set uvd/vce/nb/mclk level as
UMD P-state required

Change-Id I6e5cb169fcc22525d26cdc3f82ca011249f912ef

This series is:

BTW, can you review my stable p-state fix for CZ?
https://patchwork.freedesktop.org/patch/174102/

Thanks,

Alex

Quoted 53 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +5 -1
index 573e4da..3a8bc74 100644
@@ -1138,7 +1138,11 @@ static int cz_apply_state_adjust_rules(struct
 pp_hwmgr *hwmgr,
 
       cz_ps->action = cz_current_ps->action;
 
-     if (!force_high && (cz_ps->action == FORCE_HIGH))
+     if (hwmgr->request_dpm_level ==
 AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
+             cz_nbdpm_pstate_enable_disable(hwmgr, false, false);
+     else if (hwmgr->request_dpm_level ==
 AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD)
+             cz_nbdpm_pstate_enable_disable(hwmgr, false, true);
+     else if (!force_high && (cz_ps->action == FORCE_HIGH))
               cz_ps->action = CANCEL_FORCE_HIGH;
       else if (force_high && (cz_ps->action != FORCE_HIGH))
               cz_ps->action = FORCE_HIGH;
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
@@ -1416,7 +1420,8 @@ int cz_dpm_update_uvd_dpm(struct pp_hwmgr
 *hwmgr, bool bgate)
       if (!bgate) {
               /* Stable Pstate is enabled and we need to set the UVD DPM

to highest level */
if (phm_cap_enabled(hwmgr-

Quoted 1 line

platform_descriptor.platformCaps,

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -1
-                                      PHM_PlatformCaps_StablePState)) {
+                                      PHM_PlatformCaps_StablePState)
+                     || hwmgr->en_umd_pstate) {
                       cz_hwmgr->uvd_dpm.hard_min_clk =
                                  ptable->entries[ptable->count - 1].vclk;
@@ -1445,7 +1450,8 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr
 *hwmgr)
 
       /* Stable Pstate is enabled and we need to set the VCE DPM to

highest level */

       if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -2
-                                      PHM_PlatformCaps_StablePState)) {
+                                     PHM_PlatformCaps_StablePState)
+                                     || hwmgr->en_umd_pstate) {
               cz_hwmgr->vce_dpm.hard_min_clk =
                                 ptable->entries[ptable->count - 1].ecclk;
 
--

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