[Openchrome-devel] xf86-video-openchrome: src/via_ums.c
Kevin Brace
kevinbrace at kemper.freedesktop.org
Tue Mar 8 10:23:25 UTC 2016
src/via_ums.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
New commits:
commit 9dbd0359a98f5010e3f8fcf6ad411404b434901b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Mar 8 02:15:17 2016 -0800
Fixing P4M800 chipset detection code compilation error
Likely due to an overlook, the code to detect P4M800 chipset did not
compile correctly if the code was being compiled against an older
version of x.org X Server.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_ums.c b/src/via_ums.c
index 95a171e..ae0393e 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -707,20 +707,21 @@ UMSPreInit(ScrnInfoPtr pScrn)
pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10;
break;
case VIA_KM400:
- /* P4M800 */
- if (DEVICE_ID(bridge) == 0x0296) {
#ifdef HAVE_PCIACCESS
+ /* P4M800 Host Bridge PCI Device ID */
+ if (DEVICE_ID(bridge) == 0x0296) {
pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1);
-#else
- videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70;
-#endif
} else {
-#ifdef HAVE_PCIACCESS
pci_device_cfg_read_u8(bridge, &videoRam, 0xE1);
+ }
#else
+ /* P4M800 Host Bridge PCI Device ID */
+ if (pciReadWord(pciTag(0, 0, 0), 0x02) == 0x0296) {
+ videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70;
+ } else {
videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70;
-#endif
}
+#endif
pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10;
break;
case VIA_PM800:
More information about the Openchrome-devel
mailing list