[PATCH] drm/radeon: on hotplug force link training to happen

Alex Deucher alexdeucher at gmail.com
Tue Jul 17 15:25:57 PDT 2012


On Tue, Jul 17, 2012 at 4:54 PM,  <j.glisse at gmail.com> wrote:
> From: Jerome Glisse <jglisse at redhat.com>
>
> To have kernel behave like VGA/DVI we need to retrain link
> on hotplug. For this to happen with need to report that
> we need to link training to happen if we fail to get link
> status and we need to force link training to happen by
> setting connector dpms to off before asking it on.
>
> Signed-off-by: Jerome Glisse <jglisse at redhat.com>
> ---
>  drivers/gpu/drm/radeon/atombios_dp.c       |    2 +-
>  drivers/gpu/drm/radeon/radeon_connectors.c |    7 +++++--
>  2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
> index 5131b3b..7bb5d7e 100644
> --- a/drivers/gpu/drm/radeon/atombios_dp.c
> +++ b/drivers/gpu/drm/radeon/atombios_dp.c
> @@ -670,7 +670,7 @@ bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector)
>         struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
>
>         if (!radeon_dp_get_link_status(radeon_connector, link_status))
> -               return false;
> +               return true;

I'm not sure we want to change the logic here.  The idea was that if
we failed to get the link status, the monitor is most likely not
attached so there's no need to retrain the link.

Alex

>         if (dp_channel_eq_ok(link_status, dig->dp_lane_count))
>                 return false;
>         return true;
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2914c57..4b42c9f 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -67,10 +67,13 @@ void radeon_connector_hotplug(struct drm_connector *connector)
>                 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);
> -               else if (radeon_dp_needs_link_train(radeon_connector))
> +               } else if (radeon_dp_needs_link_train(radeon_connector)) {
> +                       /* force a mode on to trigger dp link training */
> +                       connector->dpms = DRM_MODE_DPMS_OFF;
>                         drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
> +               }
>                 connector->dpms = saved_dpms;
>         }
>  }
> --
> 1.7.10.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list