Skip to content

Commit 60a2dae

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Use amdgpu_device_pcie_dynamic_switching_supported() for SMU7
SMU7 does a check if the dGPU is inserted into a Rocket Lake system, to turn off DPM. Extend this check to all systems that have problems with dynamic switching by using the amdgpu_device_pcie_dynamic_switching_supported() helper. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent fdf0eaf commit 60a2dae

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,17 +1798,6 @@ static int smu7_disable_dpm_tasks(struct pp_hwmgr *hwmgr)
17981798
return result;
17991799
}
18001800

1801-
static bool intel_core_rkl_chk(void)
1802-
{
1803-
#if IS_ENABLED(CONFIG_X86_64)
1804-
struct cpuinfo_x86 *c = &cpu_data(0);
1805-
1806-
return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ROCKETLAKE);
1807-
#else
1808-
return false;
1809-
#endif
1810-
}
1811-
18121801
static void smu7_init_dpm_defaults(struct pp_hwmgr *hwmgr)
18131802
{
18141803
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
@@ -1835,7 +1824,8 @@ static void smu7_init_dpm_defaults(struct pp_hwmgr *hwmgr)
18351824
data->mclk_dpm_key_disabled = hwmgr->feature_mask & PP_MCLK_DPM_MASK ? false : true;
18361825
data->sclk_dpm_key_disabled = hwmgr->feature_mask & PP_SCLK_DPM_MASK ? false : true;
18371826
data->pcie_dpm_key_disabled =
1838-
intel_core_rkl_chk() || !(hwmgr->feature_mask & PP_PCIE_DPM_MASK);
1827+
!amdgpu_device_pcie_dynamic_switching_supported() ||
1828+
!(hwmgr->feature_mask & PP_PCIE_DPM_MASK);
18391829
/* need to set voltage control types before EVV patching */
18401830
data->voltage_control = SMU7_VOLTAGE_CONTROL_NONE;
18411831
data->vddci_control = SMU7_VOLTAGE_CONTROL_NONE;

0 commit comments

Comments
 (0)