aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-29 11:50:25 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-02-01 03:48:36 -0500
commit5a1e5b6c460dccfd189c7e962281c8cce75da728 (patch)
tree81bd8744666a46ac7a69a4c40f22a3fc7d12782c
parent309cfea822413a306a5a4e24c2aa832e8e8217a1 (diff)
drm/i915: Override SDVO panel type in VBT
Judging by comments in the BIOS, if the SDVO LVDS option h40 is enabled, then we are supposed to query the real panel type via Int15. We don't do this and so for the Sony Vaio VGC-JS210J which has otherwise default values, we choose the wrong mode. This patch adds a driver option, i915.vbt_sdvo_panel_type, which can be used to override the value in the VBT. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33691 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c3
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c22
3 files changed, 18 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 211de8e57200..db13d4d46042 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -52,6 +52,9 @@ module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);
52unsigned int i915_panel_use_ssc = 1; 52unsigned int i915_panel_use_ssc = 1;
53module_param_named(lvds_use_ssc, i915_panel_use_ssc, int, 0600); 53module_param_named(lvds_use_ssc, i915_panel_use_ssc, int, 0600);
54 54
55int i915_vbt_sdvo_panel_type = -1;
56module_param_named(vbt_sdvo_panel_type, i915_vbt_sdvo_panel_type, int, 0600);
57
55static bool i915_try_reset = true; 58static bool i915_try_reset = true;
56module_param_named(reset, i915_try_reset, bool, 0600); 59module_param_named(reset, i915_try_reset, bool, 0600);
57 60
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6e1cfa42f421..fb5979774c09 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -962,6 +962,7 @@ extern unsigned int i915_fbpercrtc;
962extern unsigned int i915_powersave; 962extern unsigned int i915_powersave;
963extern unsigned int i915_lvds_downclock; 963extern unsigned int i915_lvds_downclock;
964extern unsigned int i915_panel_use_ssc; 964extern unsigned int i915_panel_use_ssc;
965extern int i915_vbt_sdvo_panel_type;
965 966
966extern int i915_suspend(struct drm_device *dev, pm_message_t state); 967extern int i915_suspend(struct drm_device *dev, pm_message_t state);
967extern int i915_resume(struct drm_device *dev); 968extern int i915_resume(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 35c3b1442ba9..48a0f03b60c3 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -226,29 +226,35 @@ static void
226parse_sdvo_panel_data(struct drm_i915_private *dev_priv, 226parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
227 struct bdb_header *bdb) 227 struct bdb_header *bdb)
228{ 228{
229 struct bdb_sdvo_lvds_options *sdvo_lvds_options;
230 struct lvds_dvo_timing *dvo_timing; 229 struct lvds_dvo_timing *dvo_timing;
231 struct drm_display_mode *panel_fixed_mode; 230 struct drm_display_mode *panel_fixed_mode;
231 int index;
232 232
233 sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS); 233 index = i915_vbt_sdvo_panel_type;
234 if (!sdvo_lvds_options) 234 if (index == -1) {
235 return; 235 struct bdb_sdvo_lvds_options *sdvo_lvds_options;
236
237 sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
238 if (!sdvo_lvds_options)
239 return;
240
241 index = sdvo_lvds_options->panel_type;
242 }
236 243
237 dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS); 244 dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS);
238 if (!dvo_timing) 245 if (!dvo_timing)
239 return; 246 return;
240 247
241 panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); 248 panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
242
243 if (!panel_fixed_mode) 249 if (!panel_fixed_mode)
244 return; 250 return;
245 251
246 fill_detail_timing_data(panel_fixed_mode, 252 fill_detail_timing_data(panel_fixed_mode, dvo_timing + index);
247 dvo_timing + sdvo_lvds_options->panel_type);
248 253
249 dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode; 254 dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode;
250 255
251 return; 256 DRM_DEBUG_KMS("Found SDVO panel mode in BIOS VBT tables:\n");
257 drm_mode_debug_printmodeline(panel_fixed_mode);
252} 258}
253 259
254static int intel_bios_ssc_frequency(struct drm_device *dev, 260static int intel_bios_ssc_frequency(struct drm_device *dev,