diff options
author | Jerome Glisse <jglisse@redhat.com> | 2012-07-19 17:15:56 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-07-25 00:14:07 -0400 |
commit | 266dcba541a1ef7e5d82d9e67c67fde2910636e8 (patch) | |
tree | 8a46a5b8e6c94f0c22f1edf5d5db30688353e70a | |
parent | 8d1c702aa0b2c4b22b0742b72a1149d91690674b (diff) |
drm/radeon: fix hotplug of DP to DVI|HDMI passive adapters (v2)
No need to retrain the link for passive adapters.
v2: agd5f
- no passive DP to VGA adapters, update comments
- assign radeon_connector_atom_dig after we are sure
we have a digital connector as analog connectors
have different private data.
- get new sink type before checking for retrain. No
need to check if it's no longer a DP connection.
Cc: <stable@vger.kernel.org>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 2914c5761cfc..3524f17e3f05 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -64,14 +64,27 @@ void radeon_connector_hotplug(struct drm_connector *connector) | |||
64 | 64 | ||
65 | /* just deal with DP (not eDP) here. */ | 65 | /* just deal with DP (not eDP) here. */ |
66 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { | 66 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { |
67 | int saved_dpms = connector->dpms; | 67 | struct radeon_connector_atom_dig *dig_connector = |
68 | 68 | radeon_connector->con_priv; | |
69 | /* Only turn off the display it it's physically disconnected */ | 69 | |
70 | if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | 70 | /* if existing sink type was not DP no need to retrain */ |
71 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); | 71 | if (dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) |
72 | else if (radeon_dp_needs_link_train(radeon_connector)) | 72 | return; |
73 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); | 73 | |
74 | connector->dpms = saved_dpms; | 74 | /* first get sink type as it may be reset after (un)plug */ |
75 | dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); | ||
76 | /* don't do anything if sink is not display port, i.e., | ||
77 | * passive dp->(dvi|hdmi) adaptor | ||
78 | */ | ||
79 | if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { | ||
80 | int saved_dpms = connector->dpms; | ||
81 | /* Only turn off the display if it's physically disconnected */ | ||
82 | if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | ||
83 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); | ||
84 | else if (radeon_dp_needs_link_train(radeon_connector)) | ||
85 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); | ||
86 | connector->dpms = saved_dpms; | ||
87 | } | ||
75 | } | 88 | } |
76 | } | 89 | } |
77 | 90 | ||