diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-02-02 18:42:03 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-02-04 09:46:35 +1000 |
commit | 0975b16274bad1f0bd5c5fd6ab759c5a9ee11949 (patch) | |
tree | 522e6af52e285c3616976709f868aa07e38c8cbe /drivers/gpu/drm/radeon/radeon_combios.c | |
parent | 87364760de5d631390c478fcbac8db1b926e0adf (diff) | |
download | op-kernel-dev-0975b16274bad1f0bd5c5fd6ab759c5a9ee11949.zip op-kernel-dev-0975b16274bad1f0bd5c5fd6ab759c5a9ee11949.tar.gz |
drm/radeon/kms: dynamically allocate power state space
We previously used a static array, but some new systems
had more states then we had array space, so dynamically
allocate space based on the number of states in the vbios.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=33851
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_combios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 591fcae..d27ef74 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -2442,6 +2442,17 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev) rdev->pm.default_power_state_index = -1; + /* allocate 2 power states */ + rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) * 2, GFP_KERNEL); + if (!rdev->pm.power_state) { + rdev->pm.default_power_state_index = state_index; + rdev->pm.num_power_states = 0; + + rdev->pm.current_power_state_index = rdev->pm.default_power_state_index; + rdev->pm.current_clock_mode_index = 0; + return; + } + if (rdev->flags & RADEON_IS_MOBILITY) { offset = combios_get_table_offset(dev, COMBIOS_POWERPLAY_INFO_TABLE); if (offset) { |