drm/radeon: Don't turn off DP sink when disconnected
Subsystems (2)
PATCH 1/1 drm/radeon: Don't turn off DP sink when disconnected
From: Michel Dänzer <[email protected]>
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
--- drivers/gpu/drm/radeon/radeon_connectors.c | 31 ++++++++++++------------------ 1 file changed, 12 insertions(+), 19 deletions(-)
drivers/gpu/drm/radeon/radeon_connectors.c +12 -19
@@ -90,25 +90,18 @@ void radeon_connector_hotplug(struct drm_connector *connector)/* don't do anything if sink is not display port, i.e., * passive dp->(dvi|hdmi) adaptor */ -if (dig_connector->dp_sink_type ==CONNECTOR_OBJECT_ID_DISPLAYPORT ) { -int saved_dpms = connector->dpms; -/* Only turn off the display if it's physically disconnected */ -if (!radeon_hpd_sense (rdev, radeon_connector->hpd.hpd)) { -drm_helper_connector_dpms (connector,DRM_MODE_DPMS_OFF ); - }else if (radeon_dp_needs_link_train (radeon_connector)) { -/* Don't try to start link training before we -* have the dpcd */ -if (!radeon_dp_getdpcd (radeon_connector)) -return ; - -/* set it to OFF so that drm_helper_connector_dpms() -* won't return immediately since the current state -* is ON at this point. -*/ - connector->dpms =DRM_MODE_DPMS_OFF ; -drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); - } - connector->dpms = saved_dpms; +if (dig_connector->dp_sink_type ==CONNECTOR_OBJECT_ID_DISPLAYPORT && +radeon_hpd_sense (rdev, radeon_connector->hpd.hpd) && +radeon_dp_needs_link_train (radeon_connector)) { +/* Don't start link training before we have the DPCD */ +if (!radeon_dp_getdpcd (radeon_connector)) +return ; + +/* Turn the connector off and back on immediately, which +* will trigger link training +*/ +drm_helper_connector_dpms (connector,DRM_MODE_DPMS_OFF ); +drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); } } }
Signature · 6 lines
2.16.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180314171513.2476-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
Alex Deucher
Reviewed-byQuoted 11 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
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
Signed-off-by Michel Dänzer <[email protected]>
Quoted 49 lines
--- drivers/gpu/drm/radeon/radeon_connectors.c | 31 ++++++++++++------------------ 1 file changed, 12 insertions(+), 19 deletions(-)drivers/gpu/drm/radeon/radeon_connectors.c +12
-20@@ -90,25 +90,18 @@ void radeon_connector_hotplug(struct drm_connector *connector)/* don't do anything if sink is not display port, i.e., * passive dp->(dvi|hdmi) adaptor */ -if (dig_connector->dp_sink_type ==CONNECTOR_OBJECT_ID_DISPLAYPORT ) { -int saved_dpms = connector->dpms; -/* Only turn off the display if it's physically disconnected */ -if (!radeon_hpd_sense (rdev, radeon_connector->hpd.hpd)) { -drm_helper_connector_dpms (connector,DRM_MODE_DPMS_OFF ); - }else if (radeon_dp_needs_link_train (radeon_connector)) { -/* Don't try to start link training before we -* have the dpcd */ -if (!radeon_dp_getdpcd (radeon_connector)) -return ; - -/* set it to OFF so that drm_helper_connector_dpms() -* won't return immediately since the current state -* is ON at this point. -*/ - connector->dpms =DRM_MODE_DPMS_OFF ; -drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); - } - connector->dpms = saved_dpms; +if (dig_connector->dp_sink_type ==CONNECTOR_OBJECT_ID_DISPLAYPORT && +radeon_hpd_sense (rdev, radeon_connector->hpd.hpd) && +radeon_dp_needs_link_train (radeon_connector)) { +/* Don't start link training before we have the DPCD */ +if (!radeon_dp_getdpcd (radeon_connector)) +return ; + +/* Turn the connector off and back on immediately, which +* will trigger link training +*/ +drm_helper_connector_dpms (connector,DRM_MODE_DPMS_OFF ); +drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); } } } --2.16.2
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx