Commit daf88096 authored by Michel Dänzer's avatar Michel Dänzer Committed by Alex Deucher

drm/amdgpu/dce: 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: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c30c950e
...@@ -69,25 +69,18 @@ void amdgpu_connector_hotplug(struct drm_connector *connector) ...@@ -69,25 +69,18 @@ void amdgpu_connector_hotplug(struct drm_connector *connector)
/* don't do anything if sink is not display port, i.e., /* don't do anything if sink is not display port, i.e.,
* passive dp->(dvi|hdmi) adaptor * passive dp->(dvi|hdmi) adaptor
*/ */
if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT &&
int saved_dpms = connector->dpms; amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd) &&
/* Only turn off the display if it's physically disconnected */ amdgpu_atombios_dp_needs_link_train(amdgpu_connector)) {
if (!amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) { /* Don't start link training before we have the DPCD */
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); if (amdgpu_atombios_dp_get_dpcd(amdgpu_connector))
} else if (amdgpu_atombios_dp_needs_link_train(amdgpu_connector)) { return;
/* Don't try to start link training before we
* have the dpcd */ /* Turn the connector off and back on immediately, which
if (amdgpu_atombios_dp_get_dpcd(amdgpu_connector)) * will trigger link training
return; */
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
/* set it to OFF so that drm_helper_connector_dpms() drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
* 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;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment