diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-03-16 00:09:05 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 12:20:53 +0400 |
commit | 8a56df632e524a1c444c56bb7ce9fe8d94e639e0 (patch) | |
tree | d9b98f6c8fc740c51b6bc7c22d81221d48730135 /drivers/gpu | |
parent | 02b17cc05372ab58e9638008d0206f1c1ee0cf5c (diff) | |
download | linux-8a56df632e524a1c444c56bb7ce9fe8d94e639e0.tar.xz |
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>
Diffstat (limited to 'drivers/gpu')
-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) static void radeon_pm_set_clocks(struct radeon_device *rdev) { + int i; + radeon_get_power_state(rdev, rdev->pm.planned_action); mutex_lock(&rdev->cp.mutex); @@ -388,22 +390,18 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) rdev->irq.gui_idle = false; radeon_irq_set(rdev); - if (rdev->pm.active_crtcs & (1 << 0)) { - rdev->pm.req_vblank |= (1 << 0); - drm_vblank_get(rdev->ddev, 0); - } - if (rdev->pm.active_crtcs & (1 << 1)) { - rdev->pm.req_vblank |= (1 << 1); - drm_vblank_get(rdev->ddev, 1); + for (i = 0; i < rdev->num_crtc; i++) { + if (rdev->pm.active_crtcs & (1 << i)) { + rdev->pm.req_vblank |= (1 << i); + drm_vblank_get(rdev->ddev, i); + } } radeon_pm_set_clocks_locked(rdev); - if (rdev->pm.req_vblank & (1 << 0)) { - rdev->pm.req_vblank &= ~(1 << 0); - drm_vblank_put(rdev->ddev, 0); - } - if (rdev->pm.req_vblank & (1 << 1)) { - rdev->pm.req_vblank &= ~(1 << 1); - drm_vblank_put(rdev->ddev, 1); + for (i = 0; i < rdev->num_crtc; i++) { + if (rdev->pm.req_vblank & (1 << i)) { + rdev->pm.req_vblank &= ~(1 << i); + drm_vblank_put(rdev->ddev, i); + } } mutex_unlock(&rdev->cp.mutex); |