Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michel Dänzer and committed by
Alex Deucher
2681bc79 67f19766

+11 -18
+11 -18
drivers/gpu/drm/radeon/radeon_connectors.c
··· 90 90 /* don't do anything if sink is not display port, i.e., 91 91 * passive dp->(dvi|hdmi) adaptor 92 92 */ 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; 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; 103 99 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; 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); 112 105 } 113 106 } 114 107 }