diff options
author | Luc Verhaegen <libv@skynet.be> | 2005-11-04 23:08:58 +0000 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2005-11-04 23:08:58 +0000 |
commit | d8bfd0713bc5fb656b6ca0b3966a2847877de564 (patch) | |
tree | 474829c7826061f035bec0a62d37a61ba9b5ca64 | |
parent | cf4652283004f823189be7a3a76a14bda31bf71d (diff) |
#4955: fix memory bandwidth check for VIA P4M800. (reported by Jeremy Shaw)
-rw-r--r-- | src/via_mode.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/via_mode.c b/src/via_mode.c index c424f6d..e47b2d3 100644 --- a/src/via_mode.c +++ b/src/via_mode.c @@ -764,17 +764,27 @@ ViaGetMemoryBandwidth(ScrnInfoPtr pScrn) else return ViaBandwidthTable[VIA_BW_CLE266C].Bandwidth[pVia->MemClk]; case VIA_KM400: - /* 0x84 is earliest public device, 0x80 is more likely though */ - if (pVia->ChipRev < 0x84) - return ViaBandwidthTable[VIA_BW_KM400].Bandwidth[pVia->MemClk]; - else - return ViaBandwidthTable[VIA_BW_KM400A].Bandwidth[pVia->MemClk]; + { + /* is this a KM400 or a P4M800 ? */ + Bool KM400 = FALSE; + + /* check host bridge pci device id. */ + if (pciReadWord(0x00000000, 0x02) == 0x3205) + KM400 = TRUE; + + /* 0x84 is earliest known KM400A device, 0x80 is more likely though */ + if (KM400 && (pVia->ChipRev < 0x84)) + return ViaBandwidthTable[VIA_BW_KM400].Bandwidth[pVia->MemClk]; + else + return ViaBandwidthTable[VIA_BW_KM400A].Bandwidth[pVia->MemClk]; + } case VIA_K8M800: return ViaBandwidthTable[VIA_BW_K8M800].Bandwidth[pVia->MemClk]; case VIA_PM800: return ViaBandwidthTable[VIA_BW_PM800].Bandwidth[pVia->MemClk]; default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaBandwidthAllowed: Unknown Chipset.\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: Unknown Chipset.\n", + __FUNCTION__); return VIA_BW_MIN; } } |