diff options
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 24ebb4ea7984..42bcaf41b8c4 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1755,9 +1755,22 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1755 | rdev->pm.power_state[state_index].misc2 = 0; | 1755 | rdev->pm.power_state[state_index].misc2 = 0; |
1756 | } | 1756 | } |
1757 | } else { | 1757 | } else { |
1758 | int fw_index = GetIndexIntoMasterTable(DATA, FirmwareInfo); | ||
1759 | uint8_t fw_frev, fw_crev; | ||
1760 | uint16_t fw_data_offset, vddc = 0; | ||
1761 | union firmware_info *firmware_info; | ||
1762 | ATOM_PPLIB_THERMALCONTROLLER *controller = &power_info->info_4.sThermalController; | ||
1763 | |||
1764 | if (atom_parse_data_header(mode_info->atom_context, fw_index, NULL, | ||
1765 | &fw_frev, &fw_crev, &fw_data_offset)) { | ||
1766 | firmware_info = | ||
1767 | (union firmware_info *)(mode_info->atom_context->bios + | ||
1768 | fw_data_offset); | ||
1769 | vddc = firmware_info->info_14.usBootUpVDDCVoltage; | ||
1770 | } | ||
1771 | |||
1758 | /* add the i2c bus for thermal/fan chip */ | 1772 | /* add the i2c bus for thermal/fan chip */ |
1759 | /* no support for internal controller yet */ | 1773 | /* no support for internal controller yet */ |
1760 | ATOM_PPLIB_THERMALCONTROLLER *controller = &power_info->info_4.sThermalController; | ||
1761 | if (controller->ucType > 0) { | 1774 | if (controller->ucType > 0) { |
1762 | if ((controller->ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) || | 1775 | if ((controller->ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) || |
1763 | (controller->ucType == ATOM_PP_THERMALCONTROLLER_RV770) || | 1776 | (controller->ucType == ATOM_PP_THERMALCONTROLLER_RV770) || |
@@ -1904,6 +1917,16 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1904 | rdev->pm.default_power_state_index = state_index; | 1917 | rdev->pm.default_power_state_index = state_index; |
1905 | rdev->pm.power_state[state_index].default_clock_mode = | 1918 | rdev->pm.power_state[state_index].default_clock_mode = |
1906 | &rdev->pm.power_state[state_index].clock_info[mode_index - 1]; | 1919 | &rdev->pm.power_state[state_index].clock_info[mode_index - 1]; |
1920 | /* patch the table values with the default slck/mclk from firmware info */ | ||
1921 | for (j = 0; j < mode_index; j++) { | ||
1922 | rdev->pm.power_state[state_index].clock_info[j].mclk = | ||
1923 | rdev->clock.default_mclk; | ||
1924 | rdev->pm.power_state[state_index].clock_info[j].sclk = | ||
1925 | rdev->clock.default_sclk; | ||
1926 | if (vddc) | ||
1927 | rdev->pm.power_state[state_index].clock_info[j].voltage.voltage = | ||
1928 | vddc; | ||
1929 | } | ||
1907 | } | 1930 | } |
1908 | state_index++; | 1931 | state_index++; |
1909 | } | 1932 | } |