Commit 7183dc29 authored by Jesse Barnes's avatar Jesse Barnes Committed by Keith Packard

drm/i915/dp: use DP DPCD defines when looking at DPCD values

Makes it easier to search for DP related constants.
Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent 61da5fab
...@@ -138,8 +138,8 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp) ...@@ -138,8 +138,8 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp)
{ {
int max_lane_count = 4; int max_lane_count = 4;
if (intel_dp->dpcd[0] >= 0x11) { if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) {
max_lane_count = intel_dp->dpcd[2] & 0x1f; max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f;
switch (max_lane_count) { switch (max_lane_count) {
case 1: case 2: case 4: case 1: case 2: case 4:
break; break;
...@@ -153,7 +153,7 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp) ...@@ -153,7 +153,7 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp)
static int static int
intel_dp_max_link_bw(struct intel_dp *intel_dp) intel_dp_max_link_bw(struct intel_dp *intel_dp)
{ {
int max_link_bw = intel_dp->dpcd[1]; int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
switch (max_link_bw) { switch (max_link_bw) {
case DP_LINK_BW_1_62: case DP_LINK_BW_1_62:
...@@ -774,7 +774,8 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, ...@@ -774,7 +774,8 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
/* /*
* Check for DPCD version > 1.1 and enhanced framing support * Check for DPCD version > 1.1 and enhanced framing support
*/ */
if (intel_dp->dpcd[0] >= 0x11 && (intel_dp->dpcd[2] & DP_ENHANCED_FRAME_CAP)) { if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
(intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) {
intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
intel_dp->DP |= DP_ENHANCED_FRAMING; intel_dp->DP |= DP_ENHANCED_FRAMING;
} }
...@@ -1553,7 +1554,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp) ...@@ -1553,7 +1554,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
0x000, intel_dp->dpcd, 0x000, intel_dp->dpcd,
sizeof (intel_dp->dpcd)) sizeof (intel_dp->dpcd))
== sizeof(intel_dp->dpcd)) { == sizeof(intel_dp->dpcd)) {
if (intel_dp->dpcd[0] != 0) if (intel_dp->dpcd[DP_DPCD_REV] != 0)
status = connector_status_connected; status = connector_status_connected;
} }
DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0], 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,7 +1593,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd,
sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd))
{ {
if (intel_dp->dpcd[0] != 0) if (intel_dp->dpcd[DP_DPCD_REV] != 0)
status = connector_status_connected; status = connector_status_connected;
} }
...@@ -1960,8 +1961,9 @@ intel_dp_init(struct drm_device *dev, int output_reg) ...@@ -1960,8 +1961,9 @@ intel_dp_init(struct drm_device *dev, int output_reg)
sizeof(intel_dp->dpcd)); sizeof(intel_dp->dpcd));
ironlake_edp_panel_vdd_off(intel_dp); ironlake_edp_panel_vdd_off(intel_dp);
if (ret == sizeof(intel_dp->dpcd)) { if (ret == sizeof(intel_dp->dpcd)) {
if (intel_dp->dpcd[0] >= 0x11) if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
dev_priv->no_aux_handshake = intel_dp->dpcd[3] & dev_priv->no_aux_handshake =
intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
DP_NO_AUX_HANDSHAKE_LINK_TRAINING; DP_NO_AUX_HANDSHAKE_LINK_TRAINING;
} else { } else {
/* if this fails, presume the device is a ghost */ /* if this fails, presume the device is a ghost */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment