summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2011-11-06 12:20:51 -0500
committerJeremy Huddleston <jeremyhu@apple.com>2011-11-24 12:15:00 -0800
commite2661ddbc5d1b2edb1ab514a761f8c0b66e69736 (patch)
treea0d2ee12fc9be2ec602fa467cc24f8712eca9023
parent2e3406fc6737539210e29ac0b2821848e6d1f069 (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> (cherry picked from commit f0d50cc6651dce3a8a3cd3fb84210aa92b139763)
-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);
}