summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2011-11-06 12:20:51 -0500
committerKeith Packard <keithp@keithp.com>2011-11-06 16:41:44 -0800
commitf0d50cc6651dce3a8a3cd3fb84210aa92b139763 (patch)
tree8c86a9a40ebfc4ff4e883c2c5808a112a197a245
parent9cc44b955b27de33348d6a20bebc9704930ee18e (diff)
Fix vesa's VBE PanelID interpretation
xserver's VESA driver's VBE (Vesa BIOS Extensions) code includes a PanelID probe, which can get a monitor's native resolution. From this, using CVT formulas, it derives horizontal sync rate and a vertical refresh rate ranges. It however, only derives the upper bounds of the ranges, and the lower bounds cannot de derived. By default, they are set to hardcoded constants which represent the lowest supported resolution: 640x480. The constants in vbe.c however, were not actually derived from forulas, but carried over from other code from the bad old days, and are not relevant to flat panel displays. This caused, for example, EEEPC701's panel, with a native resolution of 800x480, to end up with a upper bound of the horizontal sync rate that was lower than the hardcoded lower bound, which of course broke things. These numbers have been rederived using both my own CVT tool based on xf86CVTMode(), and using the provided 'cvt' tool that comes with xserver. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/vbe/vbe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index 04132d956..06a628457 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -1036,13 +1036,16 @@ VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data)
mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0);
pScrn->monitor->nHsync = 1;
- pScrn->monitor->hsync[0].lo = 31.5;
+ pScrn->monitor->hsync[0].lo = 29.37;
pScrn->monitor->hsync[0].hi = (float)mode->Clock / (float)mode->HTotal;
pScrn->monitor->nVrefresh = 1;
pScrn->monitor->vrefresh[0].lo = 56.0;
pScrn->monitor->vrefresh[0].hi =
(float)mode->Clock*1000.0 / (float)mode->HTotal / (float)mode->VTotal;
+ if (pScrn->monitor->vrefresh[0].hi < 59.47)
+ pScrn->monitor->vrefresh[0].hi = 59.47;
+
free(mode);
}