aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-07-25 23:01:09 -0400
committerKeith Packard <keithp@keithp.com>2011-07-28 18:47:21 -0400
commit26d61aad7a46115628341e9eb95433f30efef21a (patch)
tree105ffe9a744fc10a3d13b8a03129c4063987a8eb /drivers/gpu/drm/i915
parent92fd8fd13b7570f6a8ba519c4e8ec98f10a86ce9 (diff)
drm/i915: Rename i915_dp_detect_common to intel_dp_get_dpcd
This describes the function better, allowing it to be used where the DPCD value is relevant. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 45db8106ab12..41674e1a26c7 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1567,18 +1567,16 @@ intel_dp_link_down(struct intel_dp *intel_dp)
1567 POSTING_READ(intel_dp->output_reg); 1567 POSTING_READ(intel_dp->output_reg);
1568} 1568}
1569 1569
1570static enum drm_connector_status 1570static bool
1571i915_dp_detect_common(struct intel_dp *intel_dp) 1571intel_dp_get_dpcd(struct intel_dp *intel_dp)
1572{ 1572{
1573 enum drm_connector_status status = connector_status_disconnected;
1574
1575 if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd, 1573 if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
1576 sizeof (intel_dp->dpcd)) && 1574 sizeof (intel_dp->dpcd)) &&
1577 (intel_dp->dpcd[DP_DPCD_REV] != 0)) { 1575 (intel_dp->dpcd[DP_DPCD_REV] != 0)) {
1578 status = connector_status_connected; 1576 return true;
1579 } 1577 }
1580 1578
1581 return status; 1579 return false;
1582} 1580}
1583 1581
1584/* 1582/*
@@ -1603,7 +1601,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
1603 } 1601 }
1604 1602
1605 /* Now read the DPCD to see if it's actually running */ 1603 /* Now read the DPCD to see if it's actually running */
1606 if (i915_dp_detect_common(intel_dp) != connector_status_connected) { 1604 if (!intel_dp_get_dpcd(intel_dp)) {
1607 intel_dp_link_down(intel_dp); 1605 intel_dp_link_down(intel_dp);
1608 return; 1606 return;
1609 } 1607 }
@@ -1617,6 +1615,14 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
1617} 1615}
1618 1616
1619static enum drm_connector_status 1617static enum drm_connector_status
1618intel_dp_detect_dpcd(struct intel_dp *intel_dp)
1619{
1620 if (intel_dp_get_dpcd(intel_dp))
1621 return connector_status_connected;
1622 return connector_status_disconnected;
1623}
1624
1625static enum drm_connector_status
1620ironlake_dp_detect(struct intel_dp *intel_dp) 1626ironlake_dp_detect(struct intel_dp *intel_dp)
1621{ 1627{
1622 enum drm_connector_status status; 1628 enum drm_connector_status status;
@@ -1629,7 +1635,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
1629 return status; 1635 return status;
1630 } 1636 }
1631 1637
1632 return i915_dp_detect_common(intel_dp); 1638 return intel_dp_detect_dpcd(intel_dp);
1633} 1639}
1634 1640
1635static enum drm_connector_status 1641static enum drm_connector_status
@@ -1658,7 +1664,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
1658 if ((temp & bit) == 0) 1664 if ((temp & bit) == 0)
1659 return connector_status_disconnected; 1665 return connector_status_disconnected;
1660 1666
1661 return i915_dp_detect_common(intel_dp); 1667 return intel_dp_detect_dpcd(intel_dp);
1662} 1668}
1663 1669
1664/** 1670/**