aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-07-20 18:44:45 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-18 10:46:19 -0400
commitf899fc64cda8569d0529452aafc0da31c042df2e (patch)
tree61b6d32abe3524b83abc9d8b9382e3f82225cd64 /drivers/gpu/drm/i915/intel_bios.c
parent373a3cf744c774478f44921c50011b896ab08f9d (diff)
drm/i915: use GMBUS to manage i2c links
Use the GMBUS interface rather than direct bit banging to grab the EDID over DDC (and for other forms of auxiliary communication with external display controllers). The hope is that this method will be much faster and more reliable than bit banging for fetching EDIDs from buggy monitors or through switches, though we still preserve the bit banging as a fallback in case GMBUS fails. Based on an original patch by Jesse Barnes. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 8986a4b898db..d11bbcad4fea 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -291,14 +291,6 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
291 struct bdb_header *bdb) 291 struct bdb_header *bdb)
292{ 292{
293 struct bdb_general_definitions *general; 293 struct bdb_general_definitions *general;
294 const int crt_bus_map_table[] = {
295 GPIOB,
296 GPIOA,
297 GPIOC,
298 GPIOD,
299 GPIOE,
300 GPIOF,
301 };
302 294
303 general = find_section(bdb, BDB_GENERAL_DEFINITIONS); 295 general = find_section(bdb, BDB_GENERAL_DEFINITIONS);
304 if (general) { 296 if (general) {
@@ -306,10 +298,8 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
306 if (block_size >= sizeof(*general)) { 298 if (block_size >= sizeof(*general)) {
307 int bus_pin = general->crt_ddc_gmbus_pin; 299 int bus_pin = general->crt_ddc_gmbus_pin;
308 DRM_DEBUG_KMS("crt_ddc_bus_pin: %d\n", bus_pin); 300 DRM_DEBUG_KMS("crt_ddc_bus_pin: %d\n", bus_pin);
309 if ((bus_pin >= 1) && (bus_pin <= 6)) { 301 if (bus_pin >= 1 && bus_pin <= 6)
310 dev_priv->crt_ddc_bus = 302 dev_priv->crt_ddc_pin = bus_pin - 1;
311 crt_bus_map_table[bus_pin-1];
312 }
313 } else { 303 } else {
314 DRM_DEBUG_KMS("BDB_GD too small (%d). Invalid.\n", 304 DRM_DEBUG_KMS("BDB_GD too small (%d). Invalid.\n",
315 block_size); 305 block_size);
@@ -533,6 +523,8 @@ intel_init_bios(struct drm_device *dev)
533 struct bdb_header *bdb = NULL; 523 struct bdb_header *bdb = NULL;
534 u8 __iomem *bios = NULL; 524 u8 __iomem *bios = NULL;
535 525
526 dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC;
527
536 /* XXX Should this validation be moved to intel_opregion.c? */ 528 /* XXX Should this validation be moved to intel_opregion.c? */
537 if (dev_priv->opregion.vbt) { 529 if (dev_priv->opregion.vbt) {
538 struct vbt_header *vbt = dev_priv->opregion.vbt; 530 struct vbt_header *vbt = dev_priv->opregion.vbt;