Skip to contentSkip to conversation

Enable UVD PG for SMU7 and turn on for Tonga

PATCH New Tom St Denis 3 participants 6 messages Sep 30, 2016 3 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/2 drm/amd/powerplay: Enable UVD powergating for SMU7

This patch enables detecting VCE/UVD PG features and fixes the UVD powergate function.

Tested on a Tonga (by reading UVD tile/clk bits during playback/idle).

---
 .../gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c    | 12 +++++++++---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c           | 14 ++++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +9 -3
index 6eb6db199250..0537407db00a 100644
@@ -149,15 +149,21 @@ int smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
 	if (bgate) {
 		cgs_set_clockgating_state(hwmgr->device,
 				AMD_IP_BLOCK_TYPE_UVD,
-				AMD_CG_STATE_GATE);
+				AMD_CG_STATE_UNGATE);
+		cgs_set_powergating_state(hwmgr->device,
+						AMD_IP_BLOCK_TYPE_UVD,
+						AMD_PG_STATE_GATE);
 		smu7_update_uvd_dpm(hwmgr, true);
 		smu7_powerdown_uvd(hwmgr);
 	} else {
 		smu7_powerup_uvd(hwmgr);
-		smu7_update_uvd_dpm(hwmgr, false);
+		cgs_set_powergating_state(hwmgr->device,
+						AMD_IP_BLOCK_TYPE_UVD,
+						AMD_CG_STATE_UNGATE);
 		cgs_set_clockgating_state(hwmgr->device,
 				AMD_IP_BLOCK_TYPE_UVD,
-				AMD_CG_STATE_UNGATE);
+				AMD_CG_STATE_GATE);
+		smu7_update_uvd_dpm(hwmgr, false);
 	}
 
 	return 0;
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +14 -0
index 508245d49d33..06ab90b97bb8 100644
@@ -1344,6 +1344,8 @@ static void smu7_init_dpm_defaults(struct pp_hwmgr *hwmgr)
 	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 	struct phm_ppt_v1_information *table_info =
 			(struct phm_ppt_v1_information *)(hwmgr->pptable);
+	struct cgs_system_info sys_info = {0};
+	int result;
 
 	data->dll_default_on = false;
 	data->mclk_dpm0_activity_target = 0xa;
@@ -1431,6 +1433,18 @@ static void smu7_init_dpm_defaults(struct pp_hwmgr *hwmgr)
 	data->pcie_lane_performance.min = 16;
 	data->pcie_lane_power_saving.max = 0;
 	data->pcie_lane_power_saving.min = 16;
+
+	sys_info.size = sizeof(struct cgs_system_info);
+	sys_info.info_id = CGS_SYSTEM_INFO_PG_FLAGS;
+	result = cgs_query_system_info(hwmgr->device, &sys_info);
+	if (!result) {
+		if (sys_info.value & AMD_PG_SUPPORT_UVD)
+			phm_cap_set(hwmgr->platform_descriptor.platformCaps,
+				      PHM_PlatformCaps_UVDPowerGating);
+		if (sys_info.value & AMD_PG_SUPPORT_VCE)
+			phm_cap_set(hwmgr->platform_descriptor.platformCaps,
+				      PHM_PlatformCaps_VCEPowerGating);
+	}
 }
 
 /**
Signature · 6 lines
2.10.0

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

PATCH 2/2 drm/amd/amdgpu: Enable UVD PG on Tonga

In reply to a message not in the archive

Tested by reading tile/clk bits during load/idle.

---
 drivers/gpu/drm/amd/amdgpu/vi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
index c6bc3df36118..c4394a6b82e9 100644
@@ -1924,7 +1924,7 @@ static int vi_common_early_init(void *handle)
 		break;
 	case CHIP_TONGA:
 		adev->cg_flags = AMD_CG_SUPPORT_UVD_MGCG;
-		adev->pg_flags = 0;
+		adev->pg_flags = AMD_PG_SUPPORT_UVD;
 		adev->external_rev_id = adev->rev_id + 0x14;
 		break;
 	case CHIP_POLARIS11:
Signature · 6 lines
2.10.0

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

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Friday, September 30, 2016 11:02 AM
To: [email protected]
Subject: Enable UVD PG for SMU7 and turn on for Tonga

Quoted 5 lines

Patch #1 fixes the UVD powergating function in the smu7 driver as well as senses vce/uvd features (so we can fix/add vce PG later on).

Patch #2 enables it for tonga. Tested by reading tile/clk bits during load/idle.

Nice! Series is:

_______________________________________________
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): MWHPR12MB16943DBE19AD9985AB0229C0F7C10-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Alex Deucher
#6 lore raw

Thanks. I'll try it on FIJI next. Hopefully MGCG isn't needed for at least basic tile power control.

Tom

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Deucher, Alexander <[email protected]>
Sent: Friday, September 30, 2016 11:10
To: 'Tom St Denis'; [email protected]
Subject: RE: Enable UVD PG for SMU7 and turn on for Tonga

Quoted 7 lines

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Tom St Denis
Sent: Friday, September 30, 2016 11:02 AM
To: [email protected]
Subject: Enable UVD PG for SMU7 and turn on for Tonga

Quoted 5 lines

Patch #1 fixes the UVD powergating function in the smu7 driver as well as senses vce/uvd features (so we can fix/add vce PG later on).

Patch #2 enables it for tonga. Tested by reading tile/clk bits during load/idle.

Nice! Series is:

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

Reviewed-by Alex Deucher
#8 lore raw

I'm not sure Fiji supports PG on any blocks. You may want to double check with the hw teams.

Alex

From: StDenis, Tom
Sent: Friday, September 30, 2016 11:13 AM
To: Deucher, Alexander; [email protected]
Subject: Re: Enable UVD PG for SMU7 and turn on for Tonga

Thanks. I'll try it on FIJI next. Hopefully MGCG isn't needed for at least basic tile power control.

Tom

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Deucher, Alexander <[email protected]<mailto:[email protected]>>
Sent: Friday, September 30, 2016 11:10
To: 'Tom St Denis'; [email protected]<mailto:[email protected]>
Subject: RE: Enable UVD PG for SMU7 and turn on for Tonga

Quoted 7 lines

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf
Of Tom St Denis
Sent: Friday, September 30, 2016 11:02 AM
To: [email protected]<mailto:[email protected]>
Subject: Enable UVD PG for SMU7 and turn on for Tonga

Quoted 5 lines

Patch #1 fixes the UVD powergating function in the smu7 driver as well as senses vce/uvd features (so we can fix/add vce PG later on).

Patch #2 enables it for tonga. Tested by reading tile/clk bits during load/idle.

Nice! Series is:

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

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