drm/radeon/dpm: use performance state if no UVD state
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jun 2013 21:55:39 +0000 (17:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Aug 2013 20:30:01 +0000 (16:30 -0400)
Newer asics don't have specific UVD states.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_pm.c

index b72508bcfc7bea7b06801a95a86ba5aa8d350775..79a03de4ac0ac7e15f8e6d949585b40c62ac0769 100644 (file)
@@ -695,7 +695,10 @@ restart_search:
                        break;
                /* internal states */
                case POWER_STATE_TYPE_INTERNAL_UVD:
-                       return rdev->pm.dpm.uvd_ps;
+                       if (rdev->pm.dpm.uvd_ps)
+                               return rdev->pm.dpm.uvd_ps;
+                       else
+                               break;
                case POWER_STATE_TYPE_INTERNAL_UVD_SD:
                        if (ps->class & ATOM_PPLIB_CLASSIFICATION_SDSTATE)
                                return ps;
@@ -742,7 +745,12 @@ restart_search:
        case POWER_STATE_TYPE_INTERNAL_UVD_HD:
        case POWER_STATE_TYPE_INTERNAL_UVD_HD2:
        case POWER_STATE_TYPE_INTERNAL_UVD_MVC:
-               return rdev->pm.dpm.uvd_ps;
+               if (rdev->pm.dpm.uvd_ps) {
+                       return rdev->pm.dpm.uvd_ps;
+               } else {
+                       dpm_state = POWER_STATE_TYPE_PERFORMANCE;
+                       goto restart_search;
+               }
        case POWER_STATE_TYPE_INTERNAL_THERMAL:
                dpm_state = POWER_STATE_TYPE_INTERNAL_ACPI;
                goto restart_search;