[PATCH VESA] Fix vesa's VBE PanelID interpretation

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed Sep 21 14:29:59 PDT 2011


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 at gmail.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/vbe/vbe.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index 04132d9..06a6284 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);
 }
 
-- 
1.7.6.3



More information about the xorg-devel mailing list