summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2005-04-01 14:17:24 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2005-04-01 14:17:24 +0000
commite637630908f40f42367c94344d44918b6cdb0eb2 (patch)
tree3fab43efba72d251c8144e8137ee6d1652ea3998 /src
parent5090c8ba6778091aa4ce24b16b058d534ba78dc7 (diff)
Check the VESA BIOS scanline requirements and adjust the displayWidthXORG-6_8_99_2XORG-6_8_99_1
accordingly. Fixes an assumption that the screen width was always used as the displayWidth.
Diffstat (limited to 'src')
-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