Message ID | 1344619752-23475-1-git-send-email-alexdeucher@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Aug 10, 2012 at 1:29 PM, <alexdeucher@gmail.com> wrote: > From: Alex Deucher <alexander.deucher@amd.com> > > 1. Drop gui idle stuff, it's not as reliable as fences and only > covers the 3D engine. > 2. Wait for fences on all rings. This makes sure all rings are > idle when reclocking. > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com> > --- > drivers/gpu/drm/radeon/radeon_pm.c | 17 ++++++----------- > 1 files changed, 6 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c > index 7ae6066..2c2c901 100644 > --- a/drivers/gpu/drm/radeon/radeon_pm.c > +++ b/drivers/gpu/drm/radeon/radeon_pm.c > @@ -253,18 +253,13 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) > down_write(&rdev->pm.mclk_lock); > mutex_lock(&rdev->ring_lock); > > - /* gui idle int has issues on older chips it seems */ > - if (rdev->family >= CHIP_R600) { > - if (rdev->irq.installed) { > - /* wait for GPU to become idle */ > - radeon_irq_kms_wait_gui_idle(rdev); > - } > - } else { > - struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; > - if (ring->ready) { > - radeon_fence_wait_empty_locked(rdev, RADEON_RING_TYPE_GFX_INDEX); > - } > + /* wait for the rings to drain */ > + for (i = 0; i < RADEON_NUM_RINGS; i++) { > + struct radeon_ring *ring = &rdev->ring[i]; > + if (ring->ready) > + radeon_fence_wait_empty_locked(rdev, i); > } > + > radeon_unmap_vram_bos(rdev); > > if (rdev->irq.installed) { > -- > 1.7.7.5 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 7ae6066..2c2c901 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -253,18 +253,13 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) down_write(&rdev->pm.mclk_lock); mutex_lock(&rdev->ring_lock); - /* gui idle int has issues on older chips it seems */ - if (rdev->family >= CHIP_R600) { - if (rdev->irq.installed) { - /* wait for GPU to become idle */ - radeon_irq_kms_wait_gui_idle(rdev); - } - } else { - struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; - if (ring->ready) { - radeon_fence_wait_empty_locked(rdev, RADEON_RING_TYPE_GFX_INDEX); - } + /* wait for the rings to drain */ + for (i = 0; i < RADEON_NUM_RINGS; i++) { + struct radeon_ring *ring = &rdev->ring[i]; + if (ring->ready) + radeon_fence_wait_empty_locked(rdev, i); } + radeon_unmap_vram_bos(rdev); if (rdev->irq.installed) {