drm/radeon/dpm: resume fixes for some systems
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 30 May 2014 16:40:15 +0000 (12:40 -0400)
committerDave Airlie <airlied@redhat.com>
Mon, 2 Jun 2014 03:33:03 +0000 (13:33 +1000)
Setting the power state prior to restoring the display
hardware leads to blank screens on some systems.  Drop
the power state set from dpm resume.  The power state
will get set as part of the mode set sequence.  Also
add an explicit power state set after mode set resume
to cover PX and headless systems.

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=76761

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_pm.c

index c31c12b4e66681614f0d294e4fd0a0cf19350c88..e911898348f87d673b904ae09707faa0ea0ce849 100644 (file)
@@ -270,8 +270,6 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
        switch (mode) {
        case DRM_MODE_DPMS_ON:
                radeon_crtc->enabled = true;
-               /* adjust pm to dpms changes BEFORE enabling crtcs */
-               radeon_pm_compute_clocks(rdev);
                atombios_enable_crtc(crtc, ATOM_ENABLE);
                if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev))
                        atombios_enable_crtc_memreq(crtc, ATOM_ENABLE);
@@ -289,10 +287,10 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
                        atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);
                atombios_enable_crtc(crtc, ATOM_DISABLE);
                radeon_crtc->enabled = false;
-               /* adjust pm to dpms changes AFTER disabling crtcs */
-               radeon_pm_compute_clocks(rdev);
                break;
        }
+       /* adjust pm to dpms */
+       radeon_pm_compute_clocks(rdev);
 }
 
 static void
index 14671406212f00a65d1af8e7e2b10489f93bbba3..2cd144c378d6e976a35b3dddf43e32997946060c 100644 (file)
@@ -1558,6 +1558,10 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
 
        drm_kms_helper_poll_enable(dev);
 
+       /* set the power state here in case we are a PX system or headless */
+       if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled)
+               radeon_pm_compute_clocks(rdev);
+
        if (fbcon) {
                radeon_fbdev_set_suspend(rdev, 0);
                console_unlock();
index 53d6e1bb48dc326bb3487fde5f02749df56d4e57..2bdae61c0ac063f8ce5c95571f2f8e6d55d220e8 100644 (file)
@@ -1104,7 +1104,6 @@ static void radeon_pm_resume_dpm(struct radeon_device *rdev)
        if (ret)
                goto dpm_resume_fail;
        rdev->pm.dpm_enabled = true;
-       radeon_pm_compute_clocks(rdev);
        return;
 
 dpm_resume_fail: