summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-11-03 19:41:41 -0800
committerKeith Packard <keithp@neko.keithp.com>2006-11-03 21:48:45 -0800
commit719ad68515be9b996a6314de5448843de1146b88 (patch)
treef2334a2cea5efbf1dfd4aade7162924b1bd59c20
parent9681602177124e84a817a1e1d428f1779f2a45c9 (diff)
Use VBE only temporarily to fetch BIOS rom image
(cherry picked from 6a9386651785afc70a29e355255e8295b321f28e commit)
-rw-r--r--src/i830.h2
-rw-r--r--src/i830_bios.c9
-rw-r--r--src/i830_driver.c8
3 files changed, 16 insertions, 3 deletions
diff --git a/src/i830.h b/src/i830.h
index b4b17ded..10061d1a 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -463,8 +463,10 @@ typedef struct _I830Rec {
/* Stolen memory support */
Bool StolenOnly;
+#if 0
/* Video BIOS support. */
vbeInfoPtr pVbe;
+#endif
Bool swfSaved;
CARD32 saveSWF0;
diff --git a/src/i830_bios.c b/src/i830_bios.c
index 97fb7fc3..0821845a 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -84,15 +84,18 @@ i830GetBIOS(ScrnInfoPtr pScrn)
struct vbt_header *vbt;
int vbt_off;
unsigned char *bios;
+ vbeInfoPtr pVbe;
bios = xalloc(INTEL_VBIOS_SIZE);
if (bios == NULL)
return NULL;
- if (pI830->pVbe != NULL) {
- memcpy(bios, xf86int10Addr(pI830->pVbe->pInt10,
- pI830->pVbe->pInt10->BIOSseg << 4),
+ pVbe = VBEInit (NULL, pI830->pEnt->index);
+ if (pVbe != NULL) {
+ memcpy(bios, xf86int10Addr(pVbe->pInt10,
+ pVbe->pInt10->BIOSseg << 4),
INTEL_VBIOS_SIZE);
+ vbeFree (pVbe);
} else {
xf86ReadPciBIOS(0, pI830->PciTag, 0, bios, INTEL_VBIOS_SIZE);
}
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3b219748..1e92dac8 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -367,10 +367,12 @@ I830FreeRec(ScrnInfoPtr pScrn)
pI830 = I830PTR(pScrn);
+#if 0
if (I830IsPrimary(pScrn)) {
if (pI830->pVbe)
vbeFree(pI830->pVbe);
}
+#endif
xfree(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
@@ -477,7 +479,9 @@ I830DetectMemory(ScrnInfoPtr pScrn)
CARD16 gmch_ctrl;
int memsize = 0;
int range;
+#if 0
VbeInfoBlock *vbeInfo;
+#endif
bridge = pciTag(0, 0, 0); /* This is always the host bridge */
gmch_ctrl = pciReadWord(bridge, I830_GMCH_CTRL);
@@ -543,6 +547,7 @@ I830DetectMemory(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "no video memory detected.\n");
}
+#if 0
/* Sanity check: compare with what the BIOS thinks. */
vbeInfo = VBEGetVBEInfo(pI830->pVbe);
if (vbeInfo != NULL && vbeInfo->TotalMemory != memsize / 1024 / 64) {
@@ -554,6 +559,7 @@ I830DetectMemory(ScrnInfoPtr pScrn)
}
if (vbeInfo != NULL)
VBEFreeVBEInfo(vbeInfo);
+#endif
return memsize;
}
@@ -1001,6 +1007,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
/* We have to use PIO to probe, because we haven't mapped yet. */
I830SetPIOAccess(pI830);
+#if 0
/* Initialize VBE record */
if (I830IsPrimary(pScrn)) {
if ((pI830->pVbe = VBEInit(NULL, pI830->pEnt->index)) == NULL) {
@@ -1011,6 +1018,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1);
pI830->pVbe = pI8301->pVbe;
}
+#endif
switch (pI830->PciInfo->chipType) {
case PCI_CHIP_I830_M: