diff options
-rw-r--r-- | src/radeon.h | 1 | ||||
-rw-r--r-- | src/radeon_driver.c | 20 | ||||
-rw-r--r-- | src/radeon_reg.h | 9 |
3 files changed, 22 insertions, 8 deletions
diff --git a/src/radeon.h b/src/radeon.h index 5e2782c4..c37e1340 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -579,6 +579,7 @@ typedef struct { CARD32 gartLocation; CARD32 mc_fb_location; CARD32 mc_agp_location; + CARD32 mc_agp_location_hi; void *MMIO; /* Map of MMIO region */ void *FB; /* Map of frame buffer */ diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 8d9382b1..8a798319 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1277,7 +1277,7 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn) if (IS_AVIVO_VARIANT) { if (info->ChipFamily >= CHIP_FAMILY_R600) { - info->mc_fb_location = INREG(R600_MC_FB_LOCATION); + info->mc_fb_location = INREG(R600_MC_VM_FB_LOCATION); info->mc_agp_location = 0xffffffc0; } else if (info->ChipFamily == CHIP_FAMILY_RV515) { info->mc_fb_location = INMC(pScrn, RV515_MC_FB_LOCATION); @@ -1440,9 +1440,14 @@ static CARD32 RADEONGetAccessibleVRAM(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; - CARD32 aper_size = INREG(RADEON_CONFIG_APER_SIZE) / 1024; + CARD32 aper_size; unsigned char byte; + if (info->ChipFamily >= CHIP_FAMILY_R600) + aper_size = INREG(R600_CONFIG_APER_SIZE) / 1024; + else + aper_size = INREG(RADEON_CONFIG_APER_SIZE) / 1024; + #ifdef XF86DRI /* If we use the DRI, we need to check if it's a version that has the * bug of always cropping MC_FB_LOCATION to one aperture, in which case @@ -3765,10 +3770,11 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn, (unsigned)restore->mc_agp_location); if (IS_AVIVO_VARIANT) { - CARD32 mc_fb_loc, mc_agp_loc; + CARD32 mc_fb_loc, mc_agp_loc, mc_agp_loc_hi = 0; if (info->ChipFamily >= CHIP_FAMILY_R600) { - mc_fb_loc = INREG(R600_MC_FB_LOCATION); - mc_agp_loc = 0xffffffc0; + mc_fb_loc = INREG(R600_MC_VM_FB_LOCATION); + mc_agp_loc_hi = INREG(R600_MC_VM_AGP_TOP); + mc_agp_loc = INREG(R600_MC_VM_AGP_BOT); } else if (info->ChipFamily == CHIP_FAMILY_RV515) { mc_fb_loc = INMC(pScrn, RV515_MC_FB_LOCATION); mc_agp_loc = INMC(pScrn, RV515_MC_AGP_LOCATION); @@ -3815,7 +3821,7 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn, } if (info->ChipFamily >= CHIP_FAMILY_R600) { - OUTREG(R600_MC_FB_LOCATION, info->mc_fb_location); + OUTREG(R600_MC_VM_FB_LOCATION, info->mc_fb_location); } else { if (info->ChipFamily == CHIP_FAMILY_RV515) { OUTMC(pScrn, RV515_MC_FB_LOCATION, info->mc_fb_location); @@ -3982,7 +3988,7 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save) if (IS_AVIVO_VARIANT) { if (info->ChipFamily >= CHIP_FAMILY_R600) { - fb = INREG(R600_MC_FB_LOCATION); + fb = INREG(R600_MC_VM_FB_LOCATION); agp = 0xffffffc0; } else if (info->ChipFamily == CHIP_FAMILY_RV515) { fb = INMC(pScrn, RV515_MC_FB_LOCATION); diff --git a/src/radeon_reg.h b/src/radeon_reg.h index 4b895ce4..22f52683 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -3689,7 +3689,14 @@ # define AVIVO_I2C_EN (1 << 0) # define AVIVO_I2C_RESET (1 << 8) -#define R600_MC_FB_LOCATION 0x2180 +#define R600_MC_VM_FB_LOCATION 0x2180 +#define R600_MC_VM_AGP_TOP 0x2184 +#define R600_MC_VM_AGP_BOT 0x2188 +#define R600_MC_VM_AGP_BASE 0x218c +#define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190 +#define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194 +#define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198 + #define R600_BUS_CNTL 0x5420 #define R600_CONFIG_CNTL 0x5424 #define R600_CONFIG_MEMSIZE 0x5428 |