diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-02 15:03:59 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-03 06:36:59 -0400 |
commit | d410b56d74bc706f414158cb0149e2a149ee1650 (patch) | |
tree | 54bf36fa9a7befa62f24fa4da101d15aafd1e7bd /drivers | |
parent | 26db63e3cb7af431707cd0467c7bcfefad25aa39 (diff) |
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: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: : Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index d362aa945467..9421cb4badf9 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -3688,20 +3688,24 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) | |||
3688 | } | 3688 | } |
3689 | 3689 | ||
3690 | static enum drm_connector_status | 3690 | static enum drm_connector_status |
3691 | edp_detect(struct intel_dp *intel_dp) | ||
3692 | { | ||
3693 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | ||
3694 | enum drm_connector_status status; | ||
3695 | |||
3696 | status = intel_panel_detect(dev); | ||
3697 | if (status == connector_status_unknown) | ||
3698 | status = connector_status_connected; | ||
3699 | |||
3700 | return status; | ||
3701 | } | ||
3702 | |||
3703 | static enum drm_connector_status | ||
3691 | ironlake_dp_detect(struct intel_dp *intel_dp) | 3704 | ironlake_dp_detect(struct intel_dp *intel_dp) |
3692 | { | 3705 | { |
3693 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | 3706 | struct drm_device *dev = intel_dp_to_dev(intel_dp); |
3694 | struct drm_i915_private *dev_priv = dev->dev_private; | 3707 | struct drm_i915_private *dev_priv = dev->dev_private; |
3695 | struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); | 3708 | struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); |
3696 | enum drm_connector_status status; | ||
3697 | |||
3698 | /* Can't disconnect eDP, but you can close the lid... */ | ||
3699 | if (is_edp(intel_dp)) { | ||
3700 | status = intel_panel_detect(dev); | ||
3701 | if (status == connector_status_unknown) | ||
3702 | status = connector_status_connected; | ||
3703 | return status; | ||
3704 | } | ||
3705 | 3709 | ||
3706 | if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) | 3710 | if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) |
3707 | return connector_status_disconnected; | 3711 | return connector_status_disconnected; |
@@ -3717,16 +3721,6 @@ g4x_dp_detect(struct intel_dp *intel_dp) | |||
3717 | struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); | 3721 | struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); |
3718 | uint32_t bit; | 3722 | uint32_t bit; |
3719 | 3723 | ||
3720 | /* Can't disconnect eDP, but you can close the lid... */ | ||
3721 | if (is_edp(intel_dp)) { | ||
3722 | enum drm_connector_status status; | ||
3723 | |||
3724 | status = intel_panel_detect(dev); | ||
3725 | if (status == connector_status_unknown) | ||
3726 | status = connector_status_connected; | ||
3727 | return status; | ||
3728 | } | ||
3729 | |||
3730 | if (IS_VALLEYVIEW(dev)) { | 3724 | if (IS_VALLEYVIEW(dev)) { |
3731 | switch (intel_dig_port->port) { | 3725 | switch (intel_dig_port->port) { |
3732 | case PORT_B: | 3726 | case PORT_B: |
@@ -3827,11 +3821,13 @@ intel_dp_detect(struct drm_connector *connector, bool force) | |||
3827 | 3821 | ||
3828 | intel_dp->has_audio = false; | 3822 | intel_dp->has_audio = false; |
3829 | 3823 | ||
3830 | if (HAS_PCH_SPLIT(dev)) | 3824 | /* Can't disconnect eDP, but you can close the lid... */ |
3825 | if (is_edp(intel_dp)) | ||
3826 | status = edp_detect(intel_dp); | ||
3827 | else if (HAS_PCH_SPLIT(dev)) | ||
3831 | status = ironlake_dp_detect(intel_dp); | 3828 | status = ironlake_dp_detect(intel_dp); |
3832 | else | 3829 | else |
3833 | status = g4x_dp_detect(intel_dp); | 3830 | status = g4x_dp_detect(intel_dp); |
3834 | |||
3835 | if (status != connector_status_connected) | 3831 | if (status != connector_status_connected) |
3836 | goto out; | 3832 | goto out; |
3837 | 3833 | ||