Commit 3abb2026 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/pp: Disable OD feature if VBIOS limits

Check vbios to determine whether we can enable OD
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e3933f26
...@@ -836,10 +836,10 @@ static int init_over_drive_limits( ...@@ -836,10 +836,10 @@ static int init_over_drive_limits(
hwmgr->platform_descriptor.maxOverdriveVDDC = 0; hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
hwmgr->platform_descriptor.overdriveVDDCStep = 0; hwmgr->platform_descriptor.overdriveVDDCStep = 0;
if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 \ if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 \
&& hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0) { || hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
phm_cap_set(hwmgr->platform_descriptor.platformCaps, hwmgr->od_enabled = false;
PHM_PlatformCaps_ACOverdriveSupport); pr_debug("OverDrive feature not support by VBIOS\n");
} }
return 0; return 0;
......
...@@ -1074,12 +1074,11 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr, ...@@ -1074,12 +1074,11 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr,
powerplay_table, powerplay_table,
(const ATOM_FIRMWARE_INFO_V2_1 *)fw_info); (const ATOM_FIRMWARE_INFO_V2_1 *)fw_info);
if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0
&& hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0 && hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
&& !phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, hwmgr->od_enabled = false;
PHM_PlatformCaps_OverdriveDisabledByPowerBudget)) pr_debug("OverDrive feature not support by VBIOS\n");
phm_cap_set(hwmgr->platform_descriptor.platformCaps, }
PHM_PlatformCaps_ACOverdriveSupport);
return result; return result;
} }
......
...@@ -267,10 +267,10 @@ static int init_over_drive_limits( ...@@ -267,10 +267,10 @@ static int init_over_drive_limits(
hwmgr->platform_descriptor.maxOverdriveVDDC = 0; hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
hwmgr->platform_descriptor.overdriveVDDCStep = 0; hwmgr->platform_descriptor.overdriveVDDCStep = 0;
if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 && if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 ||
hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0) { hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
phm_cap_set(hwmgr->platform_descriptor.platformCaps, hwmgr->od_enabled = false;
PHM_PlatformCaps_ACOverdriveSupport); pr_debug("OverDrive feature not support by VBIOS\n");
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment