summaryrefslogtreecommitdiff
path: root/src/legacy_output.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-01-04 11:05:44 -0500
committerAlex Deucher <alexdeucher@gmail.com>2010-01-04 11:05:44 -0500
commit48aa5064aff4b9adf768e480df2312d4375e9c40 (patch)
treebeef67af370b78a501c6eaa372c0fe2a4c6440f8 /src/legacy_output.c
parent36bd69affc996c92c40b7360a7fbaa1a3a46abfd (diff)
radeon: fix LVDS power sequence on Mac cards
Noticed by John R. Dunning. Fix taken from radeonfb. I'm not sure if this sequence would be useful on any PC laptops or not so make it mac specific for now.
Diffstat (limited to 'src/legacy_output.c')
-rw-r--r--src/legacy_output.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/legacy_output.c b/src/legacy_output.c
index 186cd25f..fe0fbe39 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -912,6 +912,11 @@ legacy_output_dpms(xf86OutputPtr output, int mode)
ErrorF("enable LVDS\n");
tmp = INREG(RADEON_LVDS_GEN_CNTL);
tmp |= (RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN);
+#if defined(__powerpc__)
+ /* not sure if this is needed on non-Macs */
+ if (info->MacModel)
+ tmp |= RADEON_LVDS_BL_MOD_EN;
+#endif
tmp &= ~(RADEON_LVDS_DISPLAY_DIS);
usleep (lvds->PanelPwrDly * 1000);
OUTREG(RADEON_LVDS_GEN_CNTL, tmp);
@@ -1001,10 +1006,24 @@ legacy_output_dpms(xf86OutputPtr output, int mode)
*/
OUTPLLP(pScrn, RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb);
}
- tmp = INREG(RADEON_LVDS_GEN_CNTL);
- tmp |= RADEON_LVDS_DISPLAY_DIS;
- tmp &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN);
- OUTREG(RADEON_LVDS_GEN_CNTL, tmp);
+#if defined(__powerpc__)
+ /* not sure if this is needed on non-Macs */
+ if (info->MacModel) {
+ tmp = INREG(RADEON_LVDS_GEN_CNTL);
+ tmp |= RADEON_LVDS_DISPLAY_DIS;
+ tmp &= ~RADEON_LVDS_BL_MOD_EN;
+ OUTREG(RADEON_LVDS_GEN_CNTL, tmp);
+ usleep(100);
+ tmp &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN);
+ OUTREG(RADEON_LVDS_GEN_CNTL, tmp);
+ } else
+#endif
+ {
+ tmp = INREG(RADEON_LVDS_GEN_CNTL);
+ tmp |= RADEON_LVDS_DISPLAY_DIS;
+ tmp &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN);
+ OUTREG(RADEON_LVDS_GEN_CNTL, tmp);
+ }
save->lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS;
save->lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN);
if (info->IsMobility || info->IsIGP) {