aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-09-12 16:07:55 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-01 01:45:05 -0400
commit6bf19e7c548d465efa719838754ec3b63ef078d4 (patch)
treebb1864b61219dd901fe1dee76ee9aae4eb207132
parent6acab15a7b0d2722924c5d671cb29974791beece (diff)
drm/i915: check the DDC and AUX bits of the VBT on DDI machines
Our code currently assumes that port X will use the DP AUX channel X and the DDC pin X. The VBT should tell us how things are mapped, so add some WARNs in case we discover our assumptions are wrong (or in case the VBT is just wrong, which is also perfectly possible). Why would someone wire port B to AUX C and DDC D? v2: Rebase v3: Convert WARNs to DRM_DEBUG_KMS Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 2f434297246e..12e4fd18076d 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -590,6 +590,8 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
590 struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port]; 590 struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
591 uint8_t hdmi_level_shift; 591 uint8_t hdmi_level_shift;
592 int i, j; 592 int i, j;
593 bool is_dvi, is_dp;
594 uint8_t aux_channel;
593 /* Each DDI port can have more than one value on the "DVO Port" field, 595 /* Each DDI port can have more than one value on the "DVO Port" field,
594 * so look for all the possible values for each port and abort if more 596 * so look for all the possible values for each port and abort if more
595 * than one is found. */ 597 * than one is found. */
@@ -622,6 +624,31 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
622 if (!child) 624 if (!child)
623 return; 625 return;
624 626
627 aux_channel = child->raw[25];
628
629 is_dvi = child->common.device_type & (1 << 4);
630 is_dp = child->common.device_type & (1 << 2);
631
632 if (is_dvi) {
633 if (child->common.ddc_pin == 0x05 && port != PORT_B)
634 DRM_DEBUG_KMS("Unexpected DDC pin for port B\n");
635 if (child->common.ddc_pin == 0x04 && port != PORT_C)
636 DRM_DEBUG_KMS("Unexpected DDC pin for port C\n");
637 if (child->common.ddc_pin == 0x06 && port != PORT_D)
638 DRM_DEBUG_KMS("Unexpected DDC pin for port D\n");
639 }
640
641 if (is_dp) {
642 if (aux_channel == 0x40 && port != PORT_A)
643 DRM_DEBUG_KMS("Unexpected AUX channel for port A\n");
644 if (aux_channel == 0x10 && port != PORT_B)
645 DRM_DEBUG_KMS("Unexpected AUX channel for port B\n");
646 if (aux_channel == 0x20 && port != PORT_C)
647 DRM_DEBUG_KMS("Unexpected AUX channel for port C\n");
648 if (aux_channel == 0x30 && port != PORT_D)
649 DRM_DEBUG_KMS("Unexpected AUX channel for port D\n");
650 }
651
625 if (bdb->version >= 158) { 652 if (bdb->version >= 158) {
626 /* The VBT HDMI level shift values match the table we have. */ 653 /* The VBT HDMI level shift values match the table we have. */
627 hdmi_level_shift = child->raw[7] & 0xF; 654 hdmi_level_shift = child->raw[7] & 0xF;