]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
drm/radeon: don't disable plls that are in use by other crtcs
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Aug 2012 23:06:21 +0000 (19:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:30:24 +0000 (10:30 -0700)
commit 4e58591c8961b3e31709313f75819f2eec06e322 upstream.

Some plls are shared for DP.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/atombios_crtc.c

index 71bd61c33b7dde694a46740b9eb91da023814b4e..19f4082c6181d6a7b5d5ba74310dff09ea8223e3 100644 (file)
@@ -1663,9 +1663,22 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)
        struct drm_device *dev = crtc->dev;
        struct radeon_device *rdev = dev->dev_private;
        struct radeon_atom_ss ss;
+       int i;
 
        atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
 
+       for (i = 0; i < rdev->num_crtc; i++) {
+               if (rdev->mode_info.crtcs[i] &&
+                   rdev->mode_info.crtcs[i]->enabled &&
+                   i != radeon_crtc->crtc_id &&
+                   radeon_crtc->pll_id == rdev->mode_info.crtcs[i]->pll_id) {
+                       /* one other crtc is using this pll don't turn
+                        * off the pll
+                        */
+                       goto done;
+               }
+       }
+
        switch (radeon_crtc->pll_id) {
        case ATOM_PPLL1:
        case ATOM_PPLL2:
@@ -1682,6 +1695,7 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)
        default:
                break;
        }
+done:
        radeon_crtc->pll_id = -1;
 }