aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2011-11-14 17:52:51 -0500
committerDave Airlie <airlied@redhat.com>2011-11-15 14:44:03 -0500
commit6991b8f2a3193397461104a27be417addb8d032b (patch)
tree0cb56a33a2e5476d436b8a30abdf9c1cdf6de9f5 /drivers/gpu
parent6c47e5c23aa2a7c54ad7ac13af4bd56cd9e703bf (diff)
drm/radeon/kms: fix segfault in pm rework
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 0a4ec1ed02c0..fecd705a1a5f 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -2008,14 +2008,14 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
2008 return state_index; 2008 return state_index;
2009 /* last mode is usually default, array is low to high */ 2009 /* last mode is usually default, array is low to high */
2010 for (i = 0; i < num_modes; i++) { 2010 for (i = 0; i < num_modes; i++) {
2011 rdev->pm.power_state[state_index].clock_info =
2012 kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
2013 if (!rdev->pm.power_state[state_index].clock_info)
2014 return state_index;
2015 rdev->pm.power_state[state_index].num_clock_modes = 1;
2011 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; 2016 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
2012 switch (frev) { 2017 switch (frev) {
2013 case 1: 2018 case 1:
2014 rdev->pm.power_state[state_index].clock_info =
2015 kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
2016 if (!rdev->pm.power_state[state_index].clock_info)
2017 return state_index;
2018 rdev->pm.power_state[state_index].num_clock_modes = 1;
2019 rdev->pm.power_state[state_index].clock_info[0].mclk = 2019 rdev->pm.power_state[state_index].clock_info[0].mclk =
2020 le16_to_cpu(power_info->info.asPowerPlayInfo[i].usMemoryClock); 2020 le16_to_cpu(power_info->info.asPowerPlayInfo[i].usMemoryClock);
2021 rdev->pm.power_state[state_index].clock_info[0].sclk = 2021 rdev->pm.power_state[state_index].clock_info[0].sclk =
@@ -2051,11 +2051,6 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
2051 state_index++; 2051 state_index++;
2052 break; 2052 break;
2053 case 2: 2053 case 2:
2054 rdev->pm.power_state[state_index].clock_info =
2055 kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
2056 if (!rdev->pm.power_state[state_index].clock_info)
2057 return state_index;
2058 rdev->pm.power_state[state_index].num_clock_modes = 1;
2059 rdev->pm.power_state[state_index].clock_info[0].mclk = 2054 rdev->pm.power_state[state_index].clock_info[0].mclk =
2060 le32_to_cpu(power_info->info_2.asPowerPlayInfo[i].ulMemoryClock); 2055 le32_to_cpu(power_info->info_2.asPowerPlayInfo[i].ulMemoryClock);
2061 rdev->pm.power_state[state_index].clock_info[0].sclk = 2056 rdev->pm.power_state[state_index].clock_info[0].sclk =
@@ -2092,11 +2087,6 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
2092 state_index++; 2087 state_index++;
2093 break; 2088 break;
2094 case 3: 2089 case 3:
2095 rdev->pm.power_state[state_index].clock_info =
2096 kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
2097 if (!rdev->pm.power_state[state_index].clock_info)
2098 return state_index;
2099 rdev->pm.power_state[state_index].num_clock_modes = 1;
2100 rdev->pm.power_state[state_index].clock_info[0].mclk = 2090 rdev->pm.power_state[state_index].clock_info[0].mclk =
2101 le32_to_cpu(power_info->info_3.asPowerPlayInfo[i].ulMemoryClock); 2091 le32_to_cpu(power_info->info_3.asPowerPlayInfo[i].ulMemoryClock);
2102 rdev->pm.power_state[state_index].clock_info[0].sclk = 2092 rdev->pm.power_state[state_index].clock_info[0].sclk =