summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-02-21 00:15:04 +0100
committerDave Airlie <airlied@redhat.com>2010-02-23 00:46:51 +0100
commit9038dfdf699a3227004f1f6da32a3ef4ef3ba5a4 (patch)
treeaf718c7a00587ebfac1b606da5c6d5b17a4cc247 /drivers/gpu/drm/radeon/radeon_atombios.c
parentdrm/radeon: fixes for r6xx/r7xx gfx init (diff)
downloadlinux-9038dfdf699a3227004f1f6da32a3ef4ef3ba5a4.tar.xz
linux-9038dfdf699a3227004f1f6da32a3ef4ef3ba5a4.zip
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.c20
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)
power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
rdev->pm.default_power_state = NULL;
- rdev->pm.current_power_state = NULL;
if (power_info) {
if (frev < 4) {
@@ -1517,11 +1516,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.power_state[state_index].type =
POWER_STATE_TYPE_DEFAULT;
rdev->pm.default_power_state = &rdev->pm.power_state[state_index];
- rdev->pm.current_power_state = &rdev->pm.power_state[state_index];
rdev->pm.power_state[state_index].default_clock_mode =
&rdev->pm.power_state[state_index].clock_info[0];
- rdev->pm.power_state[state_index].current_clock_mode =
- &rdev->pm.power_state[state_index].clock_info[0];
}
state_index++;
break;
@@ -1586,11 +1582,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.power_state[state_index].type =
POWER_STATE_TYPE_DEFAULT;
rdev->pm.default_power_state = &rdev->pm.power_state[state_index];
- rdev->pm.current_power_state = &rdev->pm.power_state[state_index];
rdev->pm.power_state[state_index].default_clock_mode =
&rdev->pm.power_state[state_index].clock_info[0];
- rdev->pm.power_state[state_index].current_clock_mode =
- &rdev->pm.power_state[state_index].clock_info[0];
}
state_index++;
break;
@@ -1661,11 +1654,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.power_state[state_index].type =
POWER_STATE_TYPE_DEFAULT;
rdev->pm.default_power_state = &rdev->pm.power_state[state_index];
- rdev->pm.current_power_state = &rdev->pm.power_state[state_index];
rdev->pm.power_state[state_index].default_clock_mode =
&rdev->pm.power_state[state_index].clock_info[0];
- rdev->pm.power_state[state_index].current_clock_mode =
- &rdev->pm.power_state[state_index].clock_info[0];
}
state_index++;
break;
@@ -1765,11 +1755,8 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.power_state[state_index].type =
POWER_STATE_TYPE_DEFAULT;
rdev->pm.default_power_state = &rdev->pm.power_state[state_index];
- rdev->pm.current_power_state = &rdev->pm.power_state[state_index];
rdev->pm.power_state[state_index].default_clock_mode =
&rdev->pm.power_state[state_index].clock_info[mode_index - 1];
- rdev->pm.power_state[state_index].current_clock_mode =
- &rdev->pm.power_state[state_index].clock_info[mode_index - 1];
}
state_index++;
}
@@ -1788,18 +1775,19 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk;
rdev->pm.power_state[state_index].default_clock_mode =
&rdev->pm.power_state[state_index].clock_info[0];
- rdev->pm.power_state[state_index].current_clock_mode =
- &rdev->pm.power_state[state_index].clock_info[0];
rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
if (rdev->asic->get_pcie_lanes)
rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = radeon_get_pcie_lanes(rdev);
else
rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = 16;
rdev->pm.default_power_state = &rdev->pm.power_state[state_index];
- rdev->pm.current_power_state = &rdev->pm.power_state[state_index];
state_index++;
}
rdev->pm.num_power_states = state_index;
+
+ rdev->pm.current_power_state = rdev->pm.default_power_state;
+ rdev->pm.current_clock_mode =
+ rdev->pm.default_power_state->default_clock_mode;
}
void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)