drm/amdgpu/pm: update current crtc info after setting the powerstate
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Feb 2016 22:18:25 +0000 (17:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Mar 2016 23:34:51 +0000 (15:34 -0800)
commit eda1d1cf8d18383f19cd2b752f786120efa4768f upstream.

On CI, we need to see if the number of crtcs changes to determine
whether or not we need to upload the mclk table again.  In practice
we don't currently upload the mclk table again after the initial load.
The only reason you would would be to add new states, e.g., for
arbitrary mclk setting which is not currently supported.

Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index 03fe25142b78ee15756c6ec982ccddb12fe2ec1c..7ae15fad16edd8ff4d235a623a05373d5a9477f6 100644 (file)
@@ -596,9 +596,6 @@ force:
        /* update display watermarks based on new power state */
        amdgpu_display_bandwidth_update(adev);
 
-       adev->pm.dpm.current_active_crtcs = adev->pm.dpm.new_active_crtcs;
-       adev->pm.dpm.current_active_crtc_count = adev->pm.dpm.new_active_crtc_count;
-
        /* wait for the rings to drain */
        for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
                struct amdgpu_ring *ring = adev->rings[i];
@@ -617,6 +614,9 @@ force:
        /* update displays */
        amdgpu_dpm_display_configuration_changed(adev);
 
+       adev->pm.dpm.current_active_crtcs = adev->pm.dpm.new_active_crtcs;
+       adev->pm.dpm.current_active_crtc_count = adev->pm.dpm.new_active_crtc_count;
+
        if (adev->pm.funcs->force_performance_level) {
                if (adev->pm.dpm.thermal_active) {
                        enum amdgpu_dpm_forced_level level = adev->pm.dpm.forced_level;