diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2009-11-23 20:48:48 -0500 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-11-30 19:54:42 -0500 |
commit | c35614380d5c956bfda20eab2755b2f5a7d6f1e7 (patch) | |
tree | 64cba804c5f30d70823c50faaab9297dd3f0db05 /drivers/gpu/drm/i915/intel_tv.c | |
parent | 7cf4f69d3f4511f443473954456cb91d5514756d (diff) |
drm/i915: Don't set up the TV port if it isn't in the BIOS table.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_tv.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index d7465ca27b97..9325dff21c06 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
@@ -1699,6 +1699,41 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = { | |||
1699 | .destroy = intel_tv_enc_destroy, | 1699 | .destroy = intel_tv_enc_destroy, |
1700 | }; | 1700 | }; |
1701 | 1701 | ||
1702 | /* | ||
1703 | * Enumerate the child dev array parsed from VBT to check whether | ||
1704 | * the integrated TV is present. | ||
1705 | * If it is present, return 1. | ||
1706 | * If it is not present, return false. | ||
1707 | * If no child dev is parsed from VBT, it assumes that the TV is present. | ||
1708 | */ | ||
1709 | int tv_is_present_in_vbt(struct drm_device *dev) | ||
1710 | { | ||
1711 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1712 | struct child_device_config *p_child; | ||
1713 | int i, ret; | ||
1714 | |||
1715 | if (!dev_priv->child_dev_num) | ||
1716 | return 1; | ||
1717 | |||
1718 | ret = 0; | ||
1719 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
1720 | p_child = dev_priv->child_dev + i; | ||
1721 | /* | ||
1722 | * If the device type is not TV, continue. | ||
1723 | */ | ||
1724 | if (p_child->device_type != DEVICE_TYPE_INT_TV && | ||
1725 | p_child->device_type != DEVICE_TYPE_TV) | ||
1726 | continue; | ||
1727 | /* Only when the addin_offset is non-zero, it is regarded | ||
1728 | * as present. | ||
1729 | */ | ||
1730 | if (p_child->addin_offset) { | ||
1731 | ret = 1; | ||
1732 | break; | ||
1733 | } | ||
1734 | } | ||
1735 | return ret; | ||
1736 | } | ||
1702 | 1737 | ||
1703 | void | 1738 | void |
1704 | intel_tv_init(struct drm_device *dev) | 1739 | intel_tv_init(struct drm_device *dev) |
@@ -1714,6 +1749,10 @@ intel_tv_init(struct drm_device *dev) | |||
1714 | if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED) | 1749 | if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED) |
1715 | return; | 1750 | return; |
1716 | 1751 | ||
1752 | if (!tv_is_present_in_vbt(dev)) { | ||
1753 | DRM_DEBUG_KMS("Integrated TV is not present.\n"); | ||
1754 | return; | ||
1755 | } | ||
1717 | /* Even if we have an encoder we may not have a connector */ | 1756 | /* Even if we have an encoder we may not have a connector */ |
1718 | if (!dev_priv->int_tv_support) | 1757 | if (!dev_priv->int_tv_support) |
1719 | return; | 1758 | return; |