drm/amd/pm: workaround for audio noise issue
Subsystems (3)
Kenneth Feng
maintainerPATCH v2 1/1 drm/amd/pm: workaround for audio noise issue
On some Intel platforms, audio noise can be detected due to high pcie speed switch latency.
This patch leaverages ppfeaturemask to fix to the highest pcie speed then disable pcie switching.
v2:
coding style fix
--- .../drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 54 ++++++++++++++ .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 74 ++++++++++++++++--- .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 24 ++++++ .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 25 +++++++ 4 files changed, 166 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +54 -0
@@ -587,6 +587,48 @@ static int smu7_force_switch_to_arbf0(struct pp_hwmgr *hwmgr) tmp, MC_CG_ARB_FREQ_F0); } +static uint16_t smu7_override_pcie_speed (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); +uint16_t pcie_gen =0 ; + +if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN4 ) + pcie_gen =3 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN3 ) + pcie_gen =2 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN2 ) + pcie_gen =1 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN1 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN1 ) + pcie_gen =0 ; + +return pcie_gen; +} + +static uint16_t smu7_override_pcie_width (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); +uint16_t pcie_width =0 ; + +if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 ) + pcie_width =16 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 ) + pcie_width =12 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 ) + pcie_width =8 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 ) + pcie_width =4 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 ) + pcie_width =2 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X1 ) + pcie_width =1 ; + +return pcie_width; +} +static int smu7_setup_default_pcie_table (struct pp_hwmgr *hwmgr) {struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
@@ -683,6 +725,11 @@ static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) PP_Min_PCIEGen),get_pcie_lane_support (data->pcie_lane_cap, PP_Max_PCIELane)); + +if (data->pcie_dpm_key_disabled) +phm_setup_pcie_table_entry (&data->dpm_table.pcie_speed_table, + data->dpm_table.pcie_speed_table.count, +smu7_override_pcie_speed (hwmgr),smu7_override_pcie_width (hwmgr)); }return 0 ; }
@@ -1248,6 +1295,13 @@ static int smu7_start_dpm(struct pp_hwmgr *hwmgr) NULL)),"Failed to enable pcie DPM during DPM Start Function!" , return -EINVAL); + }else { +PP_ASSERT_WITH_CODE ( + (0 ==smum_send_msg_to_smc (hwmgr, + PPSMC_MSG_PCIeDPM_Disable, +NULL )), +"Failed to disble pcie DPM during DPM Start Function!" , + return -EINVAL ); } if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +63 -11
118 lines not on this page · raw message
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +24 -0
@@ -133,6 +133,7 @@ static void vega12_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.auto_wattman_debug =0 ; data->registry_data.auto_wattman_sample_period =100 ; data->registry_data.auto_wattman_threshold =50 ; + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask &PP_PCIE_DPM_MASK ); }static int vega12_set_features_platform_caps (struct pp_hwmgr *hwmgr)
@@ -539,6 +540,29 @@ static int vega12_override_pcie_parameters(struct pp_hwmgr *hwmgr) pp_table->PcieLaneCount[i] = pcie_width_arg; } +/* override to the highest if it's disabled from ppfeaturmask */ +if (data->registry_data.pcie_dpm_key_disabled) { +for (i =0 ; i <NUM_LINK_LEVELS ; i++) { + smu_pcie_arg = (i <<16 ) | (pcie_gen <<8 ) | pcie_width; + ret =smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, +NULL ); +PP_ASSERT_WITH_CODE (!ret, +"[OverridePcieParameters] Attempt to override pcie params failed!" , + return ret); + + pp_table->PcieGenSpeed[i] = pcie_gen; + pp_table->PcieLaneCount[i] = pcie_width; + } + ret =vega12_enable_smc_features (hwmgr, + false, + data->smu_features[GNLD_DPM_LINK ].smu_feature_bitmap); +PP_ASSERT_WITH_CODE (!ret, +"Attempt to Disable DPM LINK Failed!" , + return ret); + data->smu_features[GNLD_DPM_LINK ].enabled = false; + data->smu_features[GNLD_DPM_LINK ].supported = false; + }return 0 ; }
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +25 -0
@@ -171,6 +171,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.gfxoff_controlled_by_driver =1 ; data->gfxoff_allowed = false; data->counter_gfxoff =0 ; + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask &PP_PCIE_DPM_MASK ); }static int vega20_set_features_platform_caps (struct pp_hwmgr *hwmgr)
@@ -884,6 +885,30 @@ static int vega20_override_pcie_parameters(struct pp_hwmgr *hwmgr) pp_table->PcieLaneCount[i] = pcie_width_arg; } +/* override to the highest if it's disabled from ppfeaturmask */ +if (data->registry_data.pcie_dpm_key_disabled) { +for (i =0 ; i <NUM_LINK_LEVELS ; i++) { + smu_pcie_arg = (i <<16 ) | (pcie_gen <<8 ) | pcie_width; + ret =smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, +NULL ); +PP_ASSERT_WITH_CODE (!ret, +"[OverridePcieParameters] Attempt to override pcie params failed!" , + return ret); + + pp_table->PcieGenSpeed[i] = pcie_gen; + pp_table->PcieLaneCount[i] = pcie_width; + } + ret =vega20_enable_smc_features (hwmgr, + false, + data->smu_features[GNLD_DPM_LINK ].smu_feature_bitmap); +PP_ASSERT_WITH_CODE (!ret, +"Attempt to Disable DPM LINK Failed!" , + return ret); + data->smu_features[GNLD_DPM_LINK ].enabled = false; + data->smu_features[GNLD_DPM_LINK ].supported = false; + } +return 0 ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
________________________________
From: amd-gfx <[email protected]> on behalf of Kenneth Feng <[email protected]>
Sent: Thursday, March 11, 2021 1:58 AM
To: [email protected] <[email protected]>
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH v2] drm/amd/pm: workaround for audio noise issue
On some Intel platforms, audio noise can be detected due to high pcie speed switch latency.
This patch leaverages ppfeaturemask to fix to the highest pcie speed then disable pcie switching.
v2:
coding style fix
--- .../drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 54 ++++++++++++++ .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 74 ++++++++++++++++--- .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 24 ++++++ .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 25 +++++++ 4 files changed, 166 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +54 -0
@@ -587,6 +587,48 @@ static int smu7_force_switch_to_arbf0(struct pp_hwmgr *hwmgr) tmp, MC_CG_ARB_FREQ_F0); } +static uint16_t smu7_override_pcie_speed (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); +uint16_t pcie_gen =0 ; + +if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN4 ) + pcie_gen =3 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN3 ) + pcie_gen =2 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN2 ) + pcie_gen =1 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN1 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN1 ) + pcie_gen =0 ; + +return pcie_gen; +} + +static uint16_t smu7_override_pcie_width (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); +uint16_t pcie_width =0 ; + +if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 ) + pcie_width =16 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 ) + pcie_width =12 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 ) + pcie_width =8 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 ) + pcie_width =4 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 ) + pcie_width =2 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X1 ) + pcie_width =1 ; + +return pcie_width; +} +static int smu7_setup_default_pcie_table (struct pp_hwmgr *hwmgr) {struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
@@ -683,6 +725,11 @@ static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) PP_Min_PCIEGen),get_pcie_lane_support (data->pcie_lane_cap, PP_Max_PCIELane)); + +if (data->pcie_dpm_key_disabled) +phm_setup_pcie_table_entry (&data->dpm_table.pcie_speed_table, + data->dpm_table.pcie_speed_table.count, +smu7_override_pcie_speed (hwmgr),smu7_override_pcie_width (hwmgr)); }return 0 ; }
@@ -1248,6 +1295,13 @@ static int smu7_start_dpm(struct pp_hwmgr *hwmgr) NULL)),"Failed to enable pcie DPM during DPM Start Function!" , return -EINVAL); + }else { +PP_ASSERT_WITH_CODE ( + (0 ==smum_send_msg_to_smc (hwmgr, + PPSMC_MSG_PCIeDPM_Disable, +NULL )), +"Failed to disble pcie DPM during DPM Start Function!" , + return -EINVAL ); } if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +63 -11
118 lines not on this page · raw message
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +24 -0
@@ -133,6 +133,7 @@ static void vega12_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.auto_wattman_debug =0 ; data->registry_data.auto_wattman_sample_period =100 ; data->registry_data.auto_wattman_threshold =50 ; + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask &PP_PCIE_DPM_MASK ); }static int vega12_set_features_platform_caps (struct pp_hwmgr *hwmgr)
@@ -539,6 +540,29 @@ static int vega12_override_pcie_parameters(struct pp_hwmgr *hwmgr) pp_table->PcieLaneCount[i] = pcie_width_arg; } +/* override to the highest if it's disabled from ppfeaturmask */ +if (data->registry_data.pcie_dpm_key_disabled) { +for (i =0 ; i <NUM_LINK_LEVELS ; i++) { + smu_pcie_arg = (i <<16 ) | (pcie_gen <<8 ) | pcie_width; + ret =smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, +NULL ); +PP_ASSERT_WITH_CODE (!ret, +"[OverridePcieParameters] Attempt to override pcie params failed!" , + return ret); + + pp_table->PcieGenSpeed[i] = pcie_gen; + pp_table->PcieLaneCount[i] = pcie_width; + } + ret =vega12_enable_smc_features (hwmgr, + false, + data->smu_features[GNLD_DPM_LINK ].smu_feature_bitmap); +PP_ASSERT_WITH_CODE (!ret, +"Attempt to Disable DPM LINK Failed!" , + return ret); + data->smu_features[GNLD_DPM_LINK ].enabled = false; + data->smu_features[GNLD_DPM_LINK ].supported = false; + }return 0 ; }
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +25 -0
@@ -171,6 +171,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.gfxoff_controlled_by_driver =1 ; data->gfxoff_allowed = false; data->counter_gfxoff =0 ; + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask &PP_PCIE_DPM_MASK ); }static int vega20_set_features_platform_caps (struct pp_hwmgr *hwmgr)
@@ -884,6 +885,30 @@ static int vega20_override_pcie_parameters(struct pp_hwmgr *hwmgr) pp_table->PcieLaneCount[i] = pcie_width_arg; } +/* override to the highest if it's disabled from ppfeaturmask */ +if (data->registry_data.pcie_dpm_key_disabled) { +for (i =0 ; i <NUM_LINK_LEVELS ; i++) { + smu_pcie_arg = (i <<16 ) | (pcie_gen <<8 ) | pcie_width; + ret =smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, +NULL ); +PP_ASSERT_WITH_CODE (!ret, +"[OverridePcieParameters] Attempt to override pcie params failed!" , + return ret); + + pp_table->PcieGenSpeed[i] = pcie_gen; + pp_table->PcieLaneCount[i] = pcie_width; + } + ret =vega20_enable_smc_features (hwmgr, + false, + data->smu_features[GNLD_DPM_LINK ].smu_feature_bitmap); +PP_ASSERT_WITH_CODE (!ret, +"Attempt to Disable DPM LINK Failed!" , + return ret); + data->smu_features[GNLD_DPM_LINK ].enabled = false; + data->smu_features[GNLD_DPM_LINK ].supported = false; + } +return 0 ; }
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Ca13ada82b3b9489dfb0c08d8e45afc21%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637510426727844170%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ma6p9%2FwtNwOFK%2B8Tzt6q6N1jzLRy5ldBsw3YPU917G4%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kenneth Feng
Sent: Thursday, March 11, 2021 2:59 PM
To: [email protected]
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH v2] drm/amd/pm: workaround for audio noise issue
On some Intel platforms, audio noise can be detected due to high pcie speed switch latency.
This patch leaverages ppfeaturemask to fix to the highest pcie speed then disable pcie switching.
v2:
coding style fix
--- .../drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 54 ++++++++++++++ .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 74 ++++++++++++++++--- .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 24 ++++++ .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 25 +++++++ 4 files changed, 166 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +54 -0
@@ -587,6 +587,48 @@ static int smu7_force_switch_to_arbf0(struct pp_hwmgr *hwmgr) tmp, MC_CG_ARB_FREQ_F0); } +static uint16_t smu7_override_pcie_speed (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); +uint16_t pcie_gen =0 ; + +if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN4 ) + pcie_gen =3 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN3 ) + pcie_gen =2 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN2 ) + pcie_gen =1 ; +else if (adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN1 && + adev->pm.pcie_gen_mask &CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN1 ) + pcie_gen =0 ; + +return pcie_gen; +} + +static uint16_t smu7_override_pcie_width (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); +uint16_t pcie_width =0 ; + +if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 ) + pcie_width =16 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 ) + pcie_width =12 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 ) + pcie_width =8 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 ) + pcie_width =4 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 ) + pcie_width =2 ; +else if (adev->pm.pcie_mlw_mask &CAIL_PCIE_LINK_WIDTH_SUPPORT_X1 ) + pcie_width =1 ; + +return pcie_width; +} +static int smu7_setup_default_pcie_table (struct pp_hwmgr *hwmgr) {struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
@@ -683,6 +725,11 @@ static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) PP_Min_PCIEGen),get_pcie_lane_support (data->pcie_lane_cap, PP_Max_PCIELane)); + +if (data->pcie_dpm_key_disabled) +phm_setup_pcie_table_entry (&data->dpm_table.pcie_speed_table, + data->dpm_table.pcie_speed_table.count, +smu7_override_pcie_speed (hwmgr),smu7_override_pcie_width (hwmgr)); }return 0 ; }
@@ -1248,6 +1295,13 @@ static int smu7_start_dpm(struct pp_hwmgr *hwmgr) NULL)),"Failed to enable pcie DPM during DPM Start Function!" , return -EINVAL); + }else { +PP_ASSERT_WITH_CODE ( + (0 ==smum_send_msg_to_smc (hwmgr, + PPSMC_MSG_PCIeDPM_Disable, +NULL )), +"Failed to disble pcie DPM during DPM Start Function!" , + return -EINVAL ); } if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +63 -11
118 lines not on this page · raw message
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +24 -0
@@ -133,6 +133,7 @@ static void vega12_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.auto_wattman_debug =0 ; data->registry_data.auto_wattman_sample_period =100 ; data->registry_data.auto_wattman_threshold =50 ; + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask &PP_PCIE_DPM_MASK ); }static int vega12_set_features_platform_caps (struct pp_hwmgr *hwmgr)
@@ -539,6 +540,29 @@ static int vega12_override_pcie_parameters(struct pp_hwmgr *hwmgr) pp_table->PcieLaneCount[i] = pcie_width_arg; } +/* override to the highest if it's disabled from ppfeaturmask */ +if (data->registry_data.pcie_dpm_key_disabled) { +for (i =0 ; i <NUM_LINK_LEVELS ; i++) { + smu_pcie_arg = (i <<16 ) | (pcie_gen <<8 ) | pcie_width; + ret =smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, +NULL ); +PP_ASSERT_WITH_CODE (!ret, +"[OverridePcieParameters] Attempt to override pcie params failed!" , + return ret); + + pp_table->PcieGenSpeed[i] = pcie_gen; + pp_table->PcieLaneCount[i] = pcie_width; + } + ret =vega12_enable_smc_features (hwmgr, + false, + data->smu_features[GNLD_DPM_LINK ].smu_feature_bitmap); +PP_ASSERT_WITH_CODE (!ret, +"Attempt to Disable DPM LINK Failed!" , + return ret); + data->smu_features[GNLD_DPM_LINK ].enabled = false; + data->smu_features[GNLD_DPM_LINK ].supported = false; + }return 0 ; }
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +25 -0
@@ -171,6 +171,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.gfxoff_controlled_by_driver =1 ; data->gfxoff_allowed = false; data->counter_gfxoff =0 ; + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask &PP_PCIE_DPM_MASK ); }static int vega20_set_features_platform_caps (struct pp_hwmgr *hwmgr)
@@ -884,6 +885,30 @@ static int vega20_override_pcie_parameters(struct pp_hwmgr *hwmgr) pp_table->PcieLaneCount[i] = pcie_width_arg; } +/* override to the highest if it's disabled from ppfeaturmask */ +if (data->registry_data.pcie_dpm_key_disabled) { +for (i =0 ; i <NUM_LINK_LEVELS ; i++) { + smu_pcie_arg = (i <<16 ) | (pcie_gen <<8 ) | pcie_width; + ret =smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, +NULL ); +PP_ASSERT_WITH_CODE (!ret, +"[OverridePcieParameters] Attempt to override pcie params failed!" , + return ret); + + pp_table->PcieGenSpeed[i] = pcie_gen; + pp_table->PcieLaneCount[i] = pcie_width; + } + ret =vega20_enable_smc_features (hwmgr, + false, + data->smu_features[GNLD_DPM_LINK ].smu_feature_bitmap); +PP_ASSERT_WITH_CODE (!ret, +"Attempt to Disable DPM LINK Failed!" , + return ret); + data->smu_features[GNLD_DPM_LINK ].enabled = false; + data->smu_features[GNLD_DPM_LINK ].supported = false; + } +return 0 ; }
Signature · 10 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cevan.quan%40amd.com%7C204c73118a5c4e11cdc008d8e45afc13%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637510426734120914%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kGNZEQXos7IQwAgrhqwoVcBTUU0hBoCcRnkHM4Q0TT4%3D&reserved=0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx