Skip to content

Commit 2681bc7

Browse files
Michel Dänzeralexdeucher
authored andcommitted
drm/radeon: Don't turn off DP sink when disconnected
Turning off the sink in this case causes various issues, because userspace expects it to stay on until it turns it off explicitly. Instead, turn the sink off and back on when a display is connected again. This dance seems necessary for link training to work correctly. Bugzilla: https://bugs.freedesktop.org/105308 Cc: [email protected] Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 67f1976 commit 2681bc7

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

drivers/gpu/drm/radeon/radeon_connectors.c

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,18 @@ void radeon_connector_hotplug(struct drm_connector *connector)
9090
/* don't do anything if sink is not display port, i.e.,
9191
* passive dp->(dvi|hdmi) adaptor
9292
*/
93-
if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
94-
int saved_dpms = connector->dpms;
95-
/* Only turn off the display if it's physically disconnected */
96-
if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
97-
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
98-
} else if (radeon_dp_needs_link_train(radeon_connector)) {
99-
/* Don't try to start link training before we
100-
* have the dpcd */
101-
if (!radeon_dp_getdpcd(radeon_connector))
102-
return;
103-
104-
/* set it to OFF so that drm_helper_connector_dpms()
105-
* won't return immediately since the current state
106-
* is ON at this point.
107-
*/
108-
connector->dpms = DRM_MODE_DPMS_OFF;
109-
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
110-
}
111-
connector->dpms = saved_dpms;
93+
if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT &&
94+
radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) &&
95+
radeon_dp_needs_link_train(radeon_connector)) {
96+
/* Don't start link training before we have the DPCD */
97+
if (!radeon_dp_getdpcd(radeon_connector))
98+
return;
99+
100+
/* Turn the connector off and back on immediately, which
101+
* will trigger link training
102+
*/
103+
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
104+
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
112105
}
113106
}
114107
}

0 commit comments

Comments
 (0)