Commit d410b56d authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915/dp: Refactor common eDP lid detection

Both gmch and pch detection routines used the exact same routine for
eDP, so de-duplicate.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatar: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 26db63e3
...@@ -3687,21 +3687,25 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) ...@@ -3687,21 +3687,25 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
return connector_status_disconnected; return connector_status_disconnected;
} }
static enum drm_connector_status
edp_detect(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
enum drm_connector_status status;
status = intel_panel_detect(dev);
if (status == connector_status_unknown)
status = connector_status_connected;
return status;
}
static enum drm_connector_status static enum drm_connector_status
ironlake_dp_detect(struct intel_dp *intel_dp) ironlake_dp_detect(struct intel_dp *intel_dp)
{ {
struct drm_device *dev = intel_dp_to_dev(intel_dp); struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
enum drm_connector_status status;
/* Can't disconnect eDP, but you can close the lid... */
if (is_edp(intel_dp)) {
status = intel_panel_detect(dev);
if (status == connector_status_unknown)
status = connector_status_connected;
return status;
}
if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
return connector_status_disconnected; return connector_status_disconnected;
...@@ -3717,16 +3721,6 @@ g4x_dp_detect(struct intel_dp *intel_dp) ...@@ -3717,16 +3721,6 @@ g4x_dp_detect(struct intel_dp *intel_dp)
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
uint32_t bit; uint32_t bit;
/* Can't disconnect eDP, but you can close the lid... */
if (is_edp(intel_dp)) {
enum drm_connector_status status;
status = intel_panel_detect(dev);
if (status == connector_status_unknown)
status = connector_status_connected;
return status;
}
if (IS_VALLEYVIEW(dev)) { if (IS_VALLEYVIEW(dev)) {
switch (intel_dig_port->port) { switch (intel_dig_port->port) {
case PORT_B: case PORT_B:
...@@ -3827,11 +3821,13 @@ intel_dp_detect(struct drm_connector *connector, bool force) ...@@ -3827,11 +3821,13 @@ intel_dp_detect(struct drm_connector *connector, bool force)
intel_dp->has_audio = false; intel_dp->has_audio = false;
if (HAS_PCH_SPLIT(dev)) /* Can't disconnect eDP, but you can close the lid... */
if (is_edp(intel_dp))
status = edp_detect(intel_dp);
else if (HAS_PCH_SPLIT(dev))
status = ironlake_dp_detect(intel_dp); status = ironlake_dp_detect(intel_dp);
else else
status = g4x_dp_detect(intel_dp); status = g4x_dp_detect(intel_dp);
if (status != connector_status_connected) if (status != connector_status_connected)
goto out; goto out;
......
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