diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_connectors.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 20161567dbff..55266416fa47 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -49,8 +49,10 @@ void radeon_connector_hotplug(struct drm_connector *connector) | |||
49 | if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) | 49 | if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) |
50 | radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd); | 50 | radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd); |
51 | 51 | ||
52 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { | 52 | if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) || |
53 | if (radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_DISPLAYPORT) { | 53 | (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { |
54 | if ((radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_DISPLAYPORT) || | ||
55 | (radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_eDP)) { | ||
54 | if (radeon_dp_needs_link_train(radeon_connector)) { | 56 | if (radeon_dp_needs_link_train(radeon_connector)) { |
55 | if (connector->encoder) | 57 | if (connector->encoder) |
56 | dp_link_train(connector->encoder, connector); | 58 | dp_link_train(connector->encoder, connector); |
@@ -615,7 +617,7 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect | |||
615 | ret = connector_status_connected; | 617 | ret = connector_status_connected; |
616 | } | 618 | } |
617 | } else { | 619 | } else { |
618 | if (radeon_connector->dac_load_detect) { | 620 | if (radeon_connector->dac_load_detect && encoder) { |
619 | encoder_funcs = encoder->helper_private; | 621 | encoder_funcs = encoder->helper_private; |
620 | ret = encoder_funcs->detect(encoder, connector); | 622 | ret = encoder_funcs->detect(encoder, connector); |
621 | } | 623 | } |
@@ -898,10 +900,18 @@ static void radeon_dvi_force(struct drm_connector *connector) | |||
898 | static int radeon_dvi_mode_valid(struct drm_connector *connector, | 900 | static int radeon_dvi_mode_valid(struct drm_connector *connector, |
899 | struct drm_display_mode *mode) | 901 | struct drm_display_mode *mode) |
900 | { | 902 | { |
903 | struct drm_device *dev = connector->dev; | ||
904 | struct radeon_device *rdev = dev->dev_private; | ||
901 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 905 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
902 | 906 | ||
903 | /* XXX check mode bandwidth */ | 907 | /* XXX check mode bandwidth */ |
904 | 908 | ||
909 | /* clocks over 135 MHz have heat issues with DVI on RV100 */ | ||
910 | if (radeon_connector->use_digital && | ||
911 | (rdev->family == CHIP_RV100) && | ||
912 | (mode->clock > 135000)) | ||
913 | return MODE_CLOCK_HIGH; | ||
914 | |||
905 | if (radeon_connector->use_digital && (mode->clock > 165000)) { | 915 | if (radeon_connector->use_digital && (mode->clock > 165000)) { |
906 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || | 916 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || |
907 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || | 917 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || |
@@ -967,7 +977,8 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto | |||
967 | } | 977 | } |
968 | 978 | ||
969 | sink_type = radeon_dp_getsinktype(radeon_connector); | 979 | sink_type = radeon_dp_getsinktype(radeon_connector); |
970 | if (sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { | 980 | if ((sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
981 | (sink_type == CONNECTOR_OBJECT_ID_eDP)) { | ||
971 | if (radeon_dp_getdpcd(radeon_connector)) { | 982 | if (radeon_dp_getdpcd(radeon_connector)) { |
972 | radeon_dig_connector->dp_sink_type = sink_type; | 983 | radeon_dig_connector->dp_sink_type = sink_type; |
973 | ret = connector_status_connected; | 984 | ret = connector_status_connected; |
@@ -992,7 +1003,8 @@ static int radeon_dp_mode_valid(struct drm_connector *connector, | |||
992 | 1003 | ||
993 | /* XXX check mode bandwidth */ | 1004 | /* XXX check mode bandwidth */ |
994 | 1005 | ||
995 | if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) | 1006 | if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
1007 | (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) | ||
996 | return radeon_dp_mode_valid_helper(radeon_connector, mode); | 1008 | return radeon_dp_mode_valid_helper(radeon_connector, mode); |
997 | else | 1009 | else |
998 | return MODE_OK; | 1010 | return MODE_OK; |
@@ -1145,6 +1157,7 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
1145 | subpixel_order = SubPixelHorizontalRGB; | 1157 | subpixel_order = SubPixelHorizontalRGB; |
1146 | break; | 1158 | break; |
1147 | case DRM_MODE_CONNECTOR_DisplayPort: | 1159 | case DRM_MODE_CONNECTOR_DisplayPort: |
1160 | case DRM_MODE_CONNECTOR_eDP: | ||
1148 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); | 1161 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
1149 | if (!radeon_dig_connector) | 1162 | if (!radeon_dig_connector) |
1150 | goto failed; | 1163 | goto failed; |
@@ -1157,10 +1170,16 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
1157 | goto failed; | 1170 | goto failed; |
1158 | if (i2c_bus->valid) { | 1171 | if (i2c_bus->valid) { |
1159 | /* add DP i2c bus */ | 1172 | /* add DP i2c bus */ |
1160 | radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch"); | 1173 | if (connector_type == DRM_MODE_CONNECTOR_eDP) |
1174 | radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "eDP-auxch"); | ||
1175 | else | ||
1176 | radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch"); | ||
1161 | if (!radeon_dig_connector->dp_i2c_bus) | 1177 | if (!radeon_dig_connector->dp_i2c_bus) |
1162 | goto failed; | 1178 | goto failed; |
1163 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DP"); | 1179 | if (connector_type == DRM_MODE_CONNECTOR_eDP) |
1180 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "eDP"); | ||
1181 | else | ||
1182 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DP"); | ||
1164 | if (!radeon_connector->ddc_bus) | 1183 | if (!radeon_connector->ddc_bus) |
1165 | goto failed; | 1184 | goto failed; |
1166 | } | 1185 | } |