mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
6c47e5c23a
commit
6991b8f2a3
|
@ -2008,14 +2008,14 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
|
||||||
return state_index;
|
return state_index;
|
||||||
/* last mode is usually default, array is low to high */
|
/* last mode is usually default, array is low to high */
|
||||||
for (i = 0; i < num_modes; i++) {
|
for (i = 0; i < num_modes; i++) {
|
||||||
|
rdev->pm.power_state[state_index].clock_info =
|
||||||
|
kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
|
||||||
|
if (!rdev->pm.power_state[state_index].clock_info)
|
||||||
|
return state_index;
|
||||||
|
rdev->pm.power_state[state_index].num_clock_modes = 1;
|
||||||
rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
|
rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
|
||||||
switch (frev) {
|
switch (frev) {
|
||||||
case 1:
|
case 1:
|
||||||
rdev->pm.power_state[state_index].clock_info =
|
|
||||||
kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
|
|
||||||
if (!rdev->pm.power_state[state_index].clock_info)
|
|
||||||
return state_index;
|
|
||||||
rdev->pm.power_state[state_index].num_clock_modes = 1;
|
|
||||||
rdev->pm.power_state[state_index].clock_info[0].mclk =
|
rdev->pm.power_state[state_index].clock_info[0].mclk =
|
||||||
le16_to_cpu(power_info->info.asPowerPlayInfo[i].usMemoryClock);
|
le16_to_cpu(power_info->info.asPowerPlayInfo[i].usMemoryClock);
|
||||||
rdev->pm.power_state[state_index].clock_info[0].sclk =
|
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)
|
||||||
state_index++;
|
state_index++;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
rdev->pm.power_state[state_index].clock_info =
|
|
||||||
kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
|
|
||||||
if (!rdev->pm.power_state[state_index].clock_info)
|
|
||||||
return state_index;
|
|
||||||
rdev->pm.power_state[state_index].num_clock_modes = 1;
|
|
||||||
rdev->pm.power_state[state_index].clock_info[0].mclk =
|
rdev->pm.power_state[state_index].clock_info[0].mclk =
|
||||||
le32_to_cpu(power_info->info_2.asPowerPlayInfo[i].ulMemoryClock);
|
le32_to_cpu(power_info->info_2.asPowerPlayInfo[i].ulMemoryClock);
|
||||||
rdev->pm.power_state[state_index].clock_info[0].sclk =
|
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)
|
||||||
state_index++;
|
state_index++;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
rdev->pm.power_state[state_index].clock_info =
|
|
||||||
kzalloc(sizeof(struct radeon_pm_clock_info) * 1, GFP_KERNEL);
|
|
||||||
if (!rdev->pm.power_state[state_index].clock_info)
|
|
||||||
return state_index;
|
|
||||||
rdev->pm.power_state[state_index].num_clock_modes = 1;
|
|
||||||
rdev->pm.power_state[state_index].clock_info[0].mclk =
|
rdev->pm.power_state[state_index].clock_info[0].mclk =
|
||||||
le32_to_cpu(power_info->info_3.asPowerPlayInfo[i].ulMemoryClock);
|
le32_to_cpu(power_info->info_3.asPowerPlayInfo[i].ulMemoryClock);
|
||||||
rdev->pm.power_state[state_index].clock_info[0].sclk =
|
rdev->pm.power_state[state_index].clock_info[0].sclk =
|
||||||
|
|
Loading…
Reference in New Issue