Rev 1321 | Rev 1404 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1321 | Rev 1403 | ||
---|---|---|---|
Line 47... | Line 47... | ||
47 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
47 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
Line 48... | Line 48... | ||
48 | 48 | ||
49 | if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) |
49 | if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) |
Line 50... | Line 50... | ||
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) || |
|
- | 53 | (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { |
|
52 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { |
54 | if ((radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
53 | 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); |
Line 206... | Line 208... | ||
206 | mode = drm_mode_duplicate(dev, native_mode); |
208 | mode = drm_mode_duplicate(dev, native_mode); |
207 | mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; |
209 | mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; |
208 | drm_mode_set_name(mode); |
210 | drm_mode_set_name(mode); |
Line 209... | Line 211... | ||
209 | 211 | ||
- | 212 | DRM_DEBUG("Adding native panel mode %s\n", mode->name); |
|
- | 213 | } else if (native_mode->hdisplay != 0 && |
|
- | 214 | native_mode->vdisplay != 0) { |
|
- | 215 | /* mac laptops without an edid */ |
|
- | 216 | /* Note that this is not necessarily the exact panel mode, |
|
- | 217 | * but an approximation based on the cvt formula. For these |
|
- | 218 | * systems we should ideally read the mode info out of the |
|
- | 219 | * registers or add a mode table, but this works and is much |
|
- | 220 | * simpler. |
|
- | 221 | */ |
|
- | 222 | mode = drm_cvt_mode(dev, native_mode->hdisplay, native_mode->vdisplay, 60, true, false, false); |
|
- | 223 | mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; |
|
210 | DRM_DEBUG("Adding native panel mode %s\n", mode->name); |
224 | DRM_DEBUG("Adding cvt approximation of native panel mode %s\n", mode->name); |
211 | } |
225 | } |
212 | return mode; |
226 | return mode; |
Line 213... | Line 227... | ||
213 | } |
227 | } |
Line 601... | Line 615... | ||
601 | ret = connector_status_disconnected; |
615 | ret = connector_status_disconnected; |
602 | } else |
616 | } else |
603 | ret = connector_status_connected; |
617 | ret = connector_status_connected; |
604 | } |
618 | } |
605 | } else { |
619 | } else { |
606 | if (radeon_connector->dac_load_detect) { |
620 | if (radeon_connector->dac_load_detect && encoder) { |
607 | encoder_funcs = encoder->helper_private; |
621 | encoder_funcs = encoder->helper_private; |
608 | ret = encoder_funcs->detect(encoder, connector); |
622 | ret = encoder_funcs->detect(encoder, connector); |
609 | } |
623 | } |
610 | } |
624 | } |
Line 884... | Line 898... | ||
884 | } |
898 | } |
Line 885... | Line 899... | ||
885 | 899 | ||
886 | static int radeon_dvi_mode_valid(struct drm_connector *connector, |
900 | static int radeon_dvi_mode_valid(struct drm_connector *connector, |
887 | struct drm_display_mode *mode) |
901 | struct drm_display_mode *mode) |
- | 902 | { |
|
- | 903 | struct drm_device *dev = connector->dev; |
|
888 | { |
904 | struct radeon_device *rdev = dev->dev_private; |
Line 889... | Line 905... | ||
889 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
905 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
Line -... | Line 906... | ||
- | 906 | ||
- | 907 | /* XXX check mode bandwidth */ |
|
- | 908 | ||
- | 909 | /* clocks over 135 MHz have heat issues with DVI on RV100 */ |
|
- | 910 | if (radeon_connector->use_digital && |
|
- | 911 | (rdev->family == CHIP_RV100) && |
|
890 | 912 | (mode->clock > 135000)) |
|
891 | /* XXX check mode bandwidth */ |
913 | return MODE_CLOCK_HIGH; |
892 | 914 | ||
893 | if (radeon_connector->use_digital && (mode->clock > 165000)) { |
915 | if (radeon_connector->use_digital && (mode->clock > 165000)) { |
894 | 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) || |
Line 953... | Line 975... | ||
953 | kfree(radeon_connector->edid); |
975 | kfree(radeon_connector->edid); |
954 | radeon_connector->edid = NULL; |
976 | radeon_connector->edid = NULL; |
955 | } |
977 | } |
Line 956... | Line 978... | ||
956 | 978 | ||
957 | sink_type = radeon_dp_getsinktype(radeon_connector); |
979 | sink_type = radeon_dp_getsinktype(radeon_connector); |
- | 980 | if ((sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
|
958 | if (sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { |
981 | (sink_type == CONNECTOR_OBJECT_ID_eDP)) { |
959 | if (radeon_dp_getdpcd(radeon_connector)) { |
982 | if (radeon_dp_getdpcd(radeon_connector)) { |
960 | radeon_dig_connector->dp_sink_type = sink_type; |
983 | radeon_dig_connector->dp_sink_type = sink_type; |
961 | ret = connector_status_connected; |
984 | ret = connector_status_connected; |
962 | } |
985 | } |
Line 978... | Line 1001... | ||
978 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
1001 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
979 | struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; |
1002 | struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; |
Line 980... | Line 1003... | ||
980 | 1003 | ||
Line 981... | Line 1004... | ||
981 | /* XXX check mode bandwidth */ |
1004 | /* XXX check mode bandwidth */ |
- | 1005 | ||
982 | 1006 | if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
|
983 | if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) |
1007 | (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) |
984 | return radeon_dp_mode_valid_helper(radeon_connector, mode); |
1008 | return radeon_dp_mode_valid_helper(radeon_connector, mode); |
985 | else |
1009 | else |
Line 1131... | Line 1155... | ||
1131 | rdev->mode_info.coherent_mode_property, |
1155 | rdev->mode_info.coherent_mode_property, |
1132 | 1); |
1156 | 1); |
1133 | subpixel_order = SubPixelHorizontalRGB; |
1157 | subpixel_order = SubPixelHorizontalRGB; |
1134 | break; |
1158 | break; |
1135 | case DRM_MODE_CONNECTOR_DisplayPort: |
1159 | case DRM_MODE_CONNECTOR_DisplayPort: |
- | 1160 | case DRM_MODE_CONNECTOR_eDP: |
|
1136 | 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); |
1137 | if (!radeon_dig_connector) |
1162 | if (!radeon_dig_connector) |
1138 | goto failed; |
1163 | goto failed; |
1139 | radeon_dig_connector->linkb = linkb; |
1164 | radeon_dig_connector->linkb = linkb; |
1140 | radeon_dig_connector->igp_lane_info = igp_lane_info; |
1165 | radeon_dig_connector->igp_lane_info = igp_lane_info; |
Line 1143... | Line 1168... | ||
1143 | ret = drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs); |
1168 | ret = drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs); |
1144 | if (ret) |
1169 | if (ret) |
1145 | goto failed; |
1170 | goto failed; |
1146 | if (i2c_bus->valid) { |
1171 | if (i2c_bus->valid) { |
1147 | /* add DP i2c bus */ |
1172 | /* add DP i2c bus */ |
- | 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 |
|
1148 | radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch"); |
1176 | radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch"); |
1149 | if (!radeon_dig_connector->dp_i2c_bus) |
1177 | if (!radeon_dig_connector->dp_i2c_bus) |
1150 | goto failed; |
1178 | goto failed; |
- | 1179 | if (connector_type == DRM_MODE_CONNECTOR_eDP) |
|
- | 1180 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "eDP"); |
|
- | 1181 | else |
|
1151 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DP"); |
1182 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DP"); |
1152 | if (!radeon_connector->ddc_bus) |
1183 | if (!radeon_connector->ddc_bus) |
1153 | goto failed; |
1184 | goto failed; |
1154 | } |
1185 | } |
1155 | subpixel_order = SubPixelHorizontalRGB; |
1186 | subpixel_order = SubPixelHorizontalRGB; |
Line 1169... | Line 1200... | ||
1169 | drm_connector_attach_property(&radeon_connector->base, |
1200 | drm_connector_attach_property(&radeon_connector->base, |
1170 | rdev->mode_info.load_detect_property, |
1201 | rdev->mode_info.load_detect_property, |
1171 | 1); |
1202 | 1); |
1172 | drm_connector_attach_property(&radeon_connector->base, |
1203 | drm_connector_attach_property(&radeon_connector->base, |
1173 | rdev->mode_info.tv_std_property, |
1204 | rdev->mode_info.tv_std_property, |
1174 | 1); |
1205 | radeon_atombios_get_tv_info(rdev)); |
1175 | } |
1206 | } |
1176 | break; |
1207 | break; |
1177 | case DRM_MODE_CONNECTOR_LVDS: |
1208 | case DRM_MODE_CONNECTOR_LVDS: |
1178 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
1209 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
1179 | if (!radeon_dig_connector) |
1210 | if (!radeon_dig_connector) |
Line 1313... | Line 1344... | ||
1313 | drm_connector_attach_property(&radeon_connector->base, |
1344 | drm_connector_attach_property(&radeon_connector->base, |
1314 | rdev->mode_info.load_detect_property, |
1345 | rdev->mode_info.load_detect_property, |
1315 | 1); |
1346 | 1); |
1316 | drm_connector_attach_property(&radeon_connector->base, |
1347 | drm_connector_attach_property(&radeon_connector->base, |
1317 | rdev->mode_info.tv_std_property, |
1348 | rdev->mode_info.tv_std_property, |
1318 | 1); |
1349 | radeon_combios_get_tv_info(rdev)); |
1319 | } |
1350 | } |
1320 | break; |
1351 | break; |
1321 | case DRM_MODE_CONNECTOR_LVDS: |
1352 | case DRM_MODE_CONNECTOR_LVDS: |
1322 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); |
1353 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); |
1323 | ret = drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); |
1354 | ret = drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); |