diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-03-15 17:09:05 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 04:20:53 -0400 |
commit | 8a56df632e524a1c444c56bb7ce9fe8d94e639e0 (patch) | |
tree | d9b98f6c8fc740c51b6bc7c22d81221d48730135 | |
parent | 02b17cc05372ab58e9638008d0206f1c1ee0cf5c (diff) |
drm/radeon/kms/pm: interate across crtcs for vblank
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 4ece89aa26f8..ff3abd8c8966 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -375,6 +375,8 @@ static void radeon_pm_set_clocks_locked(struct radeon_device *rdev) | |||
375 | 375 | ||
376 | static void radeon_pm_set_clocks(struct radeon_device *rdev) | 376 | static void radeon_pm_set_clocks(struct radeon_device *rdev) |
377 | { | 377 | { |
378 | int i; | ||
379 | |||
378 | radeon_get_power_state(rdev, rdev->pm.planned_action); | 380 | radeon_get_power_state(rdev, rdev->pm.planned_action); |
379 | mutex_lock(&rdev->cp.mutex); | 381 | mutex_lock(&rdev->cp.mutex); |
380 | 382 | ||
@@ -388,22 +390,18 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) | |||
388 | rdev->irq.gui_idle = false; | 390 | rdev->irq.gui_idle = false; |
389 | radeon_irq_set(rdev); | 391 | radeon_irq_set(rdev); |
390 | 392 | ||
391 | if (rdev->pm.active_crtcs & (1 << 0)) { | 393 | for (i = 0; i < rdev->num_crtc; i++) { |
392 | rdev->pm.req_vblank |= (1 << 0); | 394 | if (rdev->pm.active_crtcs & (1 << i)) { |
393 | drm_vblank_get(rdev->ddev, 0); | 395 | rdev->pm.req_vblank |= (1 << i); |
394 | } | 396 | drm_vblank_get(rdev->ddev, i); |
395 | if (rdev->pm.active_crtcs & (1 << 1)) { | 397 | } |
396 | rdev->pm.req_vblank |= (1 << 1); | ||
397 | drm_vblank_get(rdev->ddev, 1); | ||
398 | } | 398 | } |
399 | radeon_pm_set_clocks_locked(rdev); | 399 | radeon_pm_set_clocks_locked(rdev); |
400 | if (rdev->pm.req_vblank & (1 << 0)) { | 400 | for (i = 0; i < rdev->num_crtc; i++) { |
401 | rdev->pm.req_vblank &= ~(1 << 0); | 401 | if (rdev->pm.req_vblank & (1 << i)) { |
402 | drm_vblank_put(rdev->ddev, 0); | 402 | rdev->pm.req_vblank &= ~(1 << i); |
403 | } | 403 | drm_vblank_put(rdev->ddev, i); |
404 | if (rdev->pm.req_vblank & (1 << 1)) { | 404 | } |
405 | rdev->pm.req_vblank &= ~(1 << 1); | ||
406 | drm_vblank_put(rdev->ddev, 1); | ||
407 | } | 405 | } |
408 | 406 | ||
409 | mutex_unlock(&rdev->cp.mutex); | 407 | mutex_unlock(&rdev->cp.mutex); |