drm/radeon: don't power gate paused UVD streams
authorChristian König <christian.koenig@amd.com>
Fri, 10 Jan 2014 15:05:05 +0000 (16:05 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 20 Jan 2014 17:05:12 +0000 (12:05 -0500)
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_pm.c
drivers/gpu/drm/radeon/radeon_uvd.c

index 0b24c4c7dcf902f9d0eec79d459adcc51c6b34f1..63c50493da5608196c67a868064f31518fccbeb3 100644 (file)
@@ -924,6 +924,10 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable)
 
        if (rdev->asic->dpm.powergate_uvd) {
                mutex_lock(&rdev->pm.mutex);
+               /* don't powergate anything if we
+                  have active but pause streams */
+               enable |= rdev->pm.dpm.sd > 0;
+               enable |= rdev->pm.dpm.hd > 0;
                /* enable/disable UVD */
                radeon_dpm_powergate_uvd(rdev, !enable);
                mutex_unlock(&rdev->pm.mutex);
index b9c0529b4a2e1e9d8f69e51f6742d023492a0040..4b5c1fcb515d5c10191b50df0c112ac474c8d455 100644 (file)
@@ -778,6 +778,8 @@ static void radeon_uvd_idle_work_handler(struct work_struct *work)
 
        if (radeon_fence_count_emitted(rdev, R600_RING_TYPE_UVD_INDEX) == 0) {
                if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled) {
+                       radeon_uvd_count_handles(rdev, &rdev->pm.dpm.sd,
+                                                &rdev->pm.dpm.hd);
                        radeon_dpm_enable_uvd(rdev, false);
                } else {
                        radeon_set_uvd_clocks(rdev, 0, 0);