From 2d547cd311d29278efcc082cc568aa5db38cd823 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 9 Jul 2011 18:31:18 +0100 Subject: [PATCH] drm/i915/lvds: Allow the user to prefer the VBT mode over the EDID ... because, unbelievably, some biosen are more correct than the EDID *physically* attached to the panel. Adds the module parameter i915.lvds_use_vbt_mode 1: prefer VBT to EDID, if available; 0: [default] prefer EDID to VBT mode, if available -1: ignore the VBT mode Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38718 Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.c | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_lvds.c | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 649278f..6ec4968 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -61,6 +61,9 @@ module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); unsigned int i915_lvds_downclock = 0; module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); +int i915_lvds_use_vbt_mode = 0; +module_param_named(lvds_use_vbt_mode, i915_lvds_use_vbt_mode, int, 0400); + unsigned int i915_panel_use_ssc = 1; module_param_named(lvds_use_ssc, i915_panel_use_ssc, int, 0600); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a9492d9..24034f5 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -995,6 +995,7 @@ extern int i915_panel_ignore_lid; extern unsigned int i915_powersave; extern unsigned int i915_semaphores; extern unsigned int i915_lvds_downclock; +extern int i915_lvds_use_vbt_mode; extern unsigned int i915_panel_use_ssc; extern int i915_vbt_sdvo_panel_type; extern unsigned int i915_enable_rc6; diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index b28f7bd..3d3191c 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -937,6 +937,16 @@ bool intel_lvds_init(struct drm_device *dev) * if closed, act like it's not there for now */ + if (i915_lvds_use_vbt_mode > 0 && dev_priv->lfp_lvds_vbt_mode) { + intel_lvds->fixed_mode = + drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode); + if (intel_lvds->fixed_mode) { + intel_lvds->fixed_mode->type |= + DRM_MODE_TYPE_PREFERRED; + goto out; + } + } + /* * Attempt to get the fixed panel mode from DDC. Assume that the * preferred mode is the right one. @@ -976,7 +986,7 @@ bool intel_lvds_init(struct drm_device *dev) } /* Failed to get EDID, what about VBT? */ - if (dev_priv->lfp_lvds_vbt_mode) { + if (i915_lvds_use_vbt_mode == 0 && dev_priv->lfp_lvds_vbt_mode) { intel_lvds->fixed_mode = drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode); if (intel_lvds->fixed_mode) { -- 1.7.5.4