--- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c.orig 2005-07-28 09:58:30.026778717 -0400 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 2005-07-28 10:02:23.136972800 -0400 @@ -1994,7 +2004,7 @@ RADEONSetFBLocation(ScrnInfoPtr pScrn) unsigned char *RADEONMMIO = info->MMIO; CARD32 mc_fb_location; CARD32 mc_agp_location = INREG(RADEON_MC_AGP_LOCATION); - + CARD32 crtc_ext_cntl, crtc_gen_cntl, crtc2_gen_cntl=0, ov0_scale_cntl; /* This function has many problems with newer cards. * Even with older cards, all registers changed here are not @@ -2047,12 +2057,40 @@ RADEONSetFBLocation(ScrnInfoPtr pScrn) RADEONWaitForIdleMMIO(pScrn); + /* Stop display & memory access */ + crtc_ext_cntl = INREG(RADEON_CRTC_EXT_CNTL); + OUTREG(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl | RADEON_CRTC_DISPLAY_DIS); + crtc_gen_cntl = INREG(RADEON_CRTC_GEN_CNTL); + OUTREG(RADEON_CRTC_GEN_CNTL, (crtc_gen_cntl & ~RADEON_CRTC_CUR_EN) | + RADEON_CRTC_DISP_REQ_EN_B); + if (info->HasCRTC2) { + crtc2_gen_cntl = INREG(RADEON_CRTC2_GEN_CNTL); + OUTREG(RADEON_CRTC2_GEN_CNTL, (crtc2_gen_cntl & ~RADEON_CRTC2_CUR_EN) | + RADEON_CRTC2_DISP_REQ_EN_B); + } + ov0_scale_cntl = INREG(RADEON_OV0_SCALE_CNTL); + OUTREG(RADEON_OV0_SCALE_CNTL, ov0_scale_cntl & ~RADEON_SCALER_ENABLE); + + /* Make sure the chip settles down and set new map*/ + usleep(100000); + OUTREG(RADEON_MC_FB_LOCATION, mc_fb_location); OUTREG(RADEON_MC_AGP_LOCATION, mc_agp_location); + + /* Make sure map fully reached the chip */ + (void)INREG(RADEON_MC_FB_LOCATION); + OUTREG(RADEON_DISPLAY_BASE_ADDR, info->fbLocation); if (info->HasCRTC2) OUTREG(RADEON_DISPLAY2_BASE_ADDR, info->fbLocation); OUTREG(RADEON_OV0_BASE_ADDR, info->fbLocation); + + /* Restore display & memory access */ + OUTREG(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl); + OUTREG(RADEON_CRTC_GEN_CNTL, crtc_gen_cntl); + if (info->HasCRTC2) + OUTREG(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl); + OUTREG(RADEON_OV0_SCALE_CNTL, ov0_scale_cntl); } static void RADEONGetVRamType(ScrnInfoPtr pScrn)