xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Mon Nov 26 09:44:51 PST 2007


 src/radeon_crtc.c   |    4 ++--
 src/radeon_driver.c |    5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 6f080d00e6f4f84d5e0d6b4eff302bf42c230e81
Author: Arkadiusz Miskiewicz <arekm at maven.pl>
Date:   Mon Nov 26 12:43:30 2007 -0500

    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.

diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index de24273..b1d216d 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 c55b5a5..0465497 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


More information about the xorg-commit mailing list