aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-05-27 17:01:40 -0400
committerDave Airlie <airlied@redhat.com>2010-06-02 23:13:29 -0400
commitc5e8ce61d64995f4076c6a9b2f8b4b71e0be2e37 (patch)
treed0f61fe7753cf1ed4c9c1d866bb89e756b02983d /drivers/gpu
parent9349d5cc920c10845693f906ebd67f394f1d0d04 (diff)
drm/radeon/kms/pm: patch default power state with default clocks/voltages on r6xx+
The default power state does not always match the default clocks and voltage for a particular card. The information in the firmware info table is correct and should be used in preference to the info the default power state. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c25
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 }