diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-02-20 18:15:04 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-22 18:46:51 -0500 |
commit | 9038dfdf699a3227004f1f6da32a3ef4ef3ba5a4 (patch) | |
tree | af718c7a00587ebfac1b606da5c6d5b17a4cc247 /drivers/gpu/drm/radeon/radeon_atombios.c | |
parent | d03f5d5971f2dd4bd259c46e065299661d8fdc9f (diff) |
drm/radeon/kms: simplify storing current and requested PM mode
We kept pointers to requested and current clock modes in every power state.
That was useless, more /global/ pointers in power struct are enough.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 79d445373c34..33aed6c2d41a 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1450,7 +1450,6 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1450 | power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); | 1450 | power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); |
1451 | 1451 | ||
1452 | rdev->pm.default_power_state = NULL; | 1452 | rdev->pm.default_power_state = NULL; |
1453 | rdev->pm.current_power_state = NULL; | ||
1454 | 1453 | ||
1455 | if (power_info) { | 1454 | if (power_info) { |
1456 | if (frev < 4) { | 1455 | if (frev < 4) { |
@@ -1517,11 +1516,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1517 | rdev->pm.power_state[state_index].type = | 1516 | rdev->pm.power_state[state_index].type = |
1518 | POWER_STATE_TYPE_DEFAULT; | 1517 | POWER_STATE_TYPE_DEFAULT; |
1519 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; | 1518 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; |
1520 | rdev->pm.current_power_state = &rdev->pm.power_state[state_index]; | ||
1521 | rdev->pm.power_state[state_index].default_clock_mode = | 1519 | rdev->pm.power_state[state_index].default_clock_mode = |
1522 | &rdev->pm.power_state[state_index].clock_info[0]; | 1520 | &rdev->pm.power_state[state_index].clock_info[0]; |
1523 | rdev->pm.power_state[state_index].current_clock_mode = | ||
1524 | &rdev->pm.power_state[state_index].clock_info[0]; | ||
1525 | } | 1521 | } |
1526 | state_index++; | 1522 | state_index++; |
1527 | break; | 1523 | break; |
@@ -1586,11 +1582,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1586 | rdev->pm.power_state[state_index].type = | 1582 | rdev->pm.power_state[state_index].type = |
1587 | POWER_STATE_TYPE_DEFAULT; | 1583 | POWER_STATE_TYPE_DEFAULT; |
1588 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; | 1584 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; |
1589 | rdev->pm.current_power_state = &rdev->pm.power_state[state_index]; | ||
1590 | rdev->pm.power_state[state_index].default_clock_mode = | 1585 | rdev->pm.power_state[state_index].default_clock_mode = |
1591 | &rdev->pm.power_state[state_index].clock_info[0]; | 1586 | &rdev->pm.power_state[state_index].clock_info[0]; |
1592 | rdev->pm.power_state[state_index].current_clock_mode = | ||
1593 | &rdev->pm.power_state[state_index].clock_info[0]; | ||
1594 | } | 1587 | } |
1595 | state_index++; | 1588 | state_index++; |
1596 | break; | 1589 | break; |
@@ -1661,11 +1654,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1661 | rdev->pm.power_state[state_index].type = | 1654 | rdev->pm.power_state[state_index].type = |
1662 | POWER_STATE_TYPE_DEFAULT; | 1655 | POWER_STATE_TYPE_DEFAULT; |
1663 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; | 1656 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; |
1664 | rdev->pm.current_power_state = &rdev->pm.power_state[state_index]; | ||
1665 | rdev->pm.power_state[state_index].default_clock_mode = | 1657 | rdev->pm.power_state[state_index].default_clock_mode = |
1666 | &rdev->pm.power_state[state_index].clock_info[0]; | 1658 | &rdev->pm.power_state[state_index].clock_info[0]; |
1667 | rdev->pm.power_state[state_index].current_clock_mode = | ||
1668 | &rdev->pm.power_state[state_index].clock_info[0]; | ||
1669 | } | 1659 | } |
1670 | state_index++; | 1660 | state_index++; |
1671 | break; | 1661 | break; |
@@ -1765,11 +1755,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1765 | rdev->pm.power_state[state_index].type = | 1755 | rdev->pm.power_state[state_index].type = |
1766 | POWER_STATE_TYPE_DEFAULT; | 1756 | POWER_STATE_TYPE_DEFAULT; |
1767 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; | 1757 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; |
1768 | rdev->pm.current_power_state = &rdev->pm.power_state[state_index]; | ||
1769 | rdev->pm.power_state[state_index].default_clock_mode = | 1758 | rdev->pm.power_state[state_index].default_clock_mode = |
1770 | &rdev->pm.power_state[state_index].clock_info[mode_index - 1]; | 1759 | &rdev->pm.power_state[state_index].clock_info[mode_index - 1]; |
1771 | rdev->pm.power_state[state_index].current_clock_mode = | ||
1772 | &rdev->pm.power_state[state_index].clock_info[mode_index - 1]; | ||
1773 | } | 1760 | } |
1774 | state_index++; | 1761 | state_index++; |
1775 | } | 1762 | } |
@@ -1788,18 +1775,19 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1788 | rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk; | 1775 | rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk; |
1789 | rdev->pm.power_state[state_index].default_clock_mode = | 1776 | rdev->pm.power_state[state_index].default_clock_mode = |
1790 | &rdev->pm.power_state[state_index].clock_info[0]; | 1777 | &rdev->pm.power_state[state_index].clock_info[0]; |
1791 | rdev->pm.power_state[state_index].current_clock_mode = | ||
1792 | &rdev->pm.power_state[state_index].clock_info[0]; | ||
1793 | rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; | 1778 | rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; |
1794 | if (rdev->asic->get_pcie_lanes) | 1779 | if (rdev->asic->get_pcie_lanes) |
1795 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = radeon_get_pcie_lanes(rdev); | 1780 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = radeon_get_pcie_lanes(rdev); |
1796 | else | 1781 | else |
1797 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = 16; | 1782 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = 16; |
1798 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; | 1783 | rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; |
1799 | rdev->pm.current_power_state = &rdev->pm.power_state[state_index]; | ||
1800 | state_index++; | 1784 | state_index++; |
1801 | } | 1785 | } |
1802 | rdev->pm.num_power_states = state_index; | 1786 | rdev->pm.num_power_states = state_index; |
1787 | |||
1788 | rdev->pm.current_power_state = rdev->pm.default_power_state; | ||
1789 | rdev->pm.current_clock_mode = | ||
1790 | rdev->pm.default_power_state->default_clock_mode; | ||
1803 | } | 1791 | } |
1804 | 1792 | ||
1805 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable) | 1793 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable) |