drm/radeon/dpm: fixup dynamic state adjust for TN
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Nov 2012 01:34:06 +0000 (20:34 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2013 23:15:52 +0000 (19:15 -0400)
Use a dedicated copy of the current power state since
we may have to adjust it on the fly.

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

index 1b3822ff608386172f2aeae0668b068b2ea6d90f..0c1b50a62d0a8262ae7a5104fcfac94cd16d1500 100644 (file)
@@ -1379,6 +1379,11 @@ static void trinity_apply_state_adjust_rules(struct radeon_device *rdev)
        bool force_high;
        u32 num_active_displays = rdev->pm.dpm.new_active_crtc_count;
 
+       /* point to the hw copy since this function will modify the ps */
+       pi->hw_ps = *ps;
+       rdev->pm.dpm.hw_ps.ps_priv = &pi->hw_ps;
+       ps = &pi->hw_ps;
+
        if (rps->class & ATOM_PPLIB_CLASSIFICATION_THERMAL)
                return trinity_patch_thermal_state(rdev, ps, current_ps);
 
index 31100ac64245ae6ddb9a60d1e1eb683918a91dac..c663aed6aeeab6f4d20e75ad5d81120bb7c80c63 100644 (file)
@@ -110,6 +110,7 @@ struct trinity_power_info {
        bool enable_dpm;
        bool enable_sclk_ds;
        bool uvd_dpm;
+       struct trinity_ps hw_ps;
 };
 
 #define TRINITY_AT_DFLT            30