summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index dc28c50f..e3027a67 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2841,13 +2841,30 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
xf86PruneDriverModes(pScrn);
- pScrn->currentMode = pScrn->modes;
-
if (pScrn->modes == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n");
PreInitCleanup(pScrn);
return FALSE;
}
+
+ /* Now we check the VESA BIOS's displayWidth and reset if necessary */
+ p = pScrn->modes;
+ do {
+ VbeModeInfoData *data = (VbeModeInfoData *) p->Private;
+ VbeModeInfoBlock *modeInfo;
+
+ /* Get BytesPerScanline so we can reset displayWidth */
+ if ((modeInfo = VBEGetModeInfo(pI830->pVbe, data->mode))) {
+ if (pScrn->displayWidth < modeInfo->BytesPerScanline / pI830->cpp) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Correcting stride (%d -> %d)\n", pScrn->displayWidth, modeInfo->BytesPerScanline);
+ pScrn->displayWidth = modeInfo->BytesPerScanline / pI830->cpp;
+ }
+ }
+ p = p->next;
+ } while (p != NULL && p != pScrn->modes);
+
+ pScrn->currentMode = pScrn->modes;
+
#ifndef USE_PITCHES
#define USE_PITCHES 1
#endif