Commit 58e21dff authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms/pm: restore default power state on exit

Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 79daedc9
...@@ -123,6 +123,10 @@ void r100_get_power_state(struct radeon_device *rdev, ...@@ -123,6 +123,10 @@ void r100_get_power_state(struct radeon_device *rdev,
rdev->pm.current_power_state_index + 1; rdev->pm.current_power_state_index + 1;
} }
break; break;
case PM_ACTION_DEFAULT:
rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index;
rdev->pm.can_upclock = false;
break;
case PM_ACTION_NONE: case PM_ACTION_NONE:
default: default:
DRM_ERROR("Requested mode for not defined action\n"); DRM_ERROR("Requested mode for not defined action\n");
......
...@@ -161,6 +161,11 @@ void r600_get_power_state(struct radeon_device *rdev, ...@@ -161,6 +161,11 @@ void r600_get_power_state(struct radeon_device *rdev,
} }
rdev->pm.requested_clock_mode_index = 0; rdev->pm.requested_clock_mode_index = 0;
break; break;
case PM_ACTION_DEFAULT:
rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index;
rdev->pm.requested_clock_mode_index = 0;
rdev->pm.can_upclock = false;
break;
case PM_ACTION_NONE: case PM_ACTION_NONE:
default: default:
DRM_ERROR("Requested mode for not defined action\n"); DRM_ERROR("Requested mode for not defined action\n");
...@@ -221,6 +226,11 @@ void r600_get_power_state(struct radeon_device *rdev, ...@@ -221,6 +226,11 @@ void r600_get_power_state(struct radeon_device *rdev,
rdev->pm.can_upclock = false; rdev->pm.can_upclock = false;
} }
break; break;
case PM_ACTION_DEFAULT:
rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index;
rdev->pm.requested_clock_mode_index = 0;
rdev->pm.can_upclock = false;
break;
case PM_ACTION_NONE: case PM_ACTION_NONE:
default: default:
DRM_ERROR("Requested mode for not defined action\n"); DRM_ERROR("Requested mode for not defined action\n");
......
...@@ -615,7 +615,8 @@ enum radeon_pm_action { ...@@ -615,7 +615,8 @@ enum radeon_pm_action {
PM_ACTION_NONE, PM_ACTION_NONE,
PM_ACTION_MINIMUM, PM_ACTION_MINIMUM,
PM_ACTION_DOWNCLOCK, PM_ACTION_DOWNCLOCK,
PM_ACTION_UPCLOCK PM_ACTION_UPCLOCK,
PM_ACTION_DEFAULT
}; };
enum radeon_voltage_type { enum radeon_voltage_type {
......
...@@ -125,6 +125,15 @@ int radeon_pm_init(struct radeon_device *rdev) ...@@ -125,6 +125,15 @@ int radeon_pm_init(struct radeon_device *rdev)
void radeon_pm_fini(struct radeon_device *rdev) void radeon_pm_fini(struct radeon_device *rdev)
{ {
if (rdev->pm.state != PM_STATE_DISABLED) {
/* cancel work */
cancel_delayed_work_sync(&rdev->pm.idle_work);
/* reset default clocks */
rdev->pm.state = PM_STATE_DISABLED;
rdev->pm.planned_action = PM_ACTION_DEFAULT;
radeon_pm_set_clocks(rdev);
}
if (rdev->pm.i2c_bus) if (rdev->pm.i2c_bus)
radeon_i2c_destroy(rdev->pm.i2c_bus); radeon_i2c_destroy(rdev->pm.i2c_bus);
} }
......
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