From 37af092a3f49e154345cae563ff4735609dcce39 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 18 Apr 2012 10:03:15 -0400 Subject: [PATCH] drm/radeon/kms: fix DP re-plug (v2) We want to use the DPMS paths to re-program the display hw, but don't actually want to change the DPMS state. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=46711 v2: do a full dpms cycle on re-plug Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_connectors.c | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index aa8268d..d58c613 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -64,14 +64,21 @@ void radeon_connector_hotplug(struct drm_connector *connector) /* just deal with DP (not eDP) here. */ if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { - int saved_dpms = connector->dpms; - /* Only turn off the display it it's physically disconnected */ - if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) + if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); + /* save the dpms state since we don't actually want to change it, + * we just want to use the dpms code pathes to turn the reprogram + * the display hw. + */ + connector->dpms = DRM_MODE_DPMS_ON; + } else if (radeon_dp_needs_link_train(radeon_connector)) { + /* unplugging sometimes leaves the pipe in a bad state, so + * do a full dpms cycle + */ drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); - else if (radeon_dp_needs_link_train(radeon_connector)) drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); - connector->dpms = saved_dpms; + } } } -- 1.7.7.5