Commit 27459324 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Dave Airlie

drm/radeon/kms: accept slightly overclocked power modes

Fixes fdo bug #26329
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Tested-by: default avatarTobias Jakobi <liquid.acid@gmx.net>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5230aea6
...@@ -662,6 +662,11 @@ struct radeon_power_state { ...@@ -662,6 +662,11 @@ struct radeon_power_state {
bool voltage_drop_active; bool voltage_drop_active;
}; };
/*
* Some modes are overclocked by very low value, accept them
*/
#define RADEON_MODE_OVERCLOCK_MARGIN 500 /* 5 MHz */
struct radeon_pm { struct radeon_pm {
struct mutex mutex; struct mutex mutex;
struct delayed_work idle_work; struct delayed_work idle_work;
......
...@@ -1463,9 +1463,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) ...@@ -1463,9 +1463,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
continue; continue;
/* skip overclock modes for now */ /* skip overclock modes for now */
if ((rdev->pm.power_state[state_index].clock_info[0].mclk > if ((rdev->pm.power_state[state_index].clock_info[0].mclk >
rdev->clock.default_mclk) || rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) ||
(rdev->pm.power_state[state_index].clock_info[0].sclk > (rdev->pm.power_state[state_index].clock_info[0].sclk >
rdev->clock.default_sclk)) rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN))
continue; continue;
rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = rdev->pm.power_state[state_index].non_clock_info.pcie_lanes =
power_info->info.asPowerPlayInfo[i].ucNumPciELanes; power_info->info.asPowerPlayInfo[i].ucNumPciELanes;
...@@ -1528,9 +1528,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) ...@@ -1528,9 +1528,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
continue; continue;
/* skip overclock modes for now */ /* skip overclock modes for now */
if ((rdev->pm.power_state[state_index].clock_info[0].mclk > if ((rdev->pm.power_state[state_index].clock_info[0].mclk >
rdev->clock.default_mclk) || rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) ||
(rdev->pm.power_state[state_index].clock_info[0].sclk > (rdev->pm.power_state[state_index].clock_info[0].sclk >
rdev->clock.default_sclk)) rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN))
continue; continue;
rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = rdev->pm.power_state[state_index].non_clock_info.pcie_lanes =
power_info->info_2.asPowerPlayInfo[i].ucNumPciELanes; power_info->info_2.asPowerPlayInfo[i].ucNumPciELanes;
...@@ -1597,9 +1597,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) ...@@ -1597,9 +1597,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
continue; continue;
/* skip overclock modes for now */ /* skip overclock modes for now */
if ((rdev->pm.power_state[state_index].clock_info[0].mclk > if ((rdev->pm.power_state[state_index].clock_info[0].mclk >
rdev->clock.default_mclk) || rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) ||
(rdev->pm.power_state[state_index].clock_info[0].sclk > (rdev->pm.power_state[state_index].clock_info[0].sclk >
rdev->clock.default_sclk)) rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN))
continue; continue;
rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = rdev->pm.power_state[state_index].non_clock_info.pcie_lanes =
power_info->info_3.asPowerPlayInfo[i].ucNumPciELanes; power_info->info_3.asPowerPlayInfo[i].ucNumPciELanes;
...@@ -1693,7 +1693,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) ...@@ -1693,7 +1693,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
continue; continue;
/* skip overclock modes for now */ /* skip overclock modes for now */
if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk > if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk >
rdev->clock.default_sclk) rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN)
continue; continue;
rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type = rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type =
VOLTAGE_SW; VOLTAGE_SW;
...@@ -1720,9 +1720,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) ...@@ -1720,9 +1720,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
continue; continue;
/* skip overclock modes for now */ /* skip overclock modes for now */
if ((rdev->pm.power_state[state_index].clock_info[mode_index].mclk > if ((rdev->pm.power_state[state_index].clock_info[mode_index].mclk >
rdev->clock.default_mclk) || rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) ||
(rdev->pm.power_state[state_index].clock_info[mode_index].sclk > (rdev->pm.power_state[state_index].clock_info[mode_index].sclk >
rdev->clock.default_sclk)) rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN))
continue; continue;
rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type = rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type =
VOLTAGE_SW; VOLTAGE_SW;
......
...@@ -2374,9 +2374,9 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev) ...@@ -2374,9 +2374,9 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev)
goto default_mode; goto default_mode;
/* skip overclock modes for now */ /* skip overclock modes for now */
if ((rdev->pm.power_state[state_index].clock_info[0].mclk > if ((rdev->pm.power_state[state_index].clock_info[0].mclk >
rdev->clock.default_mclk) || rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) ||
(rdev->pm.power_state[state_index].clock_info[0].sclk > (rdev->pm.power_state[state_index].clock_info[0].sclk >
rdev->clock.default_sclk)) rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN))
goto default_mode; goto default_mode;
rdev->pm.power_state[state_index].type = rdev->pm.power_state[state_index].type =
POWER_STATE_TYPE_BATTERY; POWER_STATE_TYPE_BATTERY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment