diff options
author | Dave Airlie <airlied@redhat.com> | 2009-12-07 23:03:47 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-07 23:03:47 -0500 |
commit | 3ff99164f67aae78a2bd2313f65ad55bddb1ffea (patch) | |
tree | d6bba03616d1be6ab9e6d9e92641a6f4047e1e15 /drivers/gpu/drm/i915/intel_tv.c | |
parent | 1bd049fa895f9c6743f38b52ce14775f5a31ea63 (diff) | |
parent | f2b115e69d46344ae7afcaad5823496d2a0d8650 (diff) |
Merge remote branch 'anholt/drm-intel-next' into drm-linus
This merges the upstream Intel tree and fixes up numerous conflicts
due to patches merged into Linus tree later in -rc cycle.
Conflicts:
drivers/char/agp/intel-agp.c
drivers/gpu/drm/drm_dp_i2c_helper.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_suspend.c
Diffstat (limited to 'drivers/gpu/drm/i915/intel_tv.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 9ca917931afb..552ec110b741 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
@@ -1213,20 +1213,17 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
1213 | tv_ctl |= TV_TRILEVEL_SYNC; | 1213 | tv_ctl |= TV_TRILEVEL_SYNC; |
1214 | if (tv_mode->pal_burst) | 1214 | if (tv_mode->pal_burst) |
1215 | tv_ctl |= TV_PAL_BURST; | 1215 | tv_ctl |= TV_PAL_BURST; |
1216 | |||
1216 | scctl1 = 0; | 1217 | scctl1 = 0; |
1217 | /* dda1 implies valid video levels */ | 1218 | if (tv_mode->dda1_inc) |
1218 | if (tv_mode->dda1_inc) { | ||
1219 | scctl1 |= TV_SC_DDA1_EN; | 1219 | scctl1 |= TV_SC_DDA1_EN; |
1220 | } | ||
1221 | |||
1222 | if (tv_mode->dda2_inc) | 1220 | if (tv_mode->dda2_inc) |
1223 | scctl1 |= TV_SC_DDA2_EN; | 1221 | scctl1 |= TV_SC_DDA2_EN; |
1224 | |||
1225 | if (tv_mode->dda3_inc) | 1222 | if (tv_mode->dda3_inc) |
1226 | scctl1 |= TV_SC_DDA3_EN; | 1223 | scctl1 |= TV_SC_DDA3_EN; |
1227 | |||
1228 | scctl1 |= tv_mode->sc_reset; | 1224 | scctl1 |= tv_mode->sc_reset; |
1229 | scctl1 |= video_levels->burst << TV_BURST_LEVEL_SHIFT; | 1225 | if (video_levels) |
1226 | scctl1 |= video_levels->burst << TV_BURST_LEVEL_SHIFT; | ||
1230 | scctl1 |= tv_mode->dda1_inc << TV_SCDDA1_INC_SHIFT; | 1227 | scctl1 |= tv_mode->dda1_inc << TV_SCDDA1_INC_SHIFT; |
1231 | 1228 | ||
1232 | scctl2 = tv_mode->dda2_size << TV_SCDDA2_SIZE_SHIFT | | 1229 | scctl2 = tv_mode->dda2_size << TV_SCDDA2_SIZE_SHIFT | |
@@ -1416,16 +1413,16 @@ intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output) | |||
1416 | * 0 0 0 Component | 1413 | * 0 0 0 Component |
1417 | */ | 1414 | */ |
1418 | if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) { | 1415 | if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) { |
1419 | DRM_DEBUG("Detected Composite TV connection\n"); | 1416 | DRM_DEBUG_KMS("Detected Composite TV connection\n"); |
1420 | type = DRM_MODE_CONNECTOR_Composite; | 1417 | type = DRM_MODE_CONNECTOR_Composite; |
1421 | } else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) { | 1418 | } else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) { |
1422 | DRM_DEBUG("Detected S-Video TV connection\n"); | 1419 | DRM_DEBUG_KMS("Detected S-Video TV connection\n"); |
1423 | type = DRM_MODE_CONNECTOR_SVIDEO; | 1420 | type = DRM_MODE_CONNECTOR_SVIDEO; |
1424 | } else if ((tv_dac & TVDAC_SENSE_MASK) == 0) { | 1421 | } else if ((tv_dac & TVDAC_SENSE_MASK) == 0) { |
1425 | DRM_DEBUG("Detected Component TV connection\n"); | 1422 | DRM_DEBUG_KMS("Detected Component TV connection\n"); |
1426 | type = DRM_MODE_CONNECTOR_Component; | 1423 | type = DRM_MODE_CONNECTOR_Component; |
1427 | } else { | 1424 | } else { |
1428 | DRM_DEBUG("No TV connection detected\n"); | 1425 | DRM_DEBUG_KMS("No TV connection detected\n"); |
1429 | type = -1; | 1426 | type = -1; |
1430 | } | 1427 | } |
1431 | 1428 | ||
@@ -1702,6 +1699,41 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = { | |||
1702 | .destroy = intel_tv_enc_destroy, | 1699 | .destroy = intel_tv_enc_destroy, |
1703 | }; | 1700 | }; |
1704 | 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 | static 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 | } | ||
1705 | 1737 | ||
1706 | void | 1738 | void |
1707 | intel_tv_init(struct drm_device *dev) | 1739 | intel_tv_init(struct drm_device *dev) |
@@ -1717,6 +1749,10 @@ intel_tv_init(struct drm_device *dev) | |||
1717 | 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) |
1718 | return; | 1750 | return; |
1719 | 1751 | ||
1752 | if (!tv_is_present_in_vbt(dev)) { | ||
1753 | DRM_DEBUG_KMS("Integrated TV is not present.\n"); | ||
1754 | return; | ||
1755 | } | ||
1720 | /* 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 */ |
1721 | if (!dev_priv->int_tv_support) | 1757 | if (!dev_priv->int_tv_support) |
1722 | return; | 1758 | return; |