[Intel-gfx] [PATCH] fixup bogus VBT modes in intel_bios.c

Jesse Barnes jbarnes at virtuousgeek.org
Tue Feb 3 20:56:57 CET 2009


Several VBT modes out in the wild have H or VSyncEnd values greater than
the H or VTotal value.  This clearly ends up creating a bad mode,
causing some panels to either ignore the timing or display some sort of
corrupt image.

Check for these cases and fix them up by default, making things work for
several Dell and Sony machines.

Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 4ca82a0..f42e2ff 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -111,6 +111,12 @@ parse_panel_data(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 	panel_fixed_mode->clock = dvo_timing->clock * 10;
 	panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
 
+	/* Some VBTs have bogus h/vtotal values */
+	if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
+		panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
+	if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
+		panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
+
 	drm_mode_set_name(panel_fixed_mode);
 
 	dev_priv->vbt_mode = panel_fixed_mode;



More information about the Intel-gfx mailing list