[PATCH] drm/radeon: hotplug of passive dp to dvi|hdmi|vga adaptor
Jerome Glisse
j.glisse at gmail.com
Thu Jul 19 19:25:57 PDT 2012
On Thu, Jul 19, 2012 at 5:34 PM, Alex Deucher <alexdeucher at gmail.com> wrote:
> On Thu, Jul 19, 2012 at 5:12 PM, <j.glisse at gmail.com> wrote:
>> From: Jerome Glisse <jglisse at redhat.com>
>>
>> We should not turn off the connector neither try to retrain DP link
>> if a passive DP adaptor is connected to a DP port.
>>
>> Cc: <stable at vger.kernel.org>
>> Signed-off-by: Jerome Glisse <jglisse at redhat.com>
>
> Looks good although we should probably wait to assign
> radeon_connector_atom_dig until we know we have a digital connector.
> How about the attached patches (also a follow up on your patch from
> yesterday)?
>
> Alex
Yes looks better.
Cheers,
Jerome
>> ---
>> drivers/gpu/drm/radeon/radeon_connectors.c | 22 ++++++++++++++++++++--
>> 1 file changed, 20 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
>> index 2914c57..890cf1d 100644
>> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
>> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
>> @@ -49,6 +49,7 @@ void radeon_connector_hotplug(struct drm_connector *connector)
>> struct drm_device *dev = connector->dev;
>> struct radeon_device *rdev = dev->dev_private;
>> struct radeon_connector *radeon_connector = to_radeon_connector(connector);
>> + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
>>
>> /* bail if the connector does not have hpd pin, e.g.,
>> * VGA, TV, etc.
>> @@ -62,15 +63,32 @@ void radeon_connector_hotplug(struct drm_connector *connector)
>> if (connector->dpms != DRM_MODE_DPMS_ON)
>> return;
>>
>> + /* don't do anything is sink is not display port
>> + * (passive dp->(dvi|hdmi|vga) adaptor
>> + */
>> + if (radeon_dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) {
>> + return;
>> + }
>> +
>> /* 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);
>> - else if (radeon_dp_needs_link_train(radeon_connector))
>> + } else if (radeon_dp_needs_link_train(radeon_connector)) {
>> +
>> + /* first get sink type as it's reset after unplug */
>> + radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector);
>> + /* don't do anything is sink is not display port
>> + * (passive dp->(dvi|hdmi|vga) adaptor
>> + */
>> + if (radeon_dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) {
>> + return;
>> + }
>> 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