Skip to content

Commit

Permalink
drm/amd/pp: Disable OD feature if VBIOS limits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rex Zhu authored and Alex Deucher committed Feb 19, 2018
1 parent e3933f2 commit 3abb202
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,10 @@ static int init_over_drive_limits(
hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
hwmgr->platform_descriptor.overdriveVDDCStep = 0;

if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 \
&& hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0) {
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_ACOverdriveSupport);
if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 \
|| hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
hwmgr->od_enabled = false;
pr_debug("OverDrive feature not support by VBIOS\n");
}

return 0;
Expand Down
11 changes: 5 additions & 6 deletions drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,11 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr,
powerplay_table,
(const ATOM_FIRMWARE_INFO_V2_1 *)fw_info);

if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0
&& hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0
&& !phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_OverdriveDisabledByPowerBudget))
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_ACOverdriveSupport);
if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0
&& hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
hwmgr->od_enabled = false;
pr_debug("OverDrive feature not support by VBIOS\n");
}

return result;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ static int init_over_drive_limits(
hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
hwmgr->platform_descriptor.overdriveVDDCStep = 0;

if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 &&
hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0) {
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_ACOverdriveSupport);
if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 ||
hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
hwmgr->od_enabled = false;
pr_debug("OverDrive feature not support by VBIOS\n");
}

return 0;
Expand Down

0 comments on commit 3abb202

Please sign in to comment.