radeon: Use fences to gate entry to reclocking on <r600
authorMatthew Garrett <mjg@redhat.com>
Fri, 30 Apr 2010 19:48:23 +0000 (15:48 -0400)
committerDave Airlie <airlied@redhat.com>
Tue, 18 May 2010 08:21:47 +0000 (18:21 +1000)
GUI idle interrupts don't seem to work terribly well on r500 and earlier,
so let's use a fence instead.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_pm.c

index bded834afa5d9aabfd69915fcab62c056f60bffc..1ee7fc9918ac4242fb6427639cfbf83924f14443 100644 (file)
@@ -76,6 +76,14 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev, int static_switch)
                        msecs_to_jiffies(RADEON_WAIT_IDLE_TIMEOUT));
                rdev->irq.gui_idle = false;
                radeon_irq_set(rdev);
+       } else {
+               struct radeon_fence *fence;
+               radeon_ring_alloc(rdev, 64);
+               radeon_fence_create(rdev, &fence);
+               radeon_fence_emit(rdev, fence);
+               radeon_ring_commit(rdev);
+               radeon_fence_wait(fence, false);
+               radeon_fence_unref(&fence);
        }
        radeon_unmap_vram_bos(rdev);