aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-07-07 14:10:58 -0400
committerKeith Packard <keithp@keithp.com>2011-07-07 16:38:36 -0400
commit7183dc2912510cf005fcc59239f8d153ef51d3f0 (patch)
treea5a648abff6514d14e399b1a1c99ad3ffe6bb5cc
parent61da5fab5a9b129cf05b1fe4666c3e45b3103fd4 (diff)
drm/i915/dp: use DP DPCD defines when looking at DPCD values
Makes it easier to search for DP related constants. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 86912bd737ad..fc51730b89d6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -138,8 +138,8 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp)
138{ 138{
139 int max_lane_count = 4; 139 int max_lane_count = 4;
140 140
141 if (intel_dp->dpcd[0] >= 0x11) { 141 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) {
142 max_lane_count = intel_dp->dpcd[2] & 0x1f; 142 max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f;
143 switch (max_lane_count) { 143 switch (max_lane_count) {
144 case 1: case 2: case 4: 144 case 1: case 2: case 4:
145 break; 145 break;
@@ -153,7 +153,7 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp)
153static int 153static int
154intel_dp_max_link_bw(struct intel_dp *intel_dp) 154intel_dp_max_link_bw(struct intel_dp *intel_dp)
155{ 155{
156 int max_link_bw = intel_dp->dpcd[1]; 156 int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
157 157
158 switch (max_link_bw) { 158 switch (max_link_bw) {
159 case DP_LINK_BW_1_62: 159 case DP_LINK_BW_1_62:
@@ -774,7 +774,8 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
774 /* 774 /*
775 * Check for DPCD version > 1.1 and enhanced framing support 775 * Check for DPCD version > 1.1 and enhanced framing support
776 */ 776 */
777 if (intel_dp->dpcd[0] >= 0x11 && (intel_dp->dpcd[2] & DP_ENHANCED_FRAME_CAP)) { 777 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
778 (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) {
778 intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; 779 intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
779 intel_dp->DP |= DP_ENHANCED_FRAMING; 780 intel_dp->DP |= DP_ENHANCED_FRAMING;
780 } 781 }
@@ -1553,7 +1554,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
1553 0x000, intel_dp->dpcd, 1554 0x000, intel_dp->dpcd,
1554 sizeof (intel_dp->dpcd)) 1555 sizeof (intel_dp->dpcd))
1555 == sizeof(intel_dp->dpcd)) { 1556 == sizeof(intel_dp->dpcd)) {
1556 if (intel_dp->dpcd[0] != 0) 1557 if (intel_dp->dpcd[DP_DPCD_REV] != 0)
1557 status = connector_status_connected; 1558 status = connector_status_connected;
1558 } 1559 }
1559 DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0], 1560 DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0],
@@ -1592,7 +1593,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
1592 if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, 1593 if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd,
1593 sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) 1594 sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd))
1594 { 1595 {
1595 if (intel_dp->dpcd[0] != 0) 1596 if (intel_dp->dpcd[DP_DPCD_REV] != 0)
1596 status = connector_status_connected; 1597 status = connector_status_connected;
1597 } 1598 }
1598 1599
@@ -1960,8 +1961,9 @@ intel_dp_init(struct drm_device *dev, int output_reg)
1960 sizeof(intel_dp->dpcd)); 1961 sizeof(intel_dp->dpcd));
1961 ironlake_edp_panel_vdd_off(intel_dp); 1962 ironlake_edp_panel_vdd_off(intel_dp);
1962 if (ret == sizeof(intel_dp->dpcd)) { 1963 if (ret == sizeof(intel_dp->dpcd)) {
1963 if (intel_dp->dpcd[0] >= 0x11) 1964 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
1964 dev_priv->no_aux_handshake = intel_dp->dpcd[3] & 1965 dev_priv->no_aux_handshake =
1966 intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
1965 DP_NO_AUX_HANDSHAKE_LINK_TRAINING; 1967 DP_NO_AUX_HANDSHAKE_LINK_TRAINING;
1966 } else { 1968 } else {
1967 /* if this fails, presume the device is a ghost */ 1969 /* if this fails, presume the device is a ghost */