aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-06-07 17:49:51 -0400
committerDave Airlie <airlied@redhat.com>2010-06-07 19:35:13 -0400
commitf8ed8b4c5d30b5214f185997131b06e35f6f7113 (patch)
treeaca6fc16abd33d279caf540ccce05561a54ac176 /drivers/gpu/drm/radeon/radeon_pm.c
parent8de016e2bd8ebce9b3728462085bef51179841a6 (diff)
drm/radeon/kms/pm: Misc fixes
- don't rest the power state in pm_init() We already boot up to the default power state. Note this patch relies on: drm/radeon/kms/pm: patch default power state with default clocks/voltages on r6xx+ To make sure the default power state matches the boot up state. - In the pm resume path asic init will have set the power state back to the default so reset the tracking state values. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 6f80625179a6..62e7f967c6c4 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -368,15 +368,18 @@ void radeon_pm_suspend(struct radeon_device *rdev)
368{ 368{
369 mutex_lock(&rdev->pm.mutex); 369 mutex_lock(&rdev->pm.mutex);
370 cancel_delayed_work(&rdev->pm.dynpm_idle_work); 370 cancel_delayed_work(&rdev->pm.dynpm_idle_work);
371 rdev->pm.current_power_state_index = -1;
372 rdev->pm.current_clock_mode_index = -1;
373 rdev->pm.current_sclk = 0;
374 rdev->pm.current_mclk = 0;
375 mutex_unlock(&rdev->pm.mutex); 371 mutex_unlock(&rdev->pm.mutex);
376} 372}
377 373
378void radeon_pm_resume(struct radeon_device *rdev) 374void radeon_pm_resume(struct radeon_device *rdev)
379{ 375{
376 /* asic init will reset the default power state */
377 mutex_lock(&rdev->pm.mutex);
378 rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
379 rdev->pm.current_clock_mode_index = 0;
380 rdev->pm.current_sclk = rdev->clock.default_sclk;
381 rdev->pm.current_mclk = rdev->clock.default_mclk;
382 mutex_unlock(&rdev->pm.mutex);
380 radeon_pm_compute_clocks(rdev); 383 radeon_pm_compute_clocks(rdev);
381} 384}
382 385
@@ -385,12 +388,13 @@ int radeon_pm_init(struct radeon_device *rdev)
385 int ret; 388 int ret;
386 /* default to profile method */ 389 /* default to profile method */
387 rdev->pm.pm_method = PM_METHOD_PROFILE; 390 rdev->pm.pm_method = PM_METHOD_PROFILE;
391 rdev->pm.profile = PM_PROFILE_DEFAULT;
388 rdev->pm.dynpm_state = DYNPM_STATE_DISABLED; 392 rdev->pm.dynpm_state = DYNPM_STATE_DISABLED;
389 rdev->pm.dynpm_planned_action = DYNPM_ACTION_NONE; 393 rdev->pm.dynpm_planned_action = DYNPM_ACTION_NONE;
390 rdev->pm.dynpm_can_upclock = true; 394 rdev->pm.dynpm_can_upclock = true;
391 rdev->pm.dynpm_can_downclock = true; 395 rdev->pm.dynpm_can_downclock = true;
392 rdev->pm.current_sclk = 0; 396 rdev->pm.current_sclk = rdev->clock.default_sclk;
393 rdev->pm.current_mclk = 0; 397 rdev->pm.current_mclk = rdev->clock.default_mclk;
394 398
395 if (rdev->bios) { 399 if (rdev->bios) {
396 if (rdev->is_atom_bios) 400 if (rdev->is_atom_bios)
@@ -398,19 +402,9 @@ int radeon_pm_init(struct radeon_device *rdev)
398 else 402 else
399 radeon_combios_get_power_modes(rdev); 403 radeon_combios_get_power_modes(rdev);
400 radeon_pm_init_profile(rdev); 404 radeon_pm_init_profile(rdev);
401 rdev->pm.current_power_state_index = -1;
402 rdev->pm.current_clock_mode_index = -1;
403 } 405 }
404 406
405 if (rdev->pm.num_power_states > 1) { 407 if (rdev->pm.num_power_states > 1) {
406 if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
407 mutex_lock(&rdev->pm.mutex);
408 rdev->pm.profile = PM_PROFILE_DEFAULT;
409 radeon_pm_update_profile(rdev);
410 radeon_pm_set_clocks(rdev);
411 mutex_unlock(&rdev->pm.mutex);
412 }
413
414 /* where's the best place to put these? */ 408 /* where's the best place to put these? */
415 ret = device_create_file(rdev->dev, &dev_attr_power_profile); 409 ret = device_create_file(rdev->dev, &dev_attr_power_profile);
416 if (ret) 410 if (ret)