diff options
author | Luc Verhaegen <libv@skynet.be> | 2006-01-10 07:35:29 +0000 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2006-01-10 07:35:29 +0000 |
commit | d06e08595f001d2ded3121aa7912a06df0494286 (patch) | |
tree | dec1678a2a7be6af64fbe78e500588853ce48cc7 | |
parent | 4931e8f7f20f0ae402290df3657856c7fa9c9acb (diff) |
[devel-videoram_from_ramcontroller] VIAs latest codedrop stopped using the
inconsistently used scratch registers. They are now poking the ram
controller directly. Sadly they use faulty pci config handling code,
they poke the wrong registers, and they don't interprete the register
content. I of course do things properly, at least for those chips i do
claim to actively support.
-rw-r--r-- | src/via_driver.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/via_driver.c b/src/via_driver.c index 13d7192..f8d1e2f 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -677,6 +677,37 @@ ViaGetMemoryClock(ScrnInfoPtr pScrn) } /* + * Good VIA idea: poke the ramcontroller directly for VideoRam. + * But of course we do this properly, and we also poke the right + * register, since we test code :) + */ +static void +ViaVideoRamGetFromRamController(ScrnInfoPtr pScrn) +{ + VIAPtr pVia = VIAPTR(pScrn); + CARD8 tmp; + + VIAFUNC(pScrn->scrnIndex); + + switch (pVia->Chipset) { + case VT3122: + case VT7205: + /* poke hostbridge: 0x1106:0x3123; 0:0:0.0 */ + tmp = pciReadByte(0x00000000, 0xE1); + pScrn->videoRam = (1 << ((tmp & 0x70) >> 4)) * 1024; + break; + case VT3108: /* ??? on cpu? Check AMD site. */ + case VT3118: /* ??? 0x3259:0xA0 or probably 0xA1 */ + case VT3344: /* ??? 0x3208:0xA0 or probably 0xA1 */ + case VT3157: /* ??? 0x3324:0xA0 or probable 0xA1 */ + default: + ViaDebug(pScrn->scrnIndex, "%s: Chipset %d not supported yet.\n", + __func__, pVia->Chipset); + break; + } +} + +/* * Bandwidth * */ @@ -1239,7 +1270,9 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } } - if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) + if (!pScrn->videoRam) + ViaVideoRamGetFromRamController(pScrn); + if (!pScrn->videoRam) pScrn->videoRam = pVia->Scratch->VideoRam; /* Split FB for SAMM */ |