aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5673665ff216..273019925e0b 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1462,6 +1462,10 @@ static const char *pp_lib_thermal_controller_names[] = {
1462 "RV6xx", 1462 "RV6xx",
1463 "RV770", 1463 "RV770",
1464 "ADT7473", 1464 "ADT7473",
1465 "External GPIO",
1466 "Evergreen",
1467 "ADT7473 with internal",
1468
1465}; 1469};
1466 1470
1467union power_info { 1471union power_info {
@@ -1707,15 +1711,21 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
1707 break; 1711 break;
1708 } 1712 }
1709 } 1713 }
1710 } else if (frev == 4) { 1714 } else {
1711 /* add the i2c bus for thermal/fan chip */ 1715 /* add the i2c bus for thermal/fan chip */
1712 /* no support for internal controller yet */ 1716 /* no support for internal controller yet */
1713 if (power_info->info_4.sThermalController.ucType > 0) { 1717 if (power_info->info_4.sThermalController.ucType > 0) {
1714 if ((power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) || 1718 if ((power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) ||
1715 (power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_RV770)) { 1719 (power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_RV770) ||
1720 (power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_EVERGREEN)) {
1716 DRM_INFO("Internal thermal controller %s fan control\n", 1721 DRM_INFO("Internal thermal controller %s fan control\n",
1717 (power_info->info_4.sThermalController.ucFanParameters & 1722 (power_info->info_4.sThermalController.ucFanParameters &
1718 ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with"); 1723 ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
1724 } else if ((power_info->info_4.sThermalController.ucType ==
1725 ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO) ||
1726 (power_info->info_4.sThermalController.ucType ==
1727 ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL)) {
1728 DRM_INFO("Special thermal controller config\n");
1719 } else { 1729 } else {
1720 DRM_INFO("Possible %s thermal controller at 0x%02x %s fan control\n", 1730 DRM_INFO("Possible %s thermal controller at 0x%02x %s fan control\n",
1721 pp_lib_thermal_controller_names[power_info->info_4.sThermalController.ucType], 1731 pp_lib_thermal_controller_names[power_info->info_4.sThermalController.ucType],
@@ -1763,6 +1773,36 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
1763 rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage = 1773 rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
1764 clock_info->usVDDC; 1774 clock_info->usVDDC;
1765 mode_index++; 1775 mode_index++;
1776 } else if (ASIC_IS_DCE4(rdev)) {
1777 struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO *clock_info =
1778 (struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO *)
1779 (mode_info->atom_context->bios +
1780 data_offset +
1781 le16_to_cpu(power_info->info_4.usClockInfoArrayOffset) +
1782 (power_state->ucClockStateIndices[j] *
1783 power_info->info_4.ucClockInfoSize));
1784 sclk = le16_to_cpu(clock_info->usEngineClockLow);
1785 sclk |= clock_info->ucEngineClockHigh << 16;
1786 mclk = le16_to_cpu(clock_info->usMemoryClockLow);
1787 mclk |= clock_info->ucMemoryClockHigh << 16;
1788 rdev->pm.power_state[state_index].clock_info[mode_index].mclk = mclk;
1789 rdev->pm.power_state[state_index].clock_info[mode_index].sclk = sclk;
1790 /* skip invalid modes */
1791 if ((rdev->pm.power_state[state_index].clock_info[mode_index].mclk == 0) ||
1792 (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0))
1793 continue;
1794 /* skip overclock modes for now */
1795 if ((rdev->pm.power_state[state_index].clock_info[mode_index].mclk >
1796 rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) ||
1797 (rdev->pm.power_state[state_index].clock_info[mode_index].sclk >
1798 rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN))
1799 continue;
1800 rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type =
1801 VOLTAGE_SW;
1802 rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
1803 clock_info->usVDDC;
1804 /* XXX usVDDCI */
1805 mode_index++;
1766 } else { 1806 } else {
1767 struct _ATOM_PPLIB_R600_CLOCK_INFO *clock_info = 1807 struct _ATOM_PPLIB_R600_CLOCK_INFO *clock_info =
1768 (struct _ATOM_PPLIB_R600_CLOCK_INFO *) 1808 (struct _ATOM_PPLIB_R600_CLOCK_INFO *)