diff options
author | Arkadiusz Miskiewicz <arekm@maven.pl> | 2007-11-26 12:43:30 -0500 |
---|---|---|
committer | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-11-26 12:43:30 -0500 |
commit | 6f080d00e6f4f84d5e0d6b4eff302bf42c230e81 (patch) | |
tree | 4af5c21bb5c12a5f336fd9f49112a3e63cfb46ba | |
parent | dcf22aed87366f4625fb5042cb84fecccd9ceece (diff) |
RADEON: fix backlight control on some laptops
It seems the bios scratch regs are involved in backlight control
on some laptops. This patch fixes the problematic laptops and doesn't
seem to break the previous bios lid and output control fixes.
-rw-r--r-- | src/radeon_crtc.c | 4 | ||||
-rw-r--r-- | src/radeon_driver.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index de242730..b1d216de 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -769,8 +769,8 @@ RADEONInitBIOSRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save) RADEONInfoPtr info = RADEONPTR(pScrn); /* tell the bios not to muck with the hardware on events */ - save->bios_4_scratch = 0; - save->bios_5_scratch = 0xff00; + save->bios_4_scratch = 0x4; /* 0x4 needed for backlight */ + save->bios_5_scratch = (info->SavedReg.bios_5_scratch & 0xff) | 0xff00; /* bits 0-3 keep backlight level */ save->bios_6_scratch = info->SavedReg.bios_6_scratch | 0x40000000; } diff --git a/src/radeon_driver.c b/src/radeon_driver.c index c55b5a5c..04654974 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -4041,10 +4041,13 @@ void RADEONRestoreBIOSRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore) { RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; + CARD32 bios_5_scratch = INREG(RADEON_BIOS_5_SCRATCH); CARD32 bios_6_scratch = INREG(RADEON_BIOS_6_SCRATCH); OUTREG(RADEON_BIOS_4_SCRATCH, restore->bios_4_scratch); - OUTREG(RADEON_BIOS_5_SCRATCH, restore->bios_5_scratch); + bios_5_scratch &= 0xF; + bios_5_scratch |= (restore->bios_5_scratch & ~0xF); + OUTREG(RADEON_BIOS_5_SCRATCH, bios_5_scratch); if (restore->bios_6_scratch & 0x40000000) bios_6_scratch |= 0x40000000; else |