summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-10-24 00:26:09 -0700
committerEric Anholt <eric@anholt.net>2006-10-25 16:11:06 -0700
commit3ab9f5a4a8cd62c8a8c2a09d3d105adbe815a83d (patch)
treeb4b9c9a4afc920ef9c006d0c38f2a95d42ae93b1
parentdf14838eb5d0a056f663d9f12bd8b5c25cf97330 (diff)
Move vbeInfo out of the driver struct to the one place it's used.
-rw-r--r--src/i830.h1
-rw-r--r--src/i830_driver.c42
2 files changed, 14 insertions, 29 deletions
diff --git a/src/i830.h b/src/i830.h
index b4408c26..3f4eacc1 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -447,7 +447,6 @@ typedef struct _I830Rec {
/* Video BIOS support. */
vbeInfoPtr pVbe;
- VbeInfoBlock *vbeInfo;
VESAPtr vesa;
Bool swfSaved;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 0c0aa952..10c6f09e 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -375,8 +375,6 @@ I830FreeRec(ScrnInfoPtr pScrn)
pI830 = I830PTR(pScrn);
if (I830IsPrimary(pScrn)) {
- if (pI830->vbeInfo)
- VBEFreeVBEInfo(pI830->vbeInfo);
if (pI830->pVbe)
vbeFree(pI830->pVbe);
}
@@ -597,6 +595,7 @@ I830DetectMemory(ScrnInfoPtr pScrn)
CARD16 gmch_ctrl;
int memsize = 0;
int range;
+ VbeInfoBlock *vbeInfo;
bridge = pciTag(0, 0, 0); /* This is always the host bridge */
gmch_ctrl = pciReadWord(bridge, I830_GMCH_CTRL);
@@ -661,6 +660,19 @@ I830DetectMemory(ScrnInfoPtr pScrn)
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "no video memory detected.\n");
}
+
+ /* Sanity check: compare with what the BIOS thinks. */
+ vbeInfo = VBEGetVBEInfo(pI830->pVbe);
+ if (vbeInfo != NULL && vbeInfo->TotalMemory != memsize / 1024 / 64) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Detected stolen memory (%ld kB) doesn't match what the BIOS"
+ " reports (%d kB)\n",
+ ROUND_DOWN_TO(memsize / 1024, 64),
+ vbeInfo->TotalMemory * 64);
+ }
+ if (vbeInfo != NULL)
+ VBEFreeVBEInfo(vbeInfo);
+
return memsize;
}
@@ -1301,13 +1313,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Integrated Graphics Chipset: Intel(R) %s\n", chipname);
- if (I830IsPrimary(pScrn)) {
- pI830->vbeInfo = VBEGetVBEInfo(pI830->pVbe);
- } else {
- I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1);
- pI830->vbeInfo = pI8301->vbeInfo;
- }
-
/* Set the Chipset and ChipRev, allowing config file entries to override. */
if (pI830->pEnt->device->chipset && *pI830->pEnt->device->chipset) {
pScrn->chipset = pI830->pEnt->device->chipset;
@@ -1434,15 +1439,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
pI830->StolenMemory.Start = 0;
pI830->StolenMemory.End = pI830->StolenMemory.Size;
- /* Sanity check: compare with what the BIOS thinks. */
- if (pI830->vbeInfo->TotalMemory != pI830->StolenMemory.Size / 1024 / 64) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Detected stolen memory (%ld kB) doesn't match what the BIOS"
- " reports (%d kB)\n",
- ROUND_DOWN_TO(pI830->StolenMemory.Size / 1024, 64),
- pI830->vbeInfo->TotalMemory * 64);
- }
-
/* Find the maximum amount of agpgart memory available. */
if (I830IsPrimary(pScrn)) {
mem = I830CheckAvailableMemory(pScrn);
@@ -2243,10 +2239,8 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
#if 0
if (I830IsPrimary(pScrn)) {
- VBEFreeVBEInfo(pI830->vbeInfo);
vbeFree(pI830->pVbe);
}
- pI830->vbeInfo = NULL;
pI830->pVbe = NULL;
#endif
@@ -3233,14 +3227,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!pI830->pVbe)
return FALSE;
- if (I830IsPrimary(pScrn)) {
- if (pI830->vbeInfo)
- VBEFreeVBEInfo(pI830->vbeInfo);
- pI830->vbeInfo = VBEGetVBEInfo(pI830->pVbe);
- } else {
- pI830->vbeInfo = pI8301->vbeInfo;
- }
-
SetPipeAccess(pScrn);
miClearVisualTypes();