summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
authorJesse Barnes2009-02-24 00:36:42 +0100
committerDave Airlie2009-02-25 05:10:42 +0100
commit37df96736bfe6f5fd9a141d62946e1083d73e712 (patch)
tree6ea4a8d65929f0ca71379e556a2703577f435a8d /drivers/gpu/drm/i915/intel_bios.c
parentdrm/i915: remove PLL debugging messages (diff)
downloadkernel-qcow2-linux-37df96736bfe6f5fd9a141d62946e1083d73e712.tar.gz
kernel-qcow2-linux-37df96736bfe6f5fd9a141d62946e1083d73e712.tar.xz
kernel-qcow2-linux-37df96736bfe6f5fd9a141d62946e1083d73e712.zip
drm/i915: handle bogus VBT panel timing
We've seen cases in the wild where the VBT sync data is wrong, so add some code to fix it up in that case, taking care to make sure that the total is greater than the sync end. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 65be30dccc77..fc28e2bbd542 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;