diff options
author | Alex Deucher <alex@cube.(none)> | 2008-02-12 14:46:49 -0500 |
---|---|---|
committer | Alex Deucher <alex@cube.(none)> | 2008-02-12 14:46:49 -0500 |
commit | 860f5af75274cb236f536e1da09da6bd9a579530 (patch) | |
tree | 8d8500e4620d21c69110e9cfb964602a9adf584b /src/radeon_driver.c | |
parent | 32f2119b43a0faf6069d8cc0816f0d9f7914c07f (diff) |
R6xx: fix up use of bios scratch regs to reflect the new offsets
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r-- | src/radeon_driver.c | 66 |
1 files changed, 45 insertions, 21 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 3ba7ce85..9c5fce6f 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2988,9 +2988,6 @@ RADEONInitBIOSRegisters(ScrnInfoPtr pScrn) unsigned char *RADEONMMIO = info->MMIO; RADEONSavePtr save = info->ModeReg; - if (info->ChipFamily >= CHIP_FAMILY_R600) - return; - save->bios_0_scratch = info->SavedReg->bios_0_scratch; save->bios_1_scratch = info->SavedReg->bios_1_scratch; save->bios_2_scratch = info->SavedReg->bios_2_scratch; @@ -3006,8 +3003,13 @@ RADEONInitBIOSRegisters(ScrnInfoPtr pScrn) /* tell the bios not to handle mode switching */ save->bios_6_scratch |= ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH; - OUTREG(RADEON_BIOS_2_SCRATCH, save->bios_2_scratch); - OUTREG(RADEON_BIOS_6_SCRATCH, save->bios_6_scratch); + if (info->ChipFamily >= CHIP_FAMILY_R600) { + OUTREG(R600_BIOS_2_SCRATCH, save->bios_2_scratch); + OUTREG(R600_BIOS_6_SCRATCH, save->bios_6_scratch); + } else { + OUTREG(RADEON_BIOS_2_SCRATCH, save->bios_2_scratch); + OUTREG(RADEON_BIOS_6_SCRATCH, save->bios_6_scratch); + } } else { /* let the bios control the backlight */ save->bios_0_scratch &= ~RADEON_DRIVER_BRIGHTNESS_EN; @@ -4361,14 +4363,25 @@ RADEONRestoreBIOSRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore) RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; - OUTREG(RADEON_BIOS_0_SCRATCH, restore->bios_0_scratch); - OUTREG(RADEON_BIOS_1_SCRATCH, restore->bios_1_scratch); - OUTREG(RADEON_BIOS_2_SCRATCH, restore->bios_2_scratch); - OUTREG(RADEON_BIOS_3_SCRATCH, restore->bios_3_scratch); - OUTREG(RADEON_BIOS_4_SCRATCH, restore->bios_4_scratch); - OUTREG(RADEON_BIOS_5_SCRATCH, restore->bios_5_scratch); - OUTREG(RADEON_BIOS_6_SCRATCH, restore->bios_6_scratch); - OUTREG(RADEON_BIOS_7_SCRATCH, restore->bios_7_scratch); + if (info->ChipFamily >= CHIP_FAMILY_R600) { + OUTREG(R600_BIOS_0_SCRATCH, restore->bios_0_scratch); + OUTREG(R600_BIOS_1_SCRATCH, restore->bios_1_scratch); + OUTREG(R600_BIOS_2_SCRATCH, restore->bios_2_scratch); + OUTREG(R600_BIOS_3_SCRATCH, restore->bios_3_scratch); + OUTREG(R600_BIOS_4_SCRATCH, restore->bios_4_scratch); + OUTREG(R600_BIOS_5_SCRATCH, restore->bios_5_scratch); + OUTREG(R600_BIOS_6_SCRATCH, restore->bios_6_scratch); + OUTREG(R600_BIOS_7_SCRATCH, restore->bios_7_scratch); + } else { + OUTREG(RADEON_BIOS_0_SCRATCH, restore->bios_0_scratch); + OUTREG(RADEON_BIOS_1_SCRATCH, restore->bios_1_scratch); + OUTREG(RADEON_BIOS_2_SCRATCH, restore->bios_2_scratch); + OUTREG(RADEON_BIOS_3_SCRATCH, restore->bios_3_scratch); + OUTREG(RADEON_BIOS_4_SCRATCH, restore->bios_4_scratch); + OUTREG(RADEON_BIOS_5_SCRATCH, restore->bios_5_scratch); + OUTREG(RADEON_BIOS_6_SCRATCH, restore->bios_6_scratch); + OUTREG(RADEON_BIOS_7_SCRATCH, restore->bios_7_scratch); + } } static void @@ -4377,14 +4390,25 @@ RADEONSaveBIOSRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save) RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; - save->bios_0_scratch = INREG(RADEON_BIOS_0_SCRATCH); - save->bios_1_scratch = INREG(RADEON_BIOS_1_SCRATCH); - save->bios_2_scratch = INREG(RADEON_BIOS_2_SCRATCH); - save->bios_3_scratch = INREG(RADEON_BIOS_3_SCRATCH); - save->bios_4_scratch = INREG(RADEON_BIOS_4_SCRATCH); - save->bios_5_scratch = INREG(RADEON_BIOS_5_SCRATCH); - save->bios_6_scratch = INREG(RADEON_BIOS_6_SCRATCH); - save->bios_7_scratch = INREG(RADEON_BIOS_7_SCRATCH); + if (info->ChipFamily >= CHIP_FAMILY_R600) { + save->bios_0_scratch = INREG(R600_BIOS_0_SCRATCH); + save->bios_1_scratch = INREG(R600_BIOS_1_SCRATCH); + save->bios_2_scratch = INREG(R600_BIOS_2_SCRATCH); + save->bios_3_scratch = INREG(R600_BIOS_3_SCRATCH); + save->bios_4_scratch = INREG(R600_BIOS_4_SCRATCH); + save->bios_5_scratch = INREG(R600_BIOS_5_SCRATCH); + save->bios_6_scratch = INREG(R600_BIOS_6_SCRATCH); + save->bios_7_scratch = INREG(R600_BIOS_7_SCRATCH); + } else { + save->bios_0_scratch = INREG(RADEON_BIOS_0_SCRATCH); + save->bios_1_scratch = INREG(RADEON_BIOS_1_SCRATCH); + save->bios_2_scratch = INREG(RADEON_BIOS_2_SCRATCH); + save->bios_3_scratch = INREG(RADEON_BIOS_3_SCRATCH); + save->bios_4_scratch = INREG(RADEON_BIOS_4_SCRATCH); + save->bios_5_scratch = INREG(RADEON_BIOS_5_SCRATCH); + save->bios_6_scratch = INREG(RADEON_BIOS_6_SCRATCH); + save->bios_7_scratch = INREG(RADEON_BIOS_7_SCRATCH); + } } /* Save everything needed to restore the original VC state */ |