The patch below does not apply to the 4.16-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to stable@vger.kernel.org.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From daf8809626c0ee7a152f9c34058fc3b43385dd51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= michel.daenzer@amd.com Date: Fri, 9 Mar 2018 18:26:18 +0100 Subject: [PATCH] drm/amdgpu/dce: Don't turn off DP sink when disconnected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
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
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index ffc1f6f46913..9da8d5802980 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -69,25 +69,18 @@ void amdgpu_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 (!amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) { - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); - } else if (amdgpu_atombios_dp_needs_link_train(amdgpu_connector)) { - /* Don't try to start link training before we - * have the dpcd */ - if (amdgpu_atombios_dp_get_dpcd(amdgpu_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 && + amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd) && + amdgpu_atombios_dp_needs_link_train(amdgpu_connector)) { + /* Don't start link training before we have the DPCD */ + if (amdgpu_atombios_dp_get_dpcd(amdgpu_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); } } }
Hi Greg,
On 2018-04-22 10:13 AM, gregkh@linuxfoundation.org wrote:
The patch below does not apply to the 4.16-stable tree.
This commit, and the corresponding commit a3f73c8cf43858455a979d0f8354815e1443c496 ("drm/radeon: Don't turn off DP sink when disconnected"), do not apply to the 4.16 stable tree because they were already merged as fixes in the 4.16 development cycle. Please backport them to older stable trees.
Thanks,
------------------ original commit in Linus's tree ------------------
From daf8809626c0ee7a152f9c34058fc3b43385dd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= michel.daenzer@amd.com Date: Fri, 9 Mar 2018 18:26:18 +0100 Subject: [PATCH] drm/amdgpu/dce: Don't turn off DP sink when disconnected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
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
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index ffc1f6f46913..9da8d5802980 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -69,25 +69,18 @@ void amdgpu_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 (!amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) {
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
} else if (amdgpu_atombios_dp_needs_link_train(amdgpu_connector)) {
/* Don't try to start link training before we
* have the dpcd */
if (amdgpu_atombios_dp_get_dpcd(amdgpu_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 &&
amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd) &&
amdgpu_atombios_dp_needs_link_train(amdgpu_connector)) {
/* Don't start link training before we have the DPCD */
if (amdgpu_atombios_dp_get_dpcd(amdgpu_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);
}
On Tue, Apr 24, 2018 at 09:46:42AM +0200, Michel Dänzer wrote:
Hi Greg,
On 2018-04-22 10:13 AM, gregkh@linuxfoundation.org wrote:
The patch below does not apply to the 4.16-stable tree.
This commit, and the corresponding commit a3f73c8cf43858455a979d0f8354815e1443c496 ("drm/radeon: Don't turn off DP sink when disconnected"), do not apply to the 4.16 stable tree because they were already merged as fixes in the 4.16 development cycle. Please backport them to older stable trees.
To what older stable trees specifically? I tried to apply them to other ones, but they all seem to fail :(
thanks,
greg k-h
On 2018-04-24 12:10 PM, Greg KH wrote:
On Tue, Apr 24, 2018 at 09:46:42AM +0200, Michel Dänzer wrote:
Hi Greg,
On 2018-04-22 10:13 AM, gregkh@linuxfoundation.org wrote:
The patch below does not apply to the 4.16-stable tree.
This commit, and the corresponding commit a3f73c8cf43858455a979d0f8354815e1443c496 ("drm/radeon: Don't turn off DP sink when disconnected"), do not apply to the 4.16 stable tree because they were already merged as fixes in the 4.16 development cycle. Please backport them to older stable trees.
To what older stable trees specifically? I tried to apply them to other ones, but they all seem to fail :(
Looks like the fixes have already been backported from 4.16-rc to all applicable stable trees, so there's nothing to do or worry about. :)
Sorry for the noise, thanks
linux-stable-mirror@lists.linaro.org