diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-03-27 06:12:57 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-03-27 06:12:57 +0000 |
commit | 607f18cfbfc2a7b5509f8b567bf510fce31b361e (patch) | |
tree | 977c900fbc06c9cd2a5edb47f4262f1928e254ed | |
parent | bf1c4471137f10b7de9d79519ca2240058997e18 (diff) |
Fix a regression of my latest fix that broke color tiling on some setups.
RADEONRestoreMemMapRegisters() must not clear CRTC_OFFSET_CNTL and
friends unconditionally but only when there is a map change or it will
clear them after the DRI updates the AGP location, thus turning tiling
back off on the CRTC. Also remove a duplicate call to
RADEONInitCommonRegisters().
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/radeon_driver.c | 67 |
2 files changed, 41 insertions, 37 deletions
@@ -1,3 +1,14 @@ +2006-03-27 Benjamin Herrenschmidt <benh@kernel.crashing.org> + + * src/radeon_driver.c: (RADEONRestoreMemMapRegisters), + (RADEONInit): + Fix a regression of my latest fix that broke color tiling on some + setups. RADEONRestoreMemMapRegisters() must not clear CRTC_OFFSET_CNTL + and friends unconditionally but only when there is a map change or it + will clear them after the DRI updates the AGP location, thus turning + tiling back off on the CRTC. + Also remove a duplicate call to RADEONInitCommonRegisters(). + 2006-03-23 Roland Scheidegger <rscheidegger_lists@hispeed.ch> * src/radeon_reg.h: * src/radeon_video.c: (RADEONResetVideo), (RADEONDisplayVideo), diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 2dad6634..eca048e0 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1,5 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.117 2004/02/19 22:38:12 tsi Exp $ */ -/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.107 2006/03/22 22:30:14 krh Exp $ */ +/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.108 2006/03/23 01:37:15 benh Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -6226,56 +6226,50 @@ static void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn, /* Reset the engine and HDP */ RADEONEngineReset(pScrn); - RADEONTRACE((" All done.\n")); - } - - RADEONTRACE(("Updating base addresses...\n")); - - /* Make sure we have sane offsets before enabling, disable - * stereo and wait for offsets to catch up with hw - */ - OUTREG(RADEON_CRTC_OFFSET_CNTL, RADEON_CRTC_OFFSET_FLIP_CNTL); - OUTREG(RADEON_CRTC_OFFSET, 0); - OUTREG(RADEON_CRTC_OFFSET_CNTL, 0); - OUTREG(RADEON_CUR_OFFSET, 0); - timeout = 0; - while(INREG(RADEON_CRTC_OFFSET) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET) { - if (timeout++ > 1000000) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Timeout waiting for CRTC offset to update !\n"); - break; - } - usleep(1000); - } - OUTREG(RADEON_DISPLAY_BASE_ADDR, restore->display_base_addr); - - if (info->HasCRTC2) { - /* Make sure we have sane offsets before enabling, disable - * stereo and wait for offsets to catch up with hw + /* Make sure we have sane offsets before re-enabling the CRTCs, disable + * stereo, clear offsets, and wait for offsets to catch up with hw */ - OUTREG(RADEON_CRTC2_OFFSET_CNTL, RADEON_CRTC2_OFFSET_FLIP_CNTL); - OUTREG(RADEON_CRTC2_OFFSET, 0); - OUTREG(RADEON_CRTC2_OFFSET_CNTL, 0); - OUTREG(RADEON_CUR2_OFFSET, 0); + + OUTREG(RADEON_CRTC_OFFSET_CNTL, RADEON_CRTC_OFFSET_FLIP_CNTL); + OUTREG(RADEON_CRTC_OFFSET, 0); + OUTREG(RADEON_CUR_OFFSET, 0); timeout = 0; - while(INREG(RADEON_CRTC2_OFFSET) & RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET) { + while(INREG(RADEON_CRTC_OFFSET) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET) { if (timeout++ > 1000000) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Timeout waiting for CRTC2 offset to update !\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Timeout waiting for CRTC offset to update !\n"); break; } usleep(1000); } - OUTREG(RADEON_DISPLAY2_BASE_ADDR, restore->display2_base_addr); + if (info->HasCRTC2) { + OUTREG(RADEON_CRTC2_OFFSET_CNTL, RADEON_CRTC2_OFFSET_FLIP_CNTL); + OUTREG(RADEON_CRTC2_OFFSET, 0); + OUTREG(RADEON_CUR2_OFFSET, 0); + timeout = 0; + while(INREG(RADEON_CRTC2_OFFSET) & RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET) { + if (timeout++ > 1000000) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Timeout waiting for CRTC2 offset to update !\n"); + break; + } + usleep(1000); + } + } } + RADEONTRACE(("Updating display base addresses...\n")); + + OUTREG(RADEON_DISPLAY_BASE_ADDR, restore->display_base_addr); + if (info->HasCRTC2) + OUTREG(RADEON_DISPLAY2_BASE_ADDR, restore->display2_base_addr); OUTREG(RADEON_OV0_BASE_ADDR, restore->ov0_base_addr); (void)INREG(RADEON_OV0_BASE_ADDR); /* More paranoia delays, wait 100ms */ usleep(100000); - RADEONTRACE(("Done updating base addresses.\n")); + RADEONTRACE(("Memory map updated.\n")); } static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save) @@ -8572,7 +8566,6 @@ static Bool RADEONInit(ScrnInfoPtr pScrn, DisplayModePtr mode, return FALSE; RADEONInitPLL2Registers(pScrn, save, &info->pll, dot_clock, info->DisplayType != MT_CRT); } else if (info->MergedFB) { - RADEONInitCommonRegisters(save, info); if (!RADEONInitCrtcRegisters(pScrn, save, ((RADEONMergedDisplayModePtr)mode->Private)->CRT1, info)) return FALSE; |