Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196506
b: refs/heads/master
c: 02b17cc
h: refs/heads/master
v: v3
  • Loading branch information
Alex Deucher authored and Dave Airlie committed May 18, 2010
1 parent 3ff8313 commit 05eee2d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef6e6cf56aca91c0b0db8de6e79e0874595fd260
refs/heads/master: 02b17cc05372ab58e9638008d0206f1c1ee0cf5c
23 changes: 19 additions & 4 deletions trunk/drivers/gpu/drm/radeon/radeon_atombios.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
num_modes = power_info->info.ucNumOfPowerModeEntries;
if (num_modes > ATOM_MAX_NUMBEROF_POWER_BLOCK)
num_modes = ATOM_MAX_NUMBEROF_POWER_BLOCK;
/* last mode is usually default, array is low to high */
for (i = 0; i < num_modes; i++) {
rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
switch (frev) {
Expand Down Expand Up @@ -1711,6 +1712,14 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
break;
}
}
/* last mode is usually default */
if (!rdev->pm.default_power_state) {
rdev->pm.power_state[state_index - 1].type =
POWER_STATE_TYPE_DEFAULT;
rdev->pm.default_power_state = &rdev->pm.power_state[state_index - 1];
rdev->pm.power_state[state_index - 1].default_clock_mode =
&rdev->pm.power_state[state_index - 1].clock_info[0];
}
} else {
/* add the i2c bus for thermal/fan chip */
/* no support for internal controller yet */
Expand All @@ -1736,6 +1745,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.i2c_bus = radeon_i2c_create(rdev->ddev, &i2c_bus, "Thermal");
}
}
/* first mode is usually default, followed by low to high */
for (i = 0; i < power_info->info_4.ucNumStates; i++) {
mode_index = 0;
power_state = (struct _ATOM_PPLIB_STATE *)
Expand Down Expand Up @@ -1865,12 +1875,16 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
state_index++;
}
}
/* first mode is usually default */
if (!rdev->pm.default_power_state) {
rdev->pm.power_state[0].type =
POWER_STATE_TYPE_DEFAULT;
rdev->pm.default_power_state = &rdev->pm.power_state[0];
rdev->pm.power_state[0].default_clock_mode =
&rdev->pm.power_state[0].clock_info[0];
}
}
} else {
/* XXX figure out some good default low power mode for cards w/out power tables */
}

if (rdev->pm.default_power_state == NULL) {
/* add the default mode */
rdev->pm.power_state[state_index].type =
POWER_STATE_TYPE_DEFAULT;
Expand All @@ -1887,6 +1901,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.default_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;
Expand Down

0 comments on commit 05eee2d

Please sign in to comment.