aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-09-12 16:10:11 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-01 01:45:06 -0400
commit554d6af50a40125c28e4e1035527a684d2607266 (patch)
tree6cce74fe1c384111326eeeea014ae95ec654015b /drivers/gpu/drm/i915/intel_bios.c
parent6bf19e7c548d465efa719838754ec3b63ef078d4 (diff)
drm/i915: add some assertions about VBT DDI port types
Our code makes a lot of assumptions regarding what each DDI port actually supports, and the VBT should tell us what is really happening in the hardware. So parse the information provided by the VBT and check if any of our assumptions is wrong. Our driver also has a history of not really trusting the VBT, so a WARN here could mean that: a) our coding assumptions are wrong b) the VBT is wrong c) we're incorrectly parsing the VBT d) the checks are wrong But I really hope we won't ever trigger any of those WARNs. v2: Don't check the redundant "Capabilities" field from byte 24 since it doesn't seem to be used. v3: Rebase v4: Replace WARN with DRM_DEBUG_KMS Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v2) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 12e4fd18076d..7ce1c3c2f0f1 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -590,7 +590,7 @@ 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; 593 bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;
594 uint8_t aux_channel; 594 uint8_t aux_channel;
595 /* 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,
596 * 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
@@ -628,6 +628,28 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
628 628
629 is_dvi = child->common.device_type & (1 << 4); 629 is_dvi = child->common.device_type & (1 << 4);
630 is_dp = child->common.device_type & (1 << 2); 630 is_dp = child->common.device_type & (1 << 2);
631 is_crt = child->common.device_type & (1 << 0);
632 is_hdmi = is_dvi && (child->common.device_type & (1 << 11)) == 0;
633 is_edp = is_dp && (child->common.device_type & (1 << 12));
634
635 DRM_DEBUG_KMS("Port %c VBT info: DP:%d HDMI:%d DVI:%d EDP:%d CRT:%d\n",
636 port_name(port), is_dp, is_hdmi, is_dvi, is_edp, is_crt);
637
638 if (is_edp && is_dvi)
639 DRM_DEBUG_KMS("Internal DP port %c is TMDS compatible\n",
640 port_name(port));
641 if (is_crt && port != PORT_E)
642 DRM_DEBUG_KMS("Port %c is analog\n", port_name(port));
643 if (is_crt && (is_dvi || is_dp))
644 DRM_DEBUG_KMS("Analog port %c is also DP or TMDS compatible\n",
645 port_name(port));
646 if (is_dvi && (port == PORT_A || port == PORT_E))
647 DRM_DEBUG_KMS("Port %c is TMDS compabile\n", port_name(port));
648 if (!is_dvi && !is_dp && !is_crt)
649 DRM_DEBUG_KMS("Port %c is not DP/TMDS/CRT compatible\n",
650 port_name(port));
651 if (is_edp && (port == PORT_B || port == PORT_C || port == PORT_E))
652 DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port));
631 653
632 if (is_dvi) { 654 if (is_dvi) {
633 if (child->common.ddc_pin == 0x05 && port != PORT_B) 655 if (child->common.ddc_pin == 0x05 && port != PORT_B)