Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345075
b: refs/heads/master
c: 07d3dc1
h: refs/heads/master
i:
  345073: 2ac6247
  345071: 73019a1
v: v3
  • Loading branch information
Adam Jackson authored and Daniel Vetter committed Sep 26, 2012
1 parent bf7ffd9 commit 635e95e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b091cd928dfa81e8c28b9707899201358b4e50b5
refs/heads/master: 07d3dc18396790d9d394f4f0717a91b3a845c758
35 changes: 34 additions & 1 deletion trunk/drivers/gpu/drm/i915/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2083,11 +2083,44 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
}
}

/* XXX this is probably wrong for multiple downstream ports */
static enum drm_connector_status
intel_dp_detect_dpcd(struct intel_dp *intel_dp)
{
if (intel_dp_get_dpcd(intel_dp))
uint8_t *dpcd = intel_dp->dpcd;
bool hpd;
uint8_t type;

if (!intel_dp_get_dpcd(intel_dp))
return connector_status_disconnected;

/* if there's no downstream port, we're done */
if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
return connector_status_connected;

/* If we're HPD-aware, SINK_COUNT changes dynamically */
hpd = !!(intel_dp->downstream_ports[0] & DP_DS_PORT_HPD);
if (hpd) {
uint8_t sink_count;
if (!intel_dp_aux_native_read_retry(intel_dp, DP_SINK_COUNT,
&sink_count, 1))
return connector_status_unknown;
sink_count &= DP_SINK_COUNT_MASK;
return sink_count ? connector_status_connected
: connector_status_disconnected;
}

/* If no HPD, poke DDC gently */
if (drm_probe_ddc(&intel_dp->adapter))
return connector_status_connected;

/* Well we tried, say unknown for unreliable port types */
type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK;
if (type == DP_DS_PORT_TYPE_VGA || type == DP_DS_PORT_TYPE_NON_EDID)
return connector_status_unknown;

/* Anything else is out of spec, warn and ignore */
DRM_DEBUG_KMS("Broken DP branch device, ignoring\n");
return connector_status_disconnected;
}

Expand Down

0 comments on commit 635e95e

Please sign in to comment.