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

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
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
+5 −6
Original line number Diff line number Diff line
@@ -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;
}
+4 −4
Original line number Diff line number Diff line
@@ -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;