]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/radeon: on hotplug force link training to happen (v2)
authorJerome Glisse <jglisse@redhat.com>
Thu, 19 Jul 2012 21:25:55 +0000 (17:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:27:50 +0000 (08:27 -0700)
commit ca2ccde5e2f24a792caa4cca919fc5c6f65d1887 upstream.

To have DP behave like VGA/DVI we need to retrain the link
on hotplug. For this to happen we need to force link
training to happen by setting connector dpms to off
before asking it turning it on again.

v2: agd5f
- drop the dp_get_link_status() change in atombios_dp.c
  for now.  We still need the dpms OFF change.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_connectors.c

index ea6f60fc188dabe2957a24935a0cd223e7411a0d..f1a1e8aa4dad6b5bb6581463018d74fe7966bcff 100644 (file)
@@ -81,10 +81,16 @@ void radeon_connector_hotplug(struct drm_connector *connector)
                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))
+                       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))
+                       } else if (radeon_dp_needs_link_train(radeon_connector)) {
+                               /* 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;
                }
        }