summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-10-01 18:22:14 +0200
committerDave Airlie <airlied@linux.ie>2006-10-04 00:49:31 +1000
commit4921228fb76ec26249aa0f6f0f1ddebf26661b82 (patch)
treeeac5c8a5f05c70f23a5450838a07708c202dc8a7
parent9fa176c7989030e7340cc9b85d0b6a7b34303091 (diff)
Fix radeon vs fbdev pitch calculation.
Fetch the correct displayWidth from fbdevhw after setting the mode. (cherry picked from 145c716de6d42778e447581578f3e4db13c9a653 commit)
-rw-r--r--src/radeon_driver.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 8468c28..14d13b5 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4138,7 +4138,8 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
if (modesFound < 1 && info->FBDev) {
fbdevHWUseBuildinMode(pScrn);
- pScrn->displayWidth = pScrn->virtualX; /* FIXME: might be wrong */
+ pScrn->displayWidth = fbdevHWGetLineLength(pScrn)
+ / info->CurrentLayout.pixel_bytes;
modesFound = 1;
}
@@ -5859,6 +5860,8 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
unsigned char *RADEONMMIO = info->MMIO;
if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE;
+ pScrn->displayWidth = fbdevHWGetLineLength(pScrn)
+ / info->CurrentLayout.pixel_bytes;
RADEONSaveMemMapRegisters(pScrn, &info->ModeReg);
info->fbLocation = (info->ModeReg.mc_fb_location & 0xffff) << 16;
info->ModeReg.surface_cntl = INREG(RADEON_SURFACE_CNTL);
@@ -8835,6 +8838,8 @@ _X_EXPORT Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
RADEONSaveFBDevRegisters(pScrn, &info->ModeReg);
ret = fbdevHWSwitchMode(scrnIndex, mode, flags);
+ pScrn->displayWidth = fbdevHWGetLineLength(pScrn)
+ / info->CurrentLayout.pixel_bytes;
RADEONRestoreFBDevRegisters(pScrn, &info->ModeReg);
} else {