diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-02-11 17:16:36 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-17 23:25:08 -0500 |
commit | 2745932495ca3634b11a8662b464d2bf0325ae78 (patch) | |
tree | 86194330d087c59c87a872a73eae82ff72da45e0 /drivers/gpu/drm/radeon | |
parent | 5230aea62c0d8f53edcc3e014c3404132afcfeb4 (diff) |
drm/radeon/kms: accept slightly overclocked power modes
Fixes fdo bug #26329
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Tested-by: Tobias Jakobi <liquid.acid@gmx.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 4 |
3 files changed, 16 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 9f35beed13e8..350ae71953e9 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -662,6 +662,11 @@ struct radeon_power_state { | |||
662 | bool voltage_drop_active; | 662 | bool voltage_drop_active; |
663 | }; | 663 | }; |
664 | 664 | ||
665 | /* | ||
666 | * Some modes are overclocked by very low value, accept them | ||
667 | */ | ||
668 | #define RADEON_MODE_OVERCLOCK_MARGIN 500 /* 5 MHz */ | ||
669 | |||
665 | struct radeon_pm { | 670 | struct radeon_pm { |
666 | struct mutex mutex; | 671 | struct mutex mutex; |
667 | struct delayed_work idle_work; | 672 | struct delayed_work idle_work; |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 4f7dbce9883a..731210bef744 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1463,9 +1463,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1463 | continue; | 1463 | continue; |
1464 | /* skip overclock modes for now */ | 1464 | /* skip overclock modes for now */ |
1465 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > | 1465 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > |
1466 | rdev->clock.default_mclk) || | 1466 | rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) || |
1467 | (rdev->pm.power_state[state_index].clock_info[0].sclk > | 1467 | (rdev->pm.power_state[state_index].clock_info[0].sclk > |
1468 | rdev->clock.default_sclk)) | 1468 | rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN)) |
1469 | continue; | 1469 | continue; |
1470 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = | 1470 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = |
1471 | power_info->info.asPowerPlayInfo[i].ucNumPciELanes; | 1471 | power_info->info.asPowerPlayInfo[i].ucNumPciELanes; |
@@ -1528,9 +1528,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1528 | continue; | 1528 | continue; |
1529 | /* skip overclock modes for now */ | 1529 | /* skip overclock modes for now */ |
1530 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > | 1530 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > |
1531 | rdev->clock.default_mclk) || | 1531 | rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) || |
1532 | (rdev->pm.power_state[state_index].clock_info[0].sclk > | 1532 | (rdev->pm.power_state[state_index].clock_info[0].sclk > |
1533 | rdev->clock.default_sclk)) | 1533 | rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN)) |
1534 | continue; | 1534 | continue; |
1535 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = | 1535 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = |
1536 | power_info->info_2.asPowerPlayInfo[i].ucNumPciELanes; | 1536 | power_info->info_2.asPowerPlayInfo[i].ucNumPciELanes; |
@@ -1597,9 +1597,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1597 | continue; | 1597 | continue; |
1598 | /* skip overclock modes for now */ | 1598 | /* skip overclock modes for now */ |
1599 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > | 1599 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > |
1600 | rdev->clock.default_mclk) || | 1600 | rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) || |
1601 | (rdev->pm.power_state[state_index].clock_info[0].sclk > | 1601 | (rdev->pm.power_state[state_index].clock_info[0].sclk > |
1602 | rdev->clock.default_sclk)) | 1602 | rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN)) |
1603 | continue; | 1603 | continue; |
1604 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = | 1604 | rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = |
1605 | power_info->info_3.asPowerPlayInfo[i].ucNumPciELanes; | 1605 | power_info->info_3.asPowerPlayInfo[i].ucNumPciELanes; |
@@ -1693,7 +1693,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1693 | continue; | 1693 | continue; |
1694 | /* skip overclock modes for now */ | 1694 | /* skip overclock modes for now */ |
1695 | if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk > | 1695 | if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk > |
1696 | rdev->clock.default_sclk) | 1696 | rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN) |
1697 | continue; | 1697 | continue; |
1698 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type = | 1698 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type = |
1699 | VOLTAGE_SW; | 1699 | VOLTAGE_SW; |
@@ -1720,9 +1720,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
1720 | continue; | 1720 | continue; |
1721 | /* skip overclock modes for now */ | 1721 | /* skip overclock modes for now */ |
1722 | if ((rdev->pm.power_state[state_index].clock_info[mode_index].mclk > | 1722 | if ((rdev->pm.power_state[state_index].clock_info[mode_index].mclk > |
1723 | rdev->clock.default_mclk) || | 1723 | rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) || |
1724 | (rdev->pm.power_state[state_index].clock_info[mode_index].sclk > | 1724 | (rdev->pm.power_state[state_index].clock_info[mode_index].sclk > |
1725 | rdev->clock.default_sclk)) | 1725 | rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN)) |
1726 | continue; | 1726 | continue; |
1727 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type = | 1727 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type = |
1728 | VOLTAGE_SW; | 1728 | VOLTAGE_SW; |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 9989d22a4d8f..5ef791be5036 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -2374,9 +2374,9 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev) | |||
2374 | goto default_mode; | 2374 | goto default_mode; |
2375 | /* skip overclock modes for now */ | 2375 | /* skip overclock modes for now */ |
2376 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > | 2376 | if ((rdev->pm.power_state[state_index].clock_info[0].mclk > |
2377 | rdev->clock.default_mclk) || | 2377 | rdev->clock.default_mclk + RADEON_MODE_OVERCLOCK_MARGIN) || |
2378 | (rdev->pm.power_state[state_index].clock_info[0].sclk > | 2378 | (rdev->pm.power_state[state_index].clock_info[0].sclk > |
2379 | rdev->clock.default_sclk)) | 2379 | rdev->clock.default_sclk + RADEON_MODE_OVERCLOCK_MARGIN)) |
2380 | goto default_mode; | 2380 | goto default_mode; |
2381 | rdev->pm.power_state[state_index].type = | 2381 | rdev->pm.power_state[state_index].type = |
2382 | POWER_STATE_TYPE_BATTERY; | 2382 | POWER_STATE_TYPE_BATTERY; |