diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2008-08-08 15:50:07 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2008-08-08 15:50:07 -0400 |
commit | 268c848130ec1770bb645a74197b6aca7fc95abc (patch) | |
tree | 81d48f79e479a9c4328876a4971bd457257cf7d5 /src/radeon_bios.c | |
parent | 33f88f7fc90d9d93fdcbba9ad59dd70a6596bc3f (diff) |
Fix VT switching on M6 chips
Some M6 chips have a faulty MEM_SIZE register that in
some cases reports 0 on 8 MB cards. On EnterVT we check
the MEM_SIZE reg as a check to see if the card is posted or
not. Since this reg returns 0, the driver attempts to post
the card which can lead to a hang. Switch this to check if
either crtc is active as is done in the bios init code.
fixes bug 13994
Diffstat (limited to 'src/radeon_bios.c')
-rw-r--r-- | src/radeon_bios.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c index de4b017b..a4b9ed68 100644 --- a/src/radeon_bios.c +++ b/src/radeon_bios.c @@ -266,6 +266,26 @@ radeon_read_unposted_bios(ScrnInfoPtr pScrn) return ret; } +Bool +radeon_card_posted(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + uint32_t reg; + + if (IS_AVIVO_VARIANT) { + reg = INREG(AVIVO_D1CRTC_CONTROL) | INREG(AVIVO_D2CRTC_CONTROL); + if (reg & AVIVO_CRTC_EN) + return TRUE; + } else { + reg = INREG(RADEON_CRTC_GEN_CNTL) | INREG(RADEON_CRTC2_GEN_CNTL); + if (reg & RADEON_CRTC_EN) + return TRUE; + } + + return FALSE; +} + /* Read the Video BIOS block and the FP registers (if applicable). */ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) @@ -273,7 +293,7 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) RADEONInfoPtr info = RADEONPTR(pScrn); int tmp; unsigned short dptr; - Bool unposted = FALSE; + Bool posted = TRUE; #ifdef XSERVER_LIBPCIACCESS int size = info->PciInfo->rom_size > RADEON_VBIOS_SIZE ? info->PciInfo->rom_size : RADEON_VBIOS_SIZE; @@ -292,7 +312,7 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) RADEON_VBIOS_SIZE); } else if (!radeon_read_bios(pScrn)) { (void)radeon_read_unposted_bios(pScrn); - unposted = TRUE; + posted = FALSE; } } @@ -387,22 +407,11 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) * so let's work around this for now by only POSTing if none of the * CRTCs are enabled */ - if (unposted && info->VBIOS) { - unsigned char *RADEONMMIO = info->MMIO; - uint32_t reg; - - if (IS_AVIVO_VARIANT) { - reg = INREG(AVIVO_D1CRTC_CONTROL) | INREG(AVIVO_D2CRTC_CONTROL); - if (reg & AVIVO_CRTC_EN) - unposted = FALSE; - } else { - reg = INREG(RADEON_CRTC_GEN_CNTL) | INREG(RADEON_CRTC2_GEN_CNTL); - if (reg & RADEON_CRTC_EN) - unposted = FALSE; - } + if ((!posted) && info->VBIOS) { + posted = radeon_card_posted(pScrn); } - if (unposted && info->VBIOS) { + if ((!posted) && info->VBIOS) { if (info->IsAtomBios) { if (!rhdAtomASICInit(info->atomBIOS)) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, |