summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-01-04 11:05:44 -0500
committerAlex Deucher <alexdeucher@gmail.com>2010-01-11 12:46:20 -0500
commit6065ca92763fef1a08185854fc07fb60259ca99e (patch)
treed4209ddc2687bf07b02ad6a0e823a95ef54fb2fa
parente8b9de06482ff792b8d7fa40ce3bc024caca62f6 (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.
-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 7134ee15..9123d589 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) {