drm/amd/pp: Disable OD feature if VBIOS limits
authorRex Zhu <Rex.Zhu@amd.com>
Fri, 19 Jan 2018 05:21:52 +0000 (13:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:18:18 +0000 (14:18 -0500)
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>
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c

index b49d65c3e984b1d9c9f89fbca6949874c698de47..c9eecce5683f7fda4036724756c90562cf0f9784 100644 (file)
@@ -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;
index c3e7e34535e8c1ee299282b286763b7fb0ebf062..815c9bcc63fd4b74f7577f17d2ed6c4c94943824 100644 (file)
@@ -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;
 }
index f14c7611fad303c4bc4130545cea5bcd9bfa5ae4..6d44cf043618a8cf41adcf690d056910ae6bfbcd 100644 (file)
@@ -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;