Skip to contentSkip to conversation

Simple cleanups for cz_hwmgr.c

PATCH In review Tom St Denis 2 participants 13 messages Oct 16, 2017 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/7 drm/amd/powerplay: Tidy up cz_start_dpm()

---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -7
index 96da4fc9c998..75af4d94f902 100644
@@ -961,18 +961,13 @@ static void cz_clear_voting_clients(struct pp_hwmgr *hwmgr)
 
 static int cz_start_dpm(struct pp_hwmgr *hwmgr)
 {
-	int ret = 0;
 	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
-	unsigned long dpm_features = 0;
 
 	cz_hwmgr->dpm_flags |= DPMFlags_SCLK_Enabled;
-	dpm_features |= SCLK_DPM_MASK;
 
-	ret = smum_send_msg_to_smc_with_parameter(hwmgr,
+	return smum_send_msg_to_smc_with_parameter(hwmgr,
 				PPSMC_MSG_EnableAllSmuFeatures,
-				dpm_features);
-
-	return ret;
+				SCLK_DPM_MASK);
 }
 
 static int cz_stop_dpm(struct pp_hwmgr *hwmgr)
Signature · 6 lines
2.12.0

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

PATCH 2/7 drm/amd/powerplay: Tidy up cz_dpm_powerdown_uvd()

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +1 -2
index 75af4d94f902..6ba41d7401b6 100644
@@ -1276,8 +1276,7 @@ int cz_dpm_powerdown_uvd(struct pp_hwmgr *hwmgr)
 {
 	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
 					 PHM_PlatformCaps_UVDPowerGating))
-		return smum_send_msg_to_smc(hwmgr,
-						     PPSMC_MSG_UVDPowerOFF);
+		return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_UVDPowerOFF);
 	return 0;
 }
 
Signature · 6 lines
2.12.0

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

PATCH 3/7 drm/amd/powerplay: Tidy up cz_dpm_powerup_uvd()

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +5 -12
index 6ba41d7401b6..e7ce123db942 100644
@@ -1282,18 +1282,11 @@ int cz_dpm_powerdown_uvd(struct pp_hwmgr *hwmgr)
 
 int cz_dpm_powerup_uvd(struct pp_hwmgr *hwmgr)
 {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-					 PHM_PlatformCaps_UVDPowerGating)) {
-		if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-				  PHM_PlatformCaps_UVDDynamicPowerGating)) {
-			return smum_send_msg_to_smc_with_parameter(
-								hwmgr,
-						   PPSMC_MSG_UVDPowerON, 1);
-		} else {
-			return smum_send_msg_to_smc_with_parameter(
-								hwmgr,
-						   PPSMC_MSG_UVDPowerON, 0);
-		}
+	if (PP_CAP(PHM_PlatformCaps_UVDPowerGating)) {
+		return smum_send_msg_to_smc_with_parameter(
+			hwmgr,
+			PPSMC_MSG_UVDPowerON,
+			PP_CAP(PHM_PlatformCaps_UVDDynamicPowerGating) ? 1 : 0);
 	}
 
 	return 0;
Signature · 6 lines
2.12.0

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

PATCH 4/7 drm/amd/powerplay: Tidy up cz_dpm_update_uvd_dpm()

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +6 -7
index e7ce123db942..3abd6b2988e5 100644
@@ -1300,17 +1300,16 @@ 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)
-			|| hwmgr->en_umd_pstate) {
+		if (PP_CAP(PHM_PlatformCaps_StablePState) ||
+		    hwmgr->en_umd_pstate) {
 			cz_hwmgr->uvd_dpm.hard_min_clk =
 				   ptable->entries[ptable->count - 1].vclk;
 
 			smum_send_msg_to_smc_with_parameter(hwmgr,
-						     PPSMC_MSG_SetUvdHardMin,
-						      cz_get_uvd_level(hwmgr,
-					     cz_hwmgr->uvd_dpm.hard_min_clk,
-						   PPSMC_MSG_SetUvdHardMin));
+				PPSMC_MSG_SetUvdHardMin,
+				cz_get_uvd_level(hwmgr,
+					cz_hwmgr->uvd_dpm.hard_min_clk,
+					PPSMC_MSG_SetUvdHardMin));
 
 			cz_enable_disable_uvd_dpm(hwmgr, true);
 		} else {
Signature · 6 lines
2.12.0

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

PATCH 5/7 drm/amd/powerplay: Tidy up cz_dpm_update_vce_dpm()

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +10 -11
index 3abd6b2988e5..36d975dde65f 100644
@@ -1329,17 +1329,16 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr)
 		hwmgr->dyn_state.vce_clock_voltage_dependency_table;
 
 	/* 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)
-					|| hwmgr->en_umd_pstate) {
+	if (PP_CAP(PHM_PlatformCaps_StablePState) ||
+	    hwmgr->en_umd_pstate) {
 		cz_hwmgr->vce_dpm.hard_min_clk =
 				  ptable->entries[ptable->count - 1].ecclk;
 
 		smum_send_msg_to_smc_with_parameter(hwmgr,
-					PPSMC_MSG_SetEclkHardMin,
-					cz_get_eclk_level(hwmgr,
-					     cz_hwmgr->vce_dpm.hard_min_clk,
-						PPSMC_MSG_SetEclkHardMin));
+			PPSMC_MSG_SetEclkHardMin,
+			cz_get_eclk_level(hwmgr,
+				cz_hwmgr->vce_dpm.hard_min_clk,
+				PPSMC_MSG_SetEclkHardMin));
 	} else {
 		/*Program HardMin based on the vce_arbiter.ecclk */
 		if (hwmgr->vce_arbiter.ecclk == 0) {
@@ -1352,10 +1351,10 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr)
 		} else {
 			cz_hwmgr->vce_dpm.hard_min_clk = hwmgr->vce_arbiter.ecclk;
 			smum_send_msg_to_smc_with_parameter(hwmgr,
-						PPSMC_MSG_SetEclkHardMin,
-						cz_get_eclk_level(hwmgr,
-						cz_hwmgr->vce_dpm.hard_min_clk,
-						PPSMC_MSG_SetEclkHardMin));
+				PPSMC_MSG_SetEclkHardMin,
+				cz_get_eclk_level(hwmgr,
+					cz_hwmgr->vce_dpm.hard_min_clk,
+					PPSMC_MSG_SetEclkHardMin));
 		}
 	}
 	return 0;
Signature · 6 lines
2.12.0

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

PATCH 6/7 drm/amd/powerplay: Tidy up cz_dpm_powerdown_vce()

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -3
index 36d975dde65f..23df056a034b 100644
@@ -1362,10 +1362,9 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr)
 
 int cz_dpm_powerdown_vce(struct pp_hwmgr *hwmgr)
 {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-					 PHM_PlatformCaps_VCEPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_VCEPowerGating))
 		return smum_send_msg_to_smc(hwmgr,
-						     PPSMC_MSG_VCEPowerOFF);
+				PPSMC_MSG_VCEPowerOFF);
 	return 0;
 }
 
Signature · 6 lines
2.12.0

_______________________________________________
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): [email protected]

#9 lore raw

RE: [PATCH 6/7] drm/amd/powerplay: Tidy up cz_dpm_powerdown_vce()

Quoted 22 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Monday, October 16, 2017 1:55 PM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH 6/7] drm/amd/powerplay: Tidy up cz_dpm_powerdown_vce()

---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
index 36d975dde65f..23df056a034b 100644
@@ -1362,10 +1362,9 @@ int  cz_dpm_update_vce_dpm(struct pp_hwmgr
 *hwmgr)
 

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c int cz_dpm_update_vce_dpm(struct pp_hwmgr · line 1370

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -3
 int cz_dpm_powerdown_vce(struct pp_hwmgr *hwmgr)
 {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-
 PHM_PlatformCaps_VCEPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_VCEPowerGating))
 		return smum_send_msg_to_smc(hwmgr,
-
 PPSMC_MSG_VCEPowerOFF);
+				PPSMC_MSG_VCEPowerOFF);

The indentation looked correct before.

Alex

Quoted 10 lines

return 0;
}

--
2.12.0

_______________________________________________
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

#10 lore raw

PATCH 7/7 drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -3
index 23df056a034b..ca06033cd155 100644
@@ -1370,10 +1370,9 @@ int cz_dpm_powerdown_vce(struct pp_hwmgr *hwmgr)
 
 int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr)
 {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-					 PHM_PlatformCaps_VCEPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_VCEPowerGating))
 		return smum_send_msg_to_smc(hwmgr,
-						     PPSMC_MSG_VCEPowerON);
+				PPSMC_MSG_VCEPowerON);
 	return 0;
 }
 
Signature · 6 lines
2.12.0

_______________________________________________
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): [email protected]

#12 lore raw

RE: [PATCH 7/7] drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

Quoted 21 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Monday, October 16, 2017 1:55 PM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH 7/7] drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
index 23df056a034b..ca06033cd155 100644
@@ -1370,10 +1370,9 @@ int cz_dpm_powerdown_vce(struct pp_hwmgr
 *hwmgr)
 

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c int cz_dpm_powerdown_vce(struct pp_hwmgr · line 1378

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -3
 int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr)
 {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-
 PHM_PlatformCaps_VCEPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_VCEPowerGating))
 		return smum_send_msg_to_smc(hwmgr,
-
 PPSMC_MSG_VCEPowerON);
+				PPSMC_MSG_VCEPowerON);

Same here (indentation looked correct before).

Alex

Quoted 10 lines

return 0;
}

--
2.12.0

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652818229E93890BA988F6BF74F0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#14 lore raw

Re: [PATCH 7/7] drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

Quoted 21 lines · Alexander
Quoted 21 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Monday, October 16, 2017 1:55 PM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH 7/7] drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

---
  drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
index 23df056a034b..ca06033cd155 100644
@@ -1370,10 +1370,9 @@ int cz_dpm_powerdown_vce(struct pp_hwmgr
 *hwmgr)
 
Quoted 12 lines

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c int cz_dpm_powerdown_vce(struct pp_hwmgr *hwmgr) · line 1375

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -3
  int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr)
  {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-
 PHM_PlatformCaps_VCEPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_VCEPowerGating))
  		return smum_send_msg_to_smc(hwmgr,
-
 PPSMC_MSG_VCEPowerON);
+				PPSMC_MSG_VCEPowerON);

Same here (indentation looked correct before).

I was simply trying to make the lines a bit narrower. (while using the PP_CAP macro).

I can drop that part of the commits if you want.

Tom
_______________________________________________
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): e18b6bdf-a2da-73d9-2c72-acce94d7671f-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#16 lore raw

RE: [PATCH 7/7] drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

Quoted 44 lines

-----Original Message-----
From: StDenis, Tom
Sent: Monday, October 16, 2017 2:25 PM
To: Deucher, Alexander; [email protected]
Subject: Re: [PATCH 7/7] drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()

Quoted 2 lines · Alexander
Quoted 2 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On

Behalf

Quoted 5 lines
Quoted 5 lines

Of Tom St Denis
Sent: Monday, October 16, 2017 1:55 PM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH 7/7] drm/amd/powerplay: Tidy up

cz_dpm_powerup_vce()

Quoted 14 lines
Quoted 14 lines
---
  drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
index 23df056a034b..ca06033cd155 100644
@@ -1370,10 +1370,9 @@ int cz_dpm_powerdown_vce(struct pp_hwmgr
 *hwmgr)
 
Quoted 12 lines

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c int cz_dpm_powerdown_vce(struct pp_hwmgr *hwmgr) · line 1375

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -3
  int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr)
  {
-	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-
 PHM_PlatformCaps_VCEPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_VCEPowerGating))
  		return smum_send_msg_to_smc(hwmgr,
-
 PPSMC_MSG_VCEPowerON);
+				PPSMC_MSG_VCEPowerON);

Same here (indentation looked correct before).

Quoted 4 lines

I was simply trying to make the lines a bit narrower. (while using the PP_CAP macro).

I can drop that part of the commits if you want.

Please. Thanks! With that fixed and the commit messages updates, patches 6 and 7 are:

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

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

Please provide a commit message for each patch. E.g., something like:

Fix up whitespace and use new PP_CAP macro. No function change intended.

With that fixed, patches 1-5 are:

The new indentation looks wrong on patches 6 and 7.

Alex

Quoted 7 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Monday, October 16, 2017 1:55 PM
To: [email protected]
Subject: Simple cleanups for cz_hwmgr.c

Quoted 6 lines

Small set of simple cleanups with no functional changes.

_______________________________________________
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