[Openchrome-devel] xf86-video-openchrome: src/via_ums.c
James Simmons
jsimmons at kemper.freedesktop.org
Thu Jan 3 14:03:12 PST 2013
src/via_ums.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 5a2d98863388413e6c6a2d971d1a68af5ca91173
Author: James Simmons <jsimmons at infradead.org>
Date: Thu Jan 3 22:02:25 2013 +0000
Fix a long standing issues of detecting the proper amount of VRAM on the P4M800 devices. We can tell it is a p4m800 versus a km400 by what pci bridge it has and reading the proper pic function
diff --git a/src/via_ums.c b/src/via_ums.c
index 053c16b..6fc716e 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -708,18 +708,21 @@ UMSPreInit(ScrnInfoPtr pScrn)
pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10;
break;
case VIA_KM400:
+ /* P4M800 */
+ if (DEVICE_ID(bridge) == 0x0296) {
#ifdef HAVE_PCIACCESS
- pci_device_cfg_read_u8(bridge, &videoRam, 0xE1);
+ pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1);
#else
- videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70;
+ videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70;
+#endif
+ } else {
+#ifdef HAVE_PCIACCESS
+ pci_device_cfg_read_u8(bridge, &videoRam, 0xE1);
+#else
+ videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70;
#endif
- pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10;
- /* Workaround for #177 (VRAM probing fail on P4M800) */
- if (pScrn->videoRam < 16384) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Memory size detection failed: using 16 MB.\n");
- pScrn->videoRam = 16 << 10;
}
+ pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10;
break;
case VIA_PM800:
case VIA_VM800:
More information about the Openchrome-devel
mailing list