Rev 3192 | Rev 5078 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3192 | Rev 3764 | ||
---|---|---|---|
Line 250... | Line 250... | ||
250 | switch (mode) { |
250 | switch (mode) { |
251 | case DRM_MODE_DPMS_ON: |
251 | case DRM_MODE_DPMS_ON: |
252 | radeon_crtc->enabled = true; |
252 | radeon_crtc->enabled = true; |
253 | /* adjust pm to dpms changes BEFORE enabling crtcs */ |
253 | /* adjust pm to dpms changes BEFORE enabling crtcs */ |
254 | radeon_pm_compute_clocks(rdev); |
254 | radeon_pm_compute_clocks(rdev); |
255 | if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set) |
- | |
256 | atombios_powergate_crtc(crtc, ATOM_DISABLE); |
- | |
257 | atombios_enable_crtc(crtc, ATOM_ENABLE); |
255 | atombios_enable_crtc(crtc, ATOM_ENABLE); |
258 | if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev)) |
256 | if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev)) |
259 | atombios_enable_crtc_memreq(crtc, ATOM_ENABLE); |
257 | atombios_enable_crtc_memreq(crtc, ATOM_ENABLE); |
260 | atombios_blank_crtc(crtc, ATOM_DISABLE); |
258 | atombios_blank_crtc(crtc, ATOM_DISABLE); |
261 | drm_vblank_post_modeset(dev, radeon_crtc->crtc_id); |
259 | drm_vblank_post_modeset(dev, radeon_crtc->crtc_id); |
Line 269... | Line 267... | ||
269 | atombios_blank_crtc(crtc, ATOM_ENABLE); |
267 | atombios_blank_crtc(crtc, ATOM_ENABLE); |
270 | if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev)) |
268 | if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev)) |
271 | atombios_enable_crtc_memreq(crtc, ATOM_DISABLE); |
269 | atombios_enable_crtc_memreq(crtc, ATOM_DISABLE); |
272 | atombios_enable_crtc(crtc, ATOM_DISABLE); |
270 | atombios_enable_crtc(crtc, ATOM_DISABLE); |
273 | radeon_crtc->enabled = false; |
271 | radeon_crtc->enabled = false; |
274 | if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set) |
- | |
275 | atombios_powergate_crtc(crtc, ATOM_ENABLE); |
- | |
276 | /* adjust pm to dpms changes AFTER disabling crtcs */ |
272 | /* adjust pm to dpms changes AFTER disabling crtcs */ |
277 | radeon_pm_compute_clocks(rdev); |
273 | radeon_pm_compute_clocks(rdev); |
278 | break; |
274 | break; |
279 | } |
275 | } |
280 | } |
276 | } |
Line 559... | Line 555... | ||
559 | if (rdev->family < CHIP_RV770) |
555 | if (rdev->family < CHIP_RV770) |
560 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; |
556 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; |
561 | /* use frac fb div on APUs */ |
557 | /* use frac fb div on APUs */ |
562 | if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev)) |
558 | if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev)) |
563 | radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV; |
559 | radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV; |
- | 560 | /* use frac fb div on RS780/RS880 */ |
|
- | 561 | if ((rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS880)) |
|
- | 562 | radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV; |
|
564 | if (ASIC_IS_DCE32(rdev) && mode->clock > 165000) |
563 | if (ASIC_IS_DCE32(rdev) && mode->clock > 165000) |
565 | radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV; |
564 | radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV; |
566 | } else { |
565 | } else { |
567 | radeon_crtc->pll_flags |= RADEON_PLL_LEGACY; |
566 | radeon_crtc->pll_flags |= RADEON_PLL_LEGACY; |
Line 1810... | Line 1809... | ||
1810 | return true; |
1809 | return true; |
1811 | } |
1810 | } |
Line 1812... | Line 1811... | ||
1812 | 1811 | ||
1813 | static void atombios_crtc_prepare(struct drm_crtc *crtc) |
1812 | static void atombios_crtc_prepare(struct drm_crtc *crtc) |
1814 | { |
- | |
1815 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
1813 | { |
1816 | struct drm_device *dev = crtc->dev; |
1814 | struct drm_device *dev = crtc->dev; |
Line 1817... | Line -... | ||
1817 | struct radeon_device *rdev = dev->dev_private; |
- | |
1818 | - | ||
1819 | radeon_crtc->in_mode_set = true; |
1815 | struct radeon_device *rdev = dev->dev_private; |
1820 | 1816 | ||
1821 | /* disable crtc pair power gating before programming */ |
1817 | /* disable crtc pair power gating before programming */ |
Line 1822... | Line 1818... | ||
1822 | if (ASIC_IS_DCE6(rdev)) |
1818 | if (ASIC_IS_DCE6(rdev)) |
1823 | atombios_powergate_crtc(crtc, ATOM_DISABLE); |
1819 | atombios_powergate_crtc(crtc, ATOM_DISABLE); |
1824 | 1820 | ||
Line 1825... | Line 1821... | ||
1825 | atombios_lock_crtc(crtc, ATOM_ENABLE); |
1821 | atombios_lock_crtc(crtc, ATOM_ENABLE); |
1826 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); |
1822 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); |
1827 | } |
- | |
1828 | - | ||
1829 | static void atombios_crtc_commit(struct drm_crtc *crtc) |
1823 | } |
1830 | { |
1824 | |
1831 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
- | |
1832 | 1825 | static void atombios_crtc_commit(struct drm_crtc *crtc) |
|
Line 1833... | Line 1826... | ||
1833 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_ON); |
1826 | { |
1834 | atombios_lock_crtc(crtc, ATOM_DISABLE); |
1827 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_ON); |
1835 | radeon_crtc->in_mode_set = false; |
1828 | atombios_lock_crtc(crtc, ATOM_DISABLE); |
Line 1842... | Line 1835... | ||
1842 | struct radeon_device *rdev = dev->dev_private; |
1835 | struct radeon_device *rdev = dev->dev_private; |
1843 | struct radeon_atom_ss ss; |
1836 | struct radeon_atom_ss ss; |
1844 | int i; |
1837 | int i; |
Line 1845... | Line 1838... | ||
1845 | 1838 | ||
- | 1839 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); |
|
- | 1840 | if (ASIC_IS_DCE6(rdev)) |
|
Line 1846... | Line 1841... | ||
1846 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); |
1841 | atombios_powergate_crtc(crtc, ATOM_ENABLE); |
1847 | 1842 | ||
1848 | for (i = 0; i < rdev->num_crtc; i++) { |
1843 | for (i = 0; i < rdev->num_crtc; i++) { |
1849 | if (rdev->mode_info.crtcs[i] && |
1844 | if (rdev->mode_info.crtcs[i] && |