diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2009-12-23 21:28:33 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-08 18:32:30 -0500 |
commit | a0eb38eb8637a81bb7770d34036e498d2ba63a26 (patch) | |
tree | 15f075135fa0158e995cbb43ac3bba7e0a525472 /drivers/gpu | |
parent | 530079a8f3f35828a80ba4981c1be902982363e7 (diff) |
drm/radeon/kms: get_power_state early, not when processing IRQ
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index f500c8d200e7..1cecd7346ab9 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -273,6 +273,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev) | |||
273 | 273 | ||
274 | rdev->pm.state = PM_STATE_PAUSED; | 274 | rdev->pm.state = PM_STATE_PAUSED; |
275 | rdev->pm.planned_action = PM_ACTION_UPCLOCK; | 275 | rdev->pm.planned_action = PM_ACTION_UPCLOCK; |
276 | radeon_get_power_state(rdev, rdev->pm.planned_action); | ||
276 | rdev->pm.vblank_callback = true; | 277 | rdev->pm.vblank_callback = true; |
277 | 278 | ||
278 | mutex_unlock(&rdev->pm.mutex); | 279 | mutex_unlock(&rdev->pm.mutex); |
@@ -292,6 +293,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev) | |||
292 | if (rdev->pm.state == PM_STATE_MINIMUM) { | 293 | if (rdev->pm.state == PM_STATE_MINIMUM) { |
293 | rdev->pm.state = PM_STATE_ACTIVE; | 294 | rdev->pm.state = PM_STATE_ACTIVE; |
294 | rdev->pm.planned_action = PM_ACTION_UPCLOCK; | 295 | rdev->pm.planned_action = PM_ACTION_UPCLOCK; |
296 | radeon_get_power_state(rdev, rdev->pm.planned_action); | ||
295 | radeon_pm_set_clocks_locked(rdev); | 297 | radeon_pm_set_clocks_locked(rdev); |
296 | 298 | ||
297 | queue_delayed_work(rdev->wq, &rdev->pm.idle_work, | 299 | queue_delayed_work(rdev->wq, &rdev->pm.idle_work, |
@@ -312,6 +314,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev) | |||
312 | 314 | ||
313 | rdev->pm.state = PM_STATE_MINIMUM; | 315 | rdev->pm.state = PM_STATE_MINIMUM; |
314 | rdev->pm.planned_action = PM_ACTION_MINIMUM; | 316 | rdev->pm.planned_action = PM_ACTION_MINIMUM; |
317 | radeon_get_power_state(rdev, rdev->pm.planned_action); | ||
315 | radeon_pm_set_clocks_locked(rdev); | 318 | radeon_pm_set_clocks_locked(rdev); |
316 | } | 319 | } |
317 | 320 | ||
@@ -324,18 +327,14 @@ static void radeon_pm_set_clocks_locked(struct radeon_device *rdev) | |||
324 | /*radeon_fence_wait_last(rdev);*/ | 327 | /*radeon_fence_wait_last(rdev);*/ |
325 | switch (rdev->pm.planned_action) { | 328 | switch (rdev->pm.planned_action) { |
326 | case PM_ACTION_UPCLOCK: | 329 | case PM_ACTION_UPCLOCK: |
327 | radeon_get_power_state(rdev, PM_ACTION_UPCLOCK); | ||
328 | rdev->pm.downclocked = false; | 330 | rdev->pm.downclocked = false; |
329 | break; | 331 | break; |
330 | case PM_ACTION_DOWNCLOCK: | 332 | case PM_ACTION_DOWNCLOCK: |
331 | radeon_get_power_state(rdev, PM_ACTION_DOWNCLOCK); | ||
332 | rdev->pm.downclocked = true; | 333 | rdev->pm.downclocked = true; |
333 | break; | 334 | break; |
334 | case PM_ACTION_MINIMUM: | 335 | case PM_ACTION_MINIMUM: |
335 | radeon_get_power_state(rdev, PM_ACTION_MINIMUM); | ||
336 | break; | 336 | break; |
337 | case PM_ACTION_NONE: | 337 | case PM_ACTION_NONE: |
338 | radeon_get_power_state(rdev, PM_ACTION_NONE); | ||
339 | DRM_ERROR("%s: PM_ACTION_NONE\n", __func__); | 338 | DRM_ERROR("%s: PM_ACTION_NONE\n", __func__); |
340 | break; | 339 | break; |
341 | } | 340 | } |
@@ -427,6 +426,7 @@ static void radeon_pm_idle_work_handler(struct work_struct *work) | |||
427 | rdev->pm.req_vblank |= (1 << 1); | 426 | rdev->pm.req_vblank |= (1 << 1); |
428 | drm_vblank_get(rdev->ddev, 1); | 427 | drm_vblank_get(rdev->ddev, 1); |
429 | } | 428 | } |
429 | radeon_get_power_state(rdev, rdev->pm.planned_action); | ||
430 | rdev->pm.vblank_callback = true; | 430 | rdev->pm.vblank_callback = true; |
431 | } | 431 | } |
432 | } | 432 | } |