summaryrefslogtreecommitdiff
path: root/unichrome/via_vbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'unichrome/via_vbe.c')
-rw-r--r--unichrome/via_vbe.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/unichrome/via_vbe.c b/unichrome/via_vbe.c
index a286a7a..f50186d 100644
--- a/unichrome/via_vbe.c
+++ b/unichrome/via_vbe.c
@@ -120,7 +120,7 @@ ViaVbeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
VIAPtr pVia;
VbeModeInfoData *data;
int mode;
- int refresh;
+ int refreshRate;
pVia = VIAPTR(pScrn);
@@ -133,12 +133,21 @@ ViaVbeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
/* enable linear addressing */
mode |= 1 << 14;
+ if (data->block) {
+ refreshRate = data->block->RefreshRate ;
+ } else {
+ refreshRate = 6000 ;
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Unable to determine the refresh rate, using %.2f. "
+ "Please check your configuration.\n", refreshRate/100. ) ;
+ }
+
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Trying VBE Mode %dx%d (0x%x) Refresh %.2f:\n",
(int) data->data->XResolution,
(int) data->data->YResolution,
- mode & ~(1 << 11), (float) data->block->RefreshRate/100.);
+ mode & ~(1 << 11), (float) refreshRate/100.);
- ViaVbeSetRefresh(pScrn, data->block->RefreshRate/100);
+ ViaVbeSetRefresh(pScrn, refreshRate/100);
if (VBESetVBEMode(pVia->pVbe, mode, data->block) == FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VBESetVBEMode failed");