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

Check vbios to determine whether we can enable OD

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Rex Zhu 2018-01-19 13:21:52 +08:00 committed by Alex Deucher
parent e3933f26b6
commit 3abb20264d
3 changed files with 13 additions and 14 deletions

View File

@ -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;

View File

@ -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;
} }

View File

@ -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;