summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/i810.man14
-rw-r--r--src/common.h2
-rw-r--r--src/i810_driver.c4
-rw-r--r--src/i830.h12
-rw-r--r--src/i830_bios.c76
-rw-r--r--src/i830_driver.c189
-rw-r--r--src/i830_modes.c14
7 files changed, 86 insertions, 225 deletions
diff --git a/man/i810.man b/man/i810.man
index f6b73689..59766a6e 100644
--- a/man/i810.man
+++ b/man/i810.man
@@ -117,13 +117,6 @@ The following driver
.B Options
are supported for the 830M and later chipsets:
.TP
-.BI "Option \*qVBERestore\*q \*q" boolean \*q
-Enable or disable the use of VBE save/restore for saving and restoring
-the initial text mode. This is disabled by default because it causes
-lockups on some platforms. However, there are some cases where it must
-enabled for the correct restoration of the initial video mode. If you are
-having a problem with that, try enabling this option. Default: Disabled.
-.TP
.BI "Option \*qVideoKey\*q \*q" integer \*q
This is the same as the
.B \*qColorKey\*q
@@ -179,13 +172,6 @@ NOTE: Using this option may cause text mode to be restored incorrectly,
and thus should be used with caution.
Default: disabled.
.TP
-.BI "Option \*qDevicePresence\*q \*q" boolean \*q
-Tell the driver to perform an active detect of the currently connected
-monitors. This option is useful if the monitor was not connected when
-the machine has booted, but unfortunately it doesn't always work and
-is extremely dependent upon the Video BIOS.
-Default: disabled
-.TP
.BI "Option \*qRotate\*q \*q90\*q"
Rotate the desktop 90 degrees counterclockwise. Other valid options are
0, 90, 180 and 270 degrees. The RandR extension is used for rotation
diff --git a/src/common.h b/src/common.h
index 21977af4..6a55bfda 100644
--- a/src/common.h
+++ b/src/common.h
@@ -68,7 +68,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
/* I830 hooks for the I810 driver setup/probe. */
-extern const OptionInfoRec *I830BIOSAvailableOptions(int chipid, int busid);
+extern const OptionInfoRec *I830AvailableOptions(int chipid, int busid);
extern void I830InitpScrn(ScrnInfoPtr pScrn);
/* Symbol lists shared by the i810 and i830 parts. */
diff --git a/src/i810_driver.c b/src/i810_driver.c
index b87601e0..c8cb6071 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -477,11 +477,11 @@ I810AvailableOptions(int chipid, int busid)
#ifndef I830_ONLY
const OptionInfoRec *pOptions;
- if ((pOptions = I830BIOSAvailableOptions(chipid, busid)))
+ if ((pOptions = I830AvailableOptions(chipid, busid)))
return pOptions;
return I810Options;
#else
- return I830BIOSAvailableOptions(chipid, busid);
+ return I830AvailableOptions(chipid, busid);
#endif
}
diff --git a/src/i830.h b/src/i830.h
index 4a95441c..19bdd74b 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -72,7 +72,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i830_sdvo.h"
#include "i2c_vid.h"
-/* I830 Video BIOS support */
+/* I830 Video support */
/*
* The mode handling is based upon the VESA driver written by
@@ -337,7 +337,6 @@ typedef struct _I830Rec {
int NumScanlineColorExpandBuffers;
int nextColorExpandBuf;
- I830RegRec SavedReg;
I830RegRec ModeReg;
Bool noAccel;
@@ -395,10 +394,6 @@ typedef struct _I830Rec {
Bool checkDevices;
int operatingDevices;
- /* These are indexed by the display types */
- Bool displayAttached[NumDisplayTypes];
- Bool displayPresent[NumDisplayTypes];
-
/* [0] is Pipe A, [1] is Pipe B. */
int availablePipes;
/* [0] is display plane A, [1] is display plane B. */
@@ -418,11 +413,8 @@ typedef struct _I830Rec {
int yoffset;
unsigned int SaveGeneration;
- Bool vbeRestoreWorkaround;
- Bool devicePresence;
OsTimerPtr devicesTimer;
- int MaxClock;
int ddc2;
int num_outputs;
@@ -447,8 +439,6 @@ typedef struct _I830Rec {
Bool panel_wants_dither;
- unsigned char *VBIOS;
-
CARD32 saveDSPACNTR;
CARD32 saveDSPBCNTR;
CARD32 savePIPEACONF;
diff --git a/src/i830_bios.c b/src/i830_bios.c
index 14e354ed..07dd67d4 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -38,21 +38,20 @@
#include "i830_bios.h"
#include "edid.h"
-#define INTEL_BIOS_8(_addr) (pI830->VBIOS[_addr])
-#define INTEL_BIOS_16(_addr) (pI830->VBIOS[_addr] | \
- (pI830->VBIOS[_addr + 1] << 8))
-#define INTEL_BIOS_32(_addr) (pI830->VBIOS[_addr] | \
- (pI830->VBIOS[_addr + 1] << 8) \
- (pI830->VBIOS[_addr + 2] << 16) \
- (pI830->VBIOS[_addr + 3] << 24))
+#define INTEL_BIOS_8(_addr) (bios[_addr])
+#define INTEL_BIOS_16(_addr) (bios[_addr] | \
+ (bios[_addr + 1] << 8))
+#define INTEL_BIOS_32(_addr) (bios[_addr] | \
+ (bios[_addr + 1] << 8) \
+ (bios[_addr + 2] << 16) \
+ (bios[_addr + 3] << 24))
/* XXX */
#define INTEL_VBIOS_SIZE (64 * 1024)
static void
-i830DumpBIOSToFile(ScrnInfoPtr pScrn)
+i830DumpBIOSToFile(ScrnInfoPtr pScrn, unsigned char *bios)
{
- I830Ptr pI830 = I830PTR(pScrn);
const char *filename = "/tmp/xf86-video-intel-VBIOS";
FILE *f;
@@ -61,7 +60,7 @@ i830DumpBIOSToFile(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't open %s\n", filename);
return;
}
- if (fwrite(pI830->VBIOS, INTEL_VBIOS_SIZE, 1, f) != 1) {
+ if (fwrite(bios, INTEL_VBIOS_SIZE, 1, f) != 1) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't write BIOS data\n");
}
@@ -78,48 +77,46 @@ i830DumpBIOSToFile(ScrnInfoPtr pScrn)
* feed an updated VBT back through that, compared to what we'll fetch using
* this method of groping around in the BIOS data.
*/
-static Bool
+static unsigned char *
i830GetBIOS(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
struct vbt_header *vbt;
int vbt_off;
+ unsigned char *bios;
- if (pI830->VBIOS != NULL)
- return TRUE;
-
- pI830->VBIOS = xalloc(INTEL_VBIOS_SIZE);
- if (pI830->VBIOS == NULL)
- return FALSE;
+ bios = xalloc(INTEL_VBIOS_SIZE);
+ if (bios == NULL)
+ return NULL;
if (pI830->pVbe != NULL) {
- memcpy(pI830->VBIOS, xf86int10Addr(pI830->pVbe->pInt10,
+ memcpy(bios, xf86int10Addr(pI830->pVbe->pInt10,
pI830->pVbe->pInt10->BIOSseg << 4),
INTEL_VBIOS_SIZE);
} else {
- xf86ReadPciBIOS(0, pI830->PciTag, 0, pI830->VBIOS, INTEL_VBIOS_SIZE);
+ xf86ReadPciBIOS(0, pI830->PciTag, 0, bios, INTEL_VBIOS_SIZE);
}
if (0)
- i830DumpBIOSToFile(pScrn);
+ i830DumpBIOSToFile(pScrn, bios);
vbt_off = INTEL_BIOS_16(0x1a);
if (vbt_off >= INTEL_VBIOS_SIZE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad VBT offset: 0x%x\n",
vbt_off);
- xfree(pI830->VBIOS);
- return FALSE;
+ xfree(bios);
+ return NULL;
}
- vbt = (struct vbt_header *)(pI830->VBIOS + vbt_off);
+ vbt = (struct vbt_header *)(bios + vbt_off);
if (memcmp(vbt->signature, "$VBT", 4) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad VBT signature\n");
- xfree(pI830->VBIOS);
- return FALSE;
+ xfree(bios);
+ return NULL;
}
- return TRUE;
+ return bios;
}
Bool
@@ -130,18 +127,22 @@ i830GetLVDSInfoFromBIOS(ScrnInfoPtr pScrn)
struct bdb_header *bdb;
int vbt_off, bdb_off, bdb_block_off, block_size;
int panel_type = -1;
+ unsigned char *bios;
Bool found_panel_info = FALSE;
- if (!i830GetBIOS(pScrn))
+ bios = i830GetBIOS(pScrn);
+
+ if (bios == NULL)
return FALSE;
vbt_off = INTEL_BIOS_16(0x1a);
- vbt = (struct vbt_header *)(pI830->VBIOS + vbt_off);
+ vbt = (struct vbt_header *)(bios + vbt_off);
bdb_off = vbt_off + vbt->bdb_offset;
- bdb = (struct bdb_header *)(pI830->VBIOS + bdb_off);
+ bdb = (struct bdb_header *)(bios + bdb_off);
if (memcmp(bdb->signature, "BIOS_DATA_BLOCK ", 16) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad BDB signature\n");
+ xfree(bios);
return FALSE;
}
@@ -161,7 +162,7 @@ i830GetLVDSInfoFromBIOS(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Found BDB block type %d\n", id);
switch (id) {
case 40:
- lvds1 = (struct lvds_bdb_1 *)(pI830->VBIOS + start);
+ lvds1 = (struct lvds_bdb_1 *)(bios + start);
panel_type = lvds1->panel_type;
if (lvds1->caps & LVDS_CAP_DITHER)
pI830->panel_wants_dither = TRUE;
@@ -170,23 +171,23 @@ i830GetLVDSInfoFromBIOS(ScrnInfoPtr pScrn)
if (panel_type == -1)
break;
- lvds2 = (struct lvds_bdb_2 *)(pI830->VBIOS + start);
- fpparam = (struct lvds_bdb_2_fp_params *)(pI830->VBIOS +
+ lvds2 = (struct lvds_bdb_2 *)(bios + start);
+ fpparam = (struct lvds_bdb_2_fp_params *)(bios +
bdb_off + lvds2->panels[panel_type].fp_params_offset);
- fptiming = (struct lvds_bdb_2_fp_edid_dtd *)(pI830->VBIOS +
+ fptiming = (struct lvds_bdb_2_fp_edid_dtd *)(bios +
bdb_off + lvds2->panels[panel_type].fp_edid_dtd_offset);
- timing_ptr = pI830->VBIOS + bdb_off +
+ timing_ptr = bios + bdb_off +
lvds2->panels[panel_type].fp_edid_dtd_offset;
if (fpparam->terminator != 0xffff) {
/* Apparently the offsets are wrong for some BIOSes, so we
* try the other offsets if we find a bad terminator.
*/
- fpparam = (struct lvds_bdb_2_fp_params *)(pI830->VBIOS +
+ fpparam = (struct lvds_bdb_2_fp_params *)(bios +
bdb_off + lvds2->panels[panel_type].fp_params_offset + 8);
- fptiming = (struct lvds_bdb_2_fp_edid_dtd *)(pI830->VBIOS +
+ fptiming = (struct lvds_bdb_2_fp_edid_dtd *)(bios +
bdb_off + lvds2->panels[panel_type].fp_edid_dtd_offset + 8);
- timing_ptr = pI830->VBIOS + bdb_off +
+ timing_ptr = bios + bdb_off +
lvds2->panels[panel_type].fp_edid_dtd_offset + 8;
if (fpparam->terminator != 0xffff)
@@ -218,5 +219,6 @@ i830GetLVDSInfoFromBIOS(ScrnInfoPtr pScrn)
}
}
+ xfree(bios);
return found_panel_info;
}
diff --git a/src/i830_driver.c b/src/i830_driver.c
index c3ae8c30..5b98bfd6 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -198,7 +198,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NB_OF(x) (sizeof (x) / sizeof (*x))
/* *INDENT-OFF* */
-static SymTabRec I830BIOSChipsets[] = {
+static SymTabRec I830Chipsets[] = {
{PCI_CHIP_I830_M, "i830"},
{PCI_CHIP_845_G, "845G"},
{PCI_CHIP_I855_GM, "852GM/855GM"},
@@ -211,7 +211,7 @@ static SymTabRec I830BIOSChipsets[] = {
{-1, NULL}
};
-static PciChipsets I830BIOSPciChipsets[] = {
+static PciChipsets I830PciChipsets[] = {
{PCI_CHIP_I830_M, PCI_CHIP_I830_M, RES_SHARED_VGA},
{PCI_CHIP_845_G, PCI_CHIP_845_G, RES_SHARED_VGA},
{PCI_CHIP_I855_GM, PCI_CHIP_I855_GM, RES_SHARED_VGA},
@@ -251,7 +251,7 @@ typedef enum {
OPTION_LINEARALLOC
} I830Opts;
-static OptionInfoRec I830BIOSOptions[] = {
+static OptionInfoRec I830Options[] = {
{OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_CACHE_LINES, "CacheLines", OPTV_INTEGER, {0}, FALSE},
@@ -260,8 +260,6 @@ static OptionInfoRec I830BIOSOptions[] = {
{OPTION_XVIDEO, "XVideo", OPTV_BOOLEAN, {0}, TRUE},
{OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
{OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
- {OPTION_VBE_RESTORE, "VBERestore", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_DEVICE_PRESENCE,"DevicePresence",OPTV_BOOLEAN,{0}, FALSE},
{OPTION_MONITOR_LAYOUT, "MonitorLayout", OPTV_ANYSTR,{0}, FALSE},
{OPTION_CLONE, "Clone", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_CLONE_REFRESH,"CloneRefresh",OPTV_INTEGER, {0}, FALSE},
@@ -285,9 +283,9 @@ static const char *output_type_names[] = {
static void I830DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode, int flags);
static void i830AdjustFrame(int scrnIndex, int x, int y, int flags);
-static Bool I830BIOSCloseScreen(int scrnIndex, ScreenPtr pScreen);
-static Bool I830BIOSSaveScreen(ScreenPtr pScreen, int unblack);
-static Bool I830BIOSEnterVT(int scrnIndex, int flags);
+static Bool I830CloseScreen(int scrnIndex, ScreenPtr pScreen);
+static Bool I830SaveScreen(ScreenPtr pScreen, int unblack);
+static Bool I830EnterVT(int scrnIndex, int flags);
#if 0
static Bool I830VESASetVBEMode(ScrnInfoPtr pScrn, int mode,
VbeCRTCInfoBlock *block);
@@ -325,21 +323,21 @@ I830DPRINTF_stub(const char *filename, int line, const char *function,
}
#endif /* #ifdef I830DEBUG */
-/* XXX Check if this is still needed. */
+/* Export I830 options to i830 driver where necessary */
const OptionInfoRec *
-I830BIOSAvailableOptions(int chipid, int busid)
+I830AvailableOptions(int chipid, int busid)
{
int i;
- for (i = 0; I830BIOSPciChipsets[i].PCIid > 0; i++) {
- if (chipid == I830BIOSPciChipsets[i].PCIid)
- return I830BIOSOptions;
+ for (i = 0; I830PciChipsets[i].PCIid > 0; i++) {
+ if (chipid == I830PciChipsets[i].PCIid)
+ return I830Options;
}
return NULL;
}
static Bool
-I830BIOSGetRec(ScrnInfoPtr pScrn)
+I830GetRec(ScrnInfoPtr pScrn)
{
I830Ptr pI830;
@@ -351,7 +349,7 @@ I830BIOSGetRec(ScrnInfoPtr pScrn)
}
static void
-I830BIOSFreeRec(ScrnInfoPtr pScrn)
+I830FreeRec(ScrnInfoPtr pScrn)
{
I830Ptr pI830;
VESAPtr pVesa;
@@ -398,7 +396,7 @@ I830BIOSFreeRec(ScrnInfoPtr pScrn)
}
static void
-I830BIOSProbeDDC(ScrnInfoPtr pScrn, int index)
+I830ProbeDDC(ScrnInfoPtr pScrn, int index)
{
vbeInfoPtr pVbe;
@@ -514,31 +512,6 @@ GetBIOSVersion(ScrnInfoPtr pScrn, unsigned int *version)
return FALSE;
}
-static Bool
-GetDevicePresence(ScrnInfoPtr pScrn, Bool *required, int *attached,
- int *encoderPresent)
-{
- vbeInfoPtr pVbe = I830PTR(pScrn)->pVbe;
-
- DPRINTF(PFX, "GetDevicePresence\n");
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x5f64;
- pVbe->pInt10->bx = 0x200;
-
- xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn);
- if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) {
- if (required)
- *required = ((pVbe->pInt10->bx & 0x1) == 0);
- if (attached)
- *attached = (pVbe->pInt10->cx >> 8) & 0xff;
- if (encoderPresent)
- *encoderPresent = pVbe->pInt10->cx & 0xff;
- return TRUE;
- } else
- return FALSE;
-}
-
/*
* Returns a string matching the device corresponding to the first bit set
* in "device". savedDevice is then set to device with that bit cleared.
@@ -1091,7 +1064,7 @@ PreInitCleanup(ScrnInfoPtr pScrn)
}
if (pI830->MMIOBase)
I830UnmapMMIO(pScrn);
- I830BIOSFreeRec(pScrn);
+ I830FreeRec(pScrn);
}
Bool
@@ -1133,7 +1106,7 @@ i830SetHotkeyControl(ScrnInfoPtr pScrn, int mode)
}
static Bool
-I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
+I830PreInit(ScrnInfoPtr pScrn, int flags)
{
vgaHWPtr hwp;
I830Ptr pI830;
@@ -1167,7 +1140,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (flags & PROBE_DETECT) {
- I830BIOSProbeDDC(pScrn, pEnt->index);
+ I830ProbeDDC(pScrn, pEnt->index);
return TRUE;
}
@@ -1181,7 +1154,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
/* Allocate driverPrivate */
- if (!I830BIOSGetRec(pScrn))
+ if (!I830GetRec(pScrn))
return FALSE;
pI830 = I830PTR(pScrn);
@@ -1270,9 +1243,9 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
/* Process the options */
xf86CollectOptions(pScrn, NULL);
- if (!(pI830->Options = xalloc(sizeof(I830BIOSOptions))))
+ if (!(pI830->Options = xalloc(sizeof(I830Options))))
return FALSE;
- memcpy(pI830->Options, I830BIOSOptions, sizeof(I830BIOSOptions));
+ memcpy(pI830->Options, I830Options, sizeof(I830Options));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI830->Options);
/* We have to use PIO to probe, because we haven't mapped yet. */
@@ -1361,14 +1334,14 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->chipset = pI830->pEnt->device->chipset;
from = X_CONFIG;
} else if (pI830->pEnt->device->chipID >= 0) {
- pScrn->chipset = (char *)xf86TokenToString(I830BIOSChipsets,
+ pScrn->chipset = (char *)xf86TokenToString(I830Chipsets,
pI830->pEnt->device->chipID);
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
pI830->pEnt->device->chipID);
} else {
from = X_PROBED;
- pScrn->chipset = (char *)xf86TokenToString(I830BIOSChipsets,
+ pScrn->chipset = (char *)xf86TokenToString(I830Chipsets,
pI830->PciInfo->chipType);
}
@@ -1987,30 +1960,6 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
} else
pI830->newPipeSwitch = FALSE;
- pI830->devicePresence = FALSE;
- from = X_DEFAULT;
- if (xf86ReturnOptValBool(pI830->Options, OPTION_DEVICE_PRESENCE, FALSE)) {
- pI830->devicePresence = TRUE;
- from = X_CONFIG;
- }
- xf86DrvMsg(pScrn->scrnIndex, from, "Device Presence: %s.\n",
- pI830->devicePresence ? "enabled" : "disabled");
-
- /* This performs an active detect of the currently attached monitors
- * or, at least it's meant to..... alas it doesn't seem to always work.
- */
- if (pI830->devicePresence) {
- int req=0, att=0, enc=0;
- GetDevicePresence(pScrn, &req, &att, &enc);
- for (i = 0; i < NumDisplayTypes; i++) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Display Presence: %s: attached: %s, encoder: %s\n",
- displayDevices[i],
- BOOLTOSTRING(((1<<i) & att)>>i),
- BOOLTOSTRING(((1<<i) & enc)>>i));
- }
- }
-
PrintDisplayDeviceInfo(pScrn);
if (xf86IsEntityShared(pScrn->entityList[0])) {
@@ -2105,8 +2054,6 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"Maximum space available for video modes: %d kByte\n", memsize);
- pI830->MaxClock = 300000;
-
n = I830ValidateXF86ModeList(pScrn, TRUE);
if (n <= 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
@@ -2319,16 +2266,6 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
pI830->pVbe = NULL;
#endif
- /* Use the VBE mode restore workaround by default. */
- pI830->vbeRestoreWorkaround = TRUE;
- from = X_DEFAULT;
- if (xf86ReturnOptValBool(pI830->Options, OPTION_VBE_RESTORE, FALSE)) {
- pI830->vbeRestoreWorkaround = FALSE;
- from = X_CONFIG;
- }
- xf86DrvMsg(pScrn->scrnIndex, from, "VBE Restore workaround: %s.\n",
- pI830->vbeRestoreWorkaround ? "enabled" : "disabled");
-
#if defined(XF86DRI)
/* Load the dri module if requested. */
if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI, FALSE) &&
@@ -3131,7 +3068,7 @@ I830InitFBManager(
}
static Bool
-I830BIOSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
{
ScrnInfoPtr pScrn;
vgaHWPtr hwp;
@@ -3405,12 +3342,9 @@ I830BIOSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!vgaHWMapMem(pScrn))
return FALSE;
- /* Clear SavedReg */
- memset(&pI830->SavedReg, 0, sizeof(pI830->SavedReg));
-
- DPRINTF(PFX, "assert( if(!I830BIOSEnterVT(scrnIndex, 0)) )\n");
+ DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n");
- if (!I830BIOSEnterVT(scrnIndex, 0))
+ if (!I830EnterVT(scrnIndex, 0))
return FALSE;
DPRINTF(PFX, "assert( if(!fbScreenInit(pScreen, ...) )\n");
@@ -3521,9 +3455,9 @@ I830BIOSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering: Not available\n");
#endif
- pScreen->SaveScreen = I830BIOSSaveScreen;
+ pScreen->SaveScreen = I830SaveScreen;
pI830->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = I830BIOSCloseScreen;
+ pScreen->CloseScreen = I830CloseScreen;
if (pI830->shadowReq.minorversion >= 1) {
/* Rotation */
@@ -3578,43 +3512,15 @@ i830AdjustFrame(int scrnIndex, int x, int y, int flags)
}
static void
-I830BIOSFreeScreen(int scrnIndex, int flags)
+I830FreeScreen(int scrnIndex, int flags)
{
- I830BIOSFreeRec(xf86Screens[scrnIndex]);
+ I830FreeRec(xf86Screens[scrnIndex]);
if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
vgaHWFreeHWRec(xf86Screens[scrnIndex]);
}
-#ifndef SAVERESTORE_HWSTATE
-#define SAVERESTORE_HWSTATE 0
-#endif
-
-#if SAVERESTORE_HWSTATE
-static void
-SaveHWOperatingState(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
- I830RegPtr save = &pI830->SavedReg;
-
- DPRINTF(PFX, "SaveHWOperatingState\n");
-
- return;
-}
-
static void
-RestoreHWOperatingState(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
- I830RegPtr save = &pI830->SavedReg;
-
- DPRINTF(PFX, "RestoreHWOperatingState\n");
-
- return;
-}
-#endif
-
-static void
-I830BIOSLeaveVT(int scrnIndex, int flags)
+I830LeaveVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I830Ptr pI830 = I830PTR(pScrn);
@@ -3655,11 +3561,6 @@ I830BIOSLeaveVT(int scrnIndex, int flags)
}
#endif
-#if SAVERESTORE_HWSTATE
- if (!pI830->closing)
- SaveHWOperatingState(pScrn);
-#endif
-
if (pI830->CursorInfoRec && pI830->CursorInfoRec->HideCursor)
pI830->CursorInfoRec->HideCursor(pScrn);
@@ -3822,7 +3723,7 @@ I830DetectMonitorChange(ScrnInfoPtr pScrn)
* This gets called when gaining control of the VT, and from ScreenInit().
*/
static Bool
-I830BIOSEnterVT(int scrnIndex, int flags)
+I830EnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I830Ptr pI830 = I830PTR(pScrn);
@@ -3874,10 +3775,6 @@ I830BIOSEnterVT(int scrnIndex, int flags)
pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
-#if SAVERESTORE_HWSTATE
- RestoreHWOperatingState(pScrn);
-#endif
-
#ifdef XF86DRI
if (pI830->directRenderingEnabled) {
if (!pI830->starting) {
@@ -3914,7 +3811,7 @@ I830BIOSEnterVT(int scrnIndex, int flags)
}
static Bool
-I830BIOSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+I830SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
@@ -3922,7 +3819,7 @@ I830BIOSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
Bool ret = TRUE;
PixmapPtr pspix = (*pScrn->pScreen->GetScreenPixmap) (pScrn->pScreen);
- DPRINTF(PFX, "I830BIOSSwitchMode: mode == %p\n", mode);
+ DPRINTF(PFX, "I830SwitchMode: mode == %p\n", mode);
#ifdef I830_XV
/* Give the video overlay code a chance to see the new mode. */
@@ -3982,7 +3879,7 @@ I830BIOSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
}
static Bool
-I830BIOSSaveScreen(ScreenPtr pScreen, int mode)
+I830SaveScreen(ScreenPtr pScreen, int mode)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
@@ -3990,7 +3887,7 @@ I830BIOSSaveScreen(ScreenPtr pScreen, int mode)
CARD32 temp, ctrl, base;
int i;
- DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on));
+ DPRINTF(PFX, "I830SaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on));
if (pScrn->vtSema) {
for (i = 0; i < pI830->availablePipes; i++) {
@@ -4114,7 +4011,7 @@ I830DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
}
static Bool
-I830BIOSCloseScreen(int scrnIndex, ScreenPtr pScreen)
+I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I830Ptr pI830 = I830PTR(pScrn);
@@ -4129,7 +4026,7 @@ I830BIOSCloseScreen(int scrnIndex, ScreenPtr pScreen)
#endif
if (pScrn->vtSema == TRUE) {
- I830BIOSLeaveVT(scrnIndex, 0);
+ I830LeaveVT(scrnIndex, 0);
}
if (pI830->devicesTimer)
@@ -4351,13 +4248,13 @@ I830CheckDevicesTimer(OsTimerPtr timer, CARD32 now, pointer arg)
void
I830InitpScrn(ScrnInfoPtr pScrn)
{
- pScrn->PreInit = I830BIOSPreInit;
- pScrn->ScreenInit = I830BIOSScreenInit;
- pScrn->SwitchMode = I830BIOSSwitchMode;
+ pScrn->PreInit = I830PreInit;
+ pScrn->ScreenInit = I830ScreenInit;
+ pScrn->SwitchMode = I830SwitchMode;
pScrn->AdjustFrame = i830AdjustFrame;
- pScrn->EnterVT = I830BIOSEnterVT;
- pScrn->LeaveVT = I830BIOSLeaveVT;
- pScrn->FreeScreen = I830BIOSFreeScreen;
+ pScrn->EnterVT = I830EnterVT;
+ pScrn->LeaveVT = I830LeaveVT;
+ pScrn->FreeScreen = I830FreeScreen;
pScrn->ValidMode = I830ValidMode;
pScrn->PMEvent = I830PMEvent;
}
diff --git a/src/i830_modes.c b/src/i830_modes.c
index 6bff1d0a..f1cdbe1f 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -1025,20 +1025,6 @@ I830ValidateXF86ModeList(ScrnInfoPtr pScrn, Bool first_time)
last->next = pScrn->modes;
pScrn->modes->prev = last;
-#if 0
- /* XXX: do I need this any more? Maybe XF86VidMode uses it?
- * Set up the ClockRanges, which describe what clock ranges are available,
- * and what sort of modes they can be used for.
- */
- clockRanges = xnfcalloc(sizeof(ClockRange), 1);
- clockRanges->next = NULL;
- clockRanges->minClock = 25000;
- clockRanges->maxClock = pI830->MaxClock;
- clockRanges->clockIndex = -1; /* programmable */
- clockRanges->interlaceAllowed = TRUE; /* XXX check this */
- clockRanges->doubleScanAllowed = FALSE; /* XXX check this */
-#endif
-
#if DEBUG_REPROBE
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Modes post revalidate\n");
do {