diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 2e566e123e9e..3bce0299f64a 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -1696,35 +1696,43 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc) | |||
| 1696 | return ATOM_PPLL2; | 1696 | return ATOM_PPLL2; |
| 1697 | DRM_ERROR("unable to allocate a PPLL\n"); | 1697 | DRM_ERROR("unable to allocate a PPLL\n"); |
| 1698 | return ATOM_PPLL_INVALID; | 1698 | return ATOM_PPLL_INVALID; |
| 1699 | } else { | 1699 | } else if (ASIC_IS_AVIVO(rdev)) { |
| 1700 | if (ASIC_IS_AVIVO(rdev)) { | 1700 | /* in DP mode, the DP ref clock can come from either PPLL |
| 1701 | /* in DP mode, the DP ref clock can come from either PPLL | 1701 | * depending on the asic: |
| 1702 | * depending on the asic: | 1702 | * DCE3: PPLL1 or PPLL2 |
| 1703 | * DCE3: PPLL1 or PPLL2 | 1703 | */ |
| 1704 | */ | 1704 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(radeon_crtc->encoder))) { |
| 1705 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(radeon_crtc->encoder))) { | 1705 | /* use the same PPLL for all DP monitors */ |
| 1706 | /* use the same PPLL for all DP monitors */ | 1706 | pll = radeon_get_shared_dp_ppll(crtc); |
| 1707 | pll = radeon_get_shared_dp_ppll(crtc); | 1707 | if (pll != ATOM_PPLL_INVALID) |
| 1708 | if (pll != ATOM_PPLL_INVALID) | 1708 | return pll; |
| 1709 | return pll; | 1709 | } else { |
| 1710 | } else { | 1710 | /* use the same PPLL for all monitors with the same clock */ |
| 1711 | /* use the same PPLL for all monitors with the same clock */ | 1711 | pll = radeon_get_shared_nondp_ppll(crtc); |
| 1712 | pll = radeon_get_shared_nondp_ppll(crtc); | 1712 | if (pll != ATOM_PPLL_INVALID) |
| 1713 | if (pll != ATOM_PPLL_INVALID) | 1713 | return pll; |
| 1714 | return pll; | 1714 | } |
| 1715 | } | 1715 | /* all other cases */ |
| 1716 | /* all other cases */ | 1716 | pll_in_use = radeon_get_pll_use_mask(crtc); |
| 1717 | pll_in_use = radeon_get_pll_use_mask(crtc); | 1717 | /* the order shouldn't matter here, but we probably |
| 1718 | * need this until we have atomic modeset | ||
| 1719 | */ | ||
| 1720 | if (rdev->flags & RADEON_IS_IGP) { | ||
| 1718 | if (!(pll_in_use & (1 << ATOM_PPLL1))) | 1721 | if (!(pll_in_use & (1 << ATOM_PPLL1))) |
| 1719 | return ATOM_PPLL1; | 1722 | return ATOM_PPLL1; |
| 1720 | if (!(pll_in_use & (1 << ATOM_PPLL2))) | 1723 | if (!(pll_in_use & (1 << ATOM_PPLL2))) |
| 1721 | return ATOM_PPLL2; | 1724 | return ATOM_PPLL2; |
| 1722 | DRM_ERROR("unable to allocate a PPLL\n"); | ||
| 1723 | return ATOM_PPLL_INVALID; | ||
| 1724 | } else { | 1725 | } else { |
| 1725 | /* on pre-R5xx asics, the crtc to pll mapping is hardcoded */ | 1726 | if (!(pll_in_use & (1 << ATOM_PPLL2))) |
| 1726 | return radeon_crtc->crtc_id; | 1727 | return ATOM_PPLL2; |
| 1728 | if (!(pll_in_use & (1 << ATOM_PPLL1))) | ||
| 1729 | return ATOM_PPLL1; | ||
| 1727 | } | 1730 | } |
| 1731 | DRM_ERROR("unable to allocate a PPLL\n"); | ||
| 1732 | return ATOM_PPLL_INVALID; | ||
| 1733 | } else { | ||
| 1734 | /* on pre-R5xx asics, the crtc to pll mapping is hardcoded */ | ||
| 1735 | return radeon_crtc->crtc_id; | ||
| 1728 | } | 1736 | } |
| 1729 | } | 1737 | } |
| 1730 | 1738 | ||
