From 48aa5064aff4b9adf768e480df2312d4375e9c40 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 4 Jan 2010 11:05:44 -0500 Subject: 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. --- src/legacy_output.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3