Module Name: xsrc
Committed By: macallan
Date: Thu Jan 6 03:27:02 UTC 2011
Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/int10: generic.c
helper_exec.c
Log Message:
get this a little closer to working on non-x86 by:
* not poking around in IO space trying to disable / enable ancient VGAs when
NO_LEGACY_VGA is defined
* actually checking if what we get from read_legacy_video_BIOS() is actually
a valid PC ROM image every time we try
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/generic.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/helper_exec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/generic.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/generic.c:1.1.1.3 xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/generic.c:1.2
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/generic.c:1.1.1.3 Tue Nov 23 05:21:38 2010
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/generic.c Thu Jan 6 03:27:02 2011
@@ -91,7 +91,7 @@
/* Try to use the civilized PCI interface first.
*/
if (pci_device_read_rom(dev, Buf) == 0) {
- return dev->rom_size;
+ return (unsigned long)dev->rom_size;
}
ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, dev, offset, size);
@@ -145,6 +145,7 @@
pInt->entityIndex = entityIndex;
if (!xf86Int10ExecSetup(pInt))
goto error0;
+
pInt->mem = &genericMem;
pInt->private = (pointer)xnfcalloc(1, sizeof(genericInt10Priv));
INTPriv(pInt)->alloc = (pointer)xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
@@ -154,7 +155,8 @@
/* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like
* FIXME: an error
*/
- pInt->dev = xf86GetPciInfoForEntity(entityIndex);
+
+ pInt->dev = xf86GetPciInfoForEntity(entityIndex);
/*
* we need to map video RAM MMIO as some chipsets map mmio
@@ -265,17 +267,23 @@
xf86DrvMsg(screen,X_INFO,
"No legacy BIOS found -- trying PCI\n");
}
+
if (!done) {
int err;
struct pci_device *rom_device =
xf86GetPciInfoForEntity(pInt->entityIndex);
err = pci_device_read_rom(rom_device, vbiosMem);
+
if (err) {
xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (5) %s\n",
strerror(err));
goto error1;
}
+ if (!int10_check_bios(screen, bios_location >> 4, vbiosMem)) {
+ xf86Msg(X_INFO, "No BIOS found\n");
+ goto error1;
+ }
}
}
Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/helper_exec.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/helper_exec.c:1.3 xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/helper_exec.c:1.4
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/helper_exec.c:1.3 Tue Nov 23 06:38:08 2010
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/int10/helper_exec.c Thu Jan 6 03:27:02 2011
@@ -650,6 +650,7 @@
void
LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
{
+#ifndef NO_LEGACY_VGA
vga->save_msr = inb(pInt->ioBase + 0x03CC);
vga->save_vse = inb(pInt->ioBase + 0x03C3);
#ifndef __ia64__
@@ -662,17 +663,20 @@
outb(pInt->ioBase + 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
#endif
outb(pInt->ioBase + 0x0102, ~(CARD8)0x01 & vga->save_pos102);
+#endif
}
void
UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
{
+#ifndef NO_LEGACY_VGA
outb(pInt->ioBase + 0x0102, vga->save_pos102);
#ifndef __ia64__
outb(pInt->ioBase + 0x46E8, vga->save_46e8);
#endif
outb(pInt->ioBase + 0x03C3, vga->save_vse);
outb(pInt->ioBase + 0x03C2, vga->save_msr);
+#endif
}
#if defined (_PC)