summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-03-17 14:29:15 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 18:20:50 +1000
commitef6e6cf56aca91c0b0db8de6e79e0874595fd260 (patch)
tree7ea9b9f6fec371d13d9bf76d027ad3dd7273b954 /drivers/gpu/drm/radeon/radeon_pm.c
parent2031f77ca9c17133869b265210418959a909d259 (diff)
downloadblackbird-op-linux-ef6e6cf56aca91c0b0db8de6e79e0874595fd260.tar.gz
blackbird-op-linux-ef6e6cf56aca91c0b0db8de6e79e0874595fd260.zip
drm/radeon/kms: wait for gpu idle before changing power mode
set proper wait condition as noted by Rafał Miłecki. 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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 6dfeb9cf16ba..4ece89aa26f8 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -378,6 +378,16 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
radeon_get_power_state(rdev, rdev->pm.planned_action);
mutex_lock(&rdev->cp.mutex);
+ /* wait for GPU idle */
+ rdev->pm.gui_idle = false;
+ rdev->irq.gui_idle = true;
+ radeon_irq_set(rdev);
+ wait_event_interruptible_timeout(
+ rdev->irq.idle_queue, rdev->pm.gui_idle,
+ msecs_to_jiffies(RADEON_WAIT_IDLE_TIMEOUT));
+ 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);
OpenPOWER on IntegriCloud