diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-11-05 13:16:01 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-11-05 20:35:30 -0500 |
commit | b75fad0682caacb16012582deecbd7d19bc2f68e (patch) | |
tree | a9934e8233c4e7b51537bdaba9b400be0aa29e01 /drivers/gpu | |
parent | 4170a6c1bc106d7fcf94f5842224ac4dac61006b (diff) |
drm/radeon/kms: store detailed connector info
This will be useful for mode validation and certain
atom tables.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 76 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 162 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 1 |
4 files changed, 199 insertions, 48 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 050722492b43..80aacded85a0 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -46,7 +46,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
46 | uint32_t supported_device, | 46 | uint32_t supported_device, |
47 | int connector_type, | 47 | int connector_type, |
48 | struct radeon_i2c_bus_rec *i2c_bus, | 48 | struct radeon_i2c_bus_rec *i2c_bus, |
49 | bool linkb, uint32_t igp_lane_info); | 49 | bool linkb, uint32_t igp_lane_info, |
50 | uint16_t connector_object_id); | ||
50 | 51 | ||
51 | /* from radeon_legacy_encoder.c */ | 52 | /* from radeon_legacy_encoder.c */ |
52 | extern void | 53 | extern void |
@@ -193,6 +194,23 @@ const int supported_devices_connector_convert[] = { | |||
193 | DRM_MODE_CONNECTOR_DisplayPort | 194 | DRM_MODE_CONNECTOR_DisplayPort |
194 | }; | 195 | }; |
195 | 196 | ||
197 | const uint16_t supported_devices_connector_object_id_convert[] = { | ||
198 | CONNECTOR_OBJECT_ID_NONE, | ||
199 | CONNECTOR_OBJECT_ID_VGA, | ||
200 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I, /* not all boards support DL */ | ||
201 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D, /* not all boards support DL */ | ||
202 | CONNECTOR_OBJECT_ID_VGA, /* technically DVI-A */ | ||
203 | CONNECTOR_OBJECT_ID_COMPOSITE, | ||
204 | CONNECTOR_OBJECT_ID_SVIDEO, | ||
205 | CONNECTOR_OBJECT_ID_LVDS, | ||
206 | CONNECTOR_OBJECT_ID_9PIN_DIN, | ||
207 | CONNECTOR_OBJECT_ID_9PIN_DIN, | ||
208 | CONNECTOR_OBJECT_ID_DISPLAYPORT, | ||
209 | CONNECTOR_OBJECT_ID_HDMI_TYPE_A, | ||
210 | CONNECTOR_OBJECT_ID_HDMI_TYPE_B, | ||
211 | CONNECTOR_OBJECT_ID_SVIDEO | ||
212 | }; | ||
213 | |||
196 | const int object_connector_convert[] = { | 214 | const int object_connector_convert[] = { |
197 | DRM_MODE_CONNECTOR_Unknown, | 215 | DRM_MODE_CONNECTOR_Unknown, |
198 | DRM_MODE_CONNECTOR_DVII, | 216 | DRM_MODE_CONNECTOR_DVII, |
@@ -229,7 +247,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
229 | ATOM_OBJECT_HEADER *obj_header; | 247 | ATOM_OBJECT_HEADER *obj_header; |
230 | int i, j, path_size, device_support; | 248 | int i, j, path_size, device_support; |
231 | int connector_type; | 249 | int connector_type; |
232 | uint16_t igp_lane_info, conn_id; | 250 | uint16_t igp_lane_info, conn_id, connector_object_id; |
233 | bool linkb; | 251 | bool linkb; |
234 | struct radeon_i2c_bus_rec ddc_bus; | 252 | struct radeon_i2c_bus_rec ddc_bus; |
235 | 253 | ||
@@ -312,6 +330,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
312 | connector_type = | 330 | connector_type = |
313 | object_connector_convert | 331 | object_connector_convert |
314 | [ct]; | 332 | [ct]; |
333 | connector_object_id = ct; | ||
315 | igp_lane_info = | 334 | igp_lane_info = |
316 | slot_config & 0xffff; | 335 | slot_config & 0xffff; |
317 | } else | 336 | } else |
@@ -322,6 +341,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
322 | igp_lane_info = 0; | 341 | igp_lane_info = 0; |
323 | connector_type = | 342 | connector_type = |
324 | object_connector_convert[con_obj_id]; | 343 | object_connector_convert[con_obj_id]; |
344 | connector_object_id = con_obj_id; | ||
325 | } | 345 | } |
326 | 346 | ||
327 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) | 347 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) |
@@ -426,7 +446,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
426 | le16_to_cpu(path-> | 446 | le16_to_cpu(path-> |
427 | usDeviceTag), | 447 | usDeviceTag), |
428 | connector_type, &ddc_bus, | 448 | connector_type, &ddc_bus, |
429 | linkb, igp_lane_info); | 449 | linkb, igp_lane_info, |
450 | connector_object_id); | ||
430 | 451 | ||
431 | } | 452 | } |
432 | } | 453 | } |
@@ -436,6 +457,45 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
436 | return true; | 457 | return true; |
437 | } | 458 | } |
438 | 459 | ||
460 | static uint16_t atombios_get_connector_object_id(struct drm_device *dev, | ||
461 | int connector_type, | ||
462 | uint16_t devices) | ||
463 | { | ||
464 | struct radeon_device *rdev = dev->dev_private; | ||
465 | |||
466 | if (rdev->flags & RADEON_IS_IGP) { | ||
467 | return supported_devices_connector_object_id_convert | ||
468 | [connector_type]; | ||
469 | } else if (((connector_type == DRM_MODE_CONNECTOR_DVII) || | ||
470 | (connector_type == DRM_MODE_CONNECTOR_DVID)) && | ||
471 | (devices & ATOM_DEVICE_DFP2_SUPPORT)) { | ||
472 | struct radeon_mode_info *mode_info = &rdev->mode_info; | ||
473 | struct atom_context *ctx = mode_info->atom_context; | ||
474 | int index = GetIndexIntoMasterTable(DATA, XTMDS_Info); | ||
475 | uint16_t size, data_offset; | ||
476 | uint8_t frev, crev; | ||
477 | ATOM_XTMDS_INFO *xtmds; | ||
478 | |||
479 | atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset); | ||
480 | xtmds = (ATOM_XTMDS_INFO *)(ctx->bios + data_offset); | ||
481 | |||
482 | if (xtmds->ucSupportedLink & ATOM_XTMDS_SUPPORTED_DUALLINK) { | ||
483 | if (connector_type == DRM_MODE_CONNECTOR_DVII) | ||
484 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I; | ||
485 | else | ||
486 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D; | ||
487 | } else { | ||
488 | if (connector_type == DRM_MODE_CONNECTOR_DVII) | ||
489 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
490 | else | ||
491 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D; | ||
492 | } | ||
493 | } else { | ||
494 | return supported_devices_connector_object_id_convert | ||
495 | [connector_type]; | ||
496 | } | ||
497 | } | ||
498 | |||
439 | struct bios_connector { | 499 | struct bios_connector { |
440 | bool valid; | 500 | bool valid; |
441 | uint16_t line_mux; | 501 | uint16_t line_mux; |
@@ -594,14 +654,20 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct | |||
594 | 654 | ||
595 | /* add the connectors */ | 655 | /* add the connectors */ |
596 | for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { | 656 | for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { |
597 | if (bios_connectors[i].valid) | 657 | if (bios_connectors[i].valid) { |
658 | uint16_t connector_object_id = | ||
659 | atombios_get_connector_object_id(dev, | ||
660 | bios_connectors[i].connector_type, | ||
661 | bios_connectors[i].devices); | ||
598 | radeon_add_atom_connector(dev, | 662 | radeon_add_atom_connector(dev, |
599 | bios_connectors[i].line_mux, | 663 | bios_connectors[i].line_mux, |
600 | bios_connectors[i].devices, | 664 | bios_connectors[i].devices, |
601 | bios_connectors[i]. | 665 | bios_connectors[i]. |
602 | connector_type, | 666 | connector_type, |
603 | &bios_connectors[i].ddc_bus, | 667 | &bios_connectors[i].ddc_bus, |
604 | false, 0); | 668 | false, 0, |
669 | connector_object_id); | ||
670 | } | ||
605 | } | 671 | } |
606 | 672 | ||
607 | radeon_link_encoder_connector(dev); | 673 | radeon_link_encoder_connector(dev); |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index a36ede002ee4..5253cbf6db1f 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -49,7 +49,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
49 | uint32_t connector_id, | 49 | uint32_t connector_id, |
50 | uint32_t supported_device, | 50 | uint32_t supported_device, |
51 | int connector_type, | 51 | int connector_type, |
52 | struct radeon_i2c_bus_rec *i2c_bus); | 52 | struct radeon_i2c_bus_rec *i2c_bus, |
53 | uint16_t connector_object_id); | ||
53 | 54 | ||
54 | /* from radeon_legacy_encoder.c */ | 55 | /* from radeon_legacy_encoder.c */ |
55 | extern void | 56 | extern void |
@@ -1176,7 +1177,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1176 | radeon_add_legacy_connector(dev, 0, | 1177 | radeon_add_legacy_connector(dev, 0, |
1177 | ATOM_DEVICE_CRT1_SUPPORT, | 1178 | ATOM_DEVICE_CRT1_SUPPORT, |
1178 | DRM_MODE_CONNECTOR_VGA, | 1179 | DRM_MODE_CONNECTOR_VGA, |
1179 | &ddc_i2c); | 1180 | &ddc_i2c, |
1181 | CONNECTOR_OBJECT_ID_VGA); | ||
1180 | } else if (rdev->flags & RADEON_IS_MOBILITY) { | 1182 | } else if (rdev->flags & RADEON_IS_MOBILITY) { |
1181 | /* LVDS */ | 1183 | /* LVDS */ |
1182 | ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK); | 1184 | ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK); |
@@ -1188,7 +1190,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1188 | radeon_add_legacy_connector(dev, 0, | 1190 | radeon_add_legacy_connector(dev, 0, |
1189 | ATOM_DEVICE_LCD1_SUPPORT, | 1191 | ATOM_DEVICE_LCD1_SUPPORT, |
1190 | DRM_MODE_CONNECTOR_LVDS, | 1192 | DRM_MODE_CONNECTOR_LVDS, |
1191 | &ddc_i2c); | 1193 | &ddc_i2c, |
1194 | CONNECTOR_OBJECT_ID_LVDS); | ||
1192 | 1195 | ||
1193 | /* VGA - primary dac */ | 1196 | /* VGA - primary dac */ |
1194 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1197 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
@@ -1200,7 +1203,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1200 | radeon_add_legacy_connector(dev, 1, | 1203 | radeon_add_legacy_connector(dev, 1, |
1201 | ATOM_DEVICE_CRT1_SUPPORT, | 1204 | ATOM_DEVICE_CRT1_SUPPORT, |
1202 | DRM_MODE_CONNECTOR_VGA, | 1205 | DRM_MODE_CONNECTOR_VGA, |
1203 | &ddc_i2c); | 1206 | &ddc_i2c, |
1207 | CONNECTOR_OBJECT_ID_VGA); | ||
1204 | } else { | 1208 | } else { |
1205 | /* DVI-I - tv dac, int tmds */ | 1209 | /* DVI-I - tv dac, int tmds */ |
1206 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); | 1210 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); |
@@ -1218,7 +1222,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1218 | ATOM_DEVICE_DFP1_SUPPORT | | 1222 | ATOM_DEVICE_DFP1_SUPPORT | |
1219 | ATOM_DEVICE_CRT2_SUPPORT, | 1223 | ATOM_DEVICE_CRT2_SUPPORT, |
1220 | DRM_MODE_CONNECTOR_DVII, | 1224 | DRM_MODE_CONNECTOR_DVII, |
1221 | &ddc_i2c); | 1225 | &ddc_i2c, |
1226 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
1222 | 1227 | ||
1223 | /* VGA - primary dac */ | 1228 | /* VGA - primary dac */ |
1224 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1229 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
@@ -1230,7 +1235,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1230 | radeon_add_legacy_connector(dev, 1, | 1235 | radeon_add_legacy_connector(dev, 1, |
1231 | ATOM_DEVICE_CRT1_SUPPORT, | 1236 | ATOM_DEVICE_CRT1_SUPPORT, |
1232 | DRM_MODE_CONNECTOR_VGA, | 1237 | DRM_MODE_CONNECTOR_VGA, |
1233 | &ddc_i2c); | 1238 | &ddc_i2c, |
1239 | CONNECTOR_OBJECT_ID_VGA); | ||
1234 | } | 1240 | } |
1235 | 1241 | ||
1236 | if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { | 1242 | if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { |
@@ -1243,7 +1249,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1243 | radeon_add_legacy_connector(dev, 2, | 1249 | radeon_add_legacy_connector(dev, 2, |
1244 | ATOM_DEVICE_TV1_SUPPORT, | 1250 | ATOM_DEVICE_TV1_SUPPORT, |
1245 | DRM_MODE_CONNECTOR_SVIDEO, | 1251 | DRM_MODE_CONNECTOR_SVIDEO, |
1246 | &ddc_i2c); | 1252 | &ddc_i2c, |
1253 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1247 | } | 1254 | } |
1248 | break; | 1255 | break; |
1249 | case CT_IBOOK: | 1256 | case CT_IBOOK: |
@@ -1257,7 +1264,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1257 | 0), | 1264 | 0), |
1258 | ATOM_DEVICE_LCD1_SUPPORT); | 1265 | ATOM_DEVICE_LCD1_SUPPORT); |
1259 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1266 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1260 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1267 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1268 | CONNECTOR_OBJECT_ID_LVDS); | ||
1261 | /* VGA - TV DAC */ | 1269 | /* VGA - TV DAC */ |
1262 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1270 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
1263 | radeon_add_legacy_encoder(dev, | 1271 | radeon_add_legacy_encoder(dev, |
@@ -1266,7 +1274,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1266 | 2), | 1274 | 2), |
1267 | ATOM_DEVICE_CRT2_SUPPORT); | 1275 | ATOM_DEVICE_CRT2_SUPPORT); |
1268 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1276 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
1269 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1277 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1278 | CONNECTOR_OBJECT_ID_VGA); | ||
1270 | /* TV - TV DAC */ | 1279 | /* TV - TV DAC */ |
1271 | radeon_add_legacy_encoder(dev, | 1280 | radeon_add_legacy_encoder(dev, |
1272 | radeon_get_encoder_id(dev, | 1281 | radeon_get_encoder_id(dev, |
@@ -1275,7 +1284,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1275 | ATOM_DEVICE_TV1_SUPPORT); | 1284 | ATOM_DEVICE_TV1_SUPPORT); |
1276 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1285 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1277 | DRM_MODE_CONNECTOR_SVIDEO, | 1286 | DRM_MODE_CONNECTOR_SVIDEO, |
1278 | &ddc_i2c); | 1287 | &ddc_i2c, |
1288 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1279 | break; | 1289 | break; |
1280 | case CT_POWERBOOK_EXTERNAL: | 1290 | case CT_POWERBOOK_EXTERNAL: |
1281 | DRM_INFO("Connector Table: %d (powerbook external tmds)\n", | 1291 | DRM_INFO("Connector Table: %d (powerbook external tmds)\n", |
@@ -1288,7 +1298,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1288 | 0), | 1298 | 0), |
1289 | ATOM_DEVICE_LCD1_SUPPORT); | 1299 | ATOM_DEVICE_LCD1_SUPPORT); |
1290 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1300 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1291 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1301 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1302 | CONNECTOR_OBJECT_ID_LVDS); | ||
1292 | /* DVI-I - primary dac, ext tmds */ | 1303 | /* DVI-I - primary dac, ext tmds */ |
1293 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1304 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
1294 | radeon_add_legacy_encoder(dev, | 1305 | radeon_add_legacy_encoder(dev, |
@@ -1301,10 +1312,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1301 | ATOM_DEVICE_CRT1_SUPPORT, | 1312 | ATOM_DEVICE_CRT1_SUPPORT, |
1302 | 1), | 1313 | 1), |
1303 | ATOM_DEVICE_CRT1_SUPPORT); | 1314 | ATOM_DEVICE_CRT1_SUPPORT); |
1315 | /* XXX some are SL */ | ||
1304 | radeon_add_legacy_connector(dev, 1, | 1316 | radeon_add_legacy_connector(dev, 1, |
1305 | ATOM_DEVICE_DFP2_SUPPORT | | 1317 | ATOM_DEVICE_DFP2_SUPPORT | |
1306 | ATOM_DEVICE_CRT1_SUPPORT, | 1318 | ATOM_DEVICE_CRT1_SUPPORT, |
1307 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1319 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1320 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I); | ||
1308 | /* TV - TV DAC */ | 1321 | /* TV - TV DAC */ |
1309 | radeon_add_legacy_encoder(dev, | 1322 | radeon_add_legacy_encoder(dev, |
1310 | radeon_get_encoder_id(dev, | 1323 | radeon_get_encoder_id(dev, |
@@ -1313,7 +1326,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1313 | ATOM_DEVICE_TV1_SUPPORT); | 1326 | ATOM_DEVICE_TV1_SUPPORT); |
1314 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1327 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1315 | DRM_MODE_CONNECTOR_SVIDEO, | 1328 | DRM_MODE_CONNECTOR_SVIDEO, |
1316 | &ddc_i2c); | 1329 | &ddc_i2c, |
1330 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1317 | break; | 1331 | break; |
1318 | case CT_POWERBOOK_INTERNAL: | 1332 | case CT_POWERBOOK_INTERNAL: |
1319 | DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", | 1333 | DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", |
@@ -1326,7 +1340,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1326 | 0), | 1340 | 0), |
1327 | ATOM_DEVICE_LCD1_SUPPORT); | 1341 | ATOM_DEVICE_LCD1_SUPPORT); |
1328 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1342 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1329 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1343 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1344 | CONNECTOR_OBJECT_ID_LVDS); | ||
1330 | /* DVI-I - primary dac, int tmds */ | 1345 | /* DVI-I - primary dac, int tmds */ |
1331 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1346 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
1332 | radeon_add_legacy_encoder(dev, | 1347 | radeon_add_legacy_encoder(dev, |
@@ -1342,7 +1357,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1342 | radeon_add_legacy_connector(dev, 1, | 1357 | radeon_add_legacy_connector(dev, 1, |
1343 | ATOM_DEVICE_DFP1_SUPPORT | | 1358 | ATOM_DEVICE_DFP1_SUPPORT | |
1344 | ATOM_DEVICE_CRT1_SUPPORT, | 1359 | ATOM_DEVICE_CRT1_SUPPORT, |
1345 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1360 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1361 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
1346 | /* TV - TV DAC */ | 1362 | /* TV - TV DAC */ |
1347 | radeon_add_legacy_encoder(dev, | 1363 | radeon_add_legacy_encoder(dev, |
1348 | radeon_get_encoder_id(dev, | 1364 | radeon_get_encoder_id(dev, |
@@ -1351,7 +1367,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1351 | ATOM_DEVICE_TV1_SUPPORT); | 1367 | ATOM_DEVICE_TV1_SUPPORT); |
1352 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1368 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1353 | DRM_MODE_CONNECTOR_SVIDEO, | 1369 | DRM_MODE_CONNECTOR_SVIDEO, |
1354 | &ddc_i2c); | 1370 | &ddc_i2c, |
1371 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1355 | break; | 1372 | break; |
1356 | case CT_POWERBOOK_VGA: | 1373 | case CT_POWERBOOK_VGA: |
1357 | DRM_INFO("Connector Table: %d (powerbook vga)\n", | 1374 | DRM_INFO("Connector Table: %d (powerbook vga)\n", |
@@ -1364,7 +1381,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1364 | 0), | 1381 | 0), |
1365 | ATOM_DEVICE_LCD1_SUPPORT); | 1382 | ATOM_DEVICE_LCD1_SUPPORT); |
1366 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1383 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1367 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1384 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1385 | CONNECTOR_OBJECT_ID_LVDS); | ||
1368 | /* VGA - primary dac */ | 1386 | /* VGA - primary dac */ |
1369 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1387 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
1370 | radeon_add_legacy_encoder(dev, | 1388 | radeon_add_legacy_encoder(dev, |
@@ -1373,7 +1391,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1373 | 1), | 1391 | 1), |
1374 | ATOM_DEVICE_CRT1_SUPPORT); | 1392 | ATOM_DEVICE_CRT1_SUPPORT); |
1375 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, | 1393 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, |
1376 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1394 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1395 | CONNECTOR_OBJECT_ID_VGA); | ||
1377 | /* TV - TV DAC */ | 1396 | /* TV - TV DAC */ |
1378 | radeon_add_legacy_encoder(dev, | 1397 | radeon_add_legacy_encoder(dev, |
1379 | radeon_get_encoder_id(dev, | 1398 | radeon_get_encoder_id(dev, |
@@ -1382,7 +1401,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1382 | ATOM_DEVICE_TV1_SUPPORT); | 1401 | ATOM_DEVICE_TV1_SUPPORT); |
1383 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1402 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1384 | DRM_MODE_CONNECTOR_SVIDEO, | 1403 | DRM_MODE_CONNECTOR_SVIDEO, |
1385 | &ddc_i2c); | 1404 | &ddc_i2c, |
1405 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1386 | break; | 1406 | break; |
1387 | case CT_MINI_EXTERNAL: | 1407 | case CT_MINI_EXTERNAL: |
1388 | DRM_INFO("Connector Table: %d (mini external tmds)\n", | 1408 | DRM_INFO("Connector Table: %d (mini external tmds)\n", |
@@ -1399,10 +1419,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1399 | ATOM_DEVICE_CRT2_SUPPORT, | 1419 | ATOM_DEVICE_CRT2_SUPPORT, |
1400 | 2), | 1420 | 2), |
1401 | ATOM_DEVICE_CRT2_SUPPORT); | 1421 | ATOM_DEVICE_CRT2_SUPPORT); |
1422 | /* XXX are any DL? */ | ||
1402 | radeon_add_legacy_connector(dev, 0, | 1423 | radeon_add_legacy_connector(dev, 0, |
1403 | ATOM_DEVICE_DFP2_SUPPORT | | 1424 | ATOM_DEVICE_DFP2_SUPPORT | |
1404 | ATOM_DEVICE_CRT2_SUPPORT, | 1425 | ATOM_DEVICE_CRT2_SUPPORT, |
1405 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1426 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1427 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
1406 | /* TV - TV DAC */ | 1428 | /* TV - TV DAC */ |
1407 | radeon_add_legacy_encoder(dev, | 1429 | radeon_add_legacy_encoder(dev, |
1408 | radeon_get_encoder_id(dev, | 1430 | radeon_get_encoder_id(dev, |
@@ -1411,7 +1433,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1411 | ATOM_DEVICE_TV1_SUPPORT); | 1433 | ATOM_DEVICE_TV1_SUPPORT); |
1412 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, | 1434 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, |
1413 | DRM_MODE_CONNECTOR_SVIDEO, | 1435 | DRM_MODE_CONNECTOR_SVIDEO, |
1414 | &ddc_i2c); | 1436 | &ddc_i2c, |
1437 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1415 | break; | 1438 | break; |
1416 | case CT_MINI_INTERNAL: | 1439 | case CT_MINI_INTERNAL: |
1417 | DRM_INFO("Connector Table: %d (mini internal tmds)\n", | 1440 | DRM_INFO("Connector Table: %d (mini internal tmds)\n", |
@@ -1431,7 +1454,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1431 | radeon_add_legacy_connector(dev, 0, | 1454 | radeon_add_legacy_connector(dev, 0, |
1432 | ATOM_DEVICE_DFP1_SUPPORT | | 1455 | ATOM_DEVICE_DFP1_SUPPORT | |
1433 | ATOM_DEVICE_CRT2_SUPPORT, | 1456 | ATOM_DEVICE_CRT2_SUPPORT, |
1434 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1457 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1458 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
1435 | /* TV - TV DAC */ | 1459 | /* TV - TV DAC */ |
1436 | radeon_add_legacy_encoder(dev, | 1460 | radeon_add_legacy_encoder(dev, |
1437 | radeon_get_encoder_id(dev, | 1461 | radeon_get_encoder_id(dev, |
@@ -1440,7 +1464,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1440 | ATOM_DEVICE_TV1_SUPPORT); | 1464 | ATOM_DEVICE_TV1_SUPPORT); |
1441 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, | 1465 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, |
1442 | DRM_MODE_CONNECTOR_SVIDEO, | 1466 | DRM_MODE_CONNECTOR_SVIDEO, |
1443 | &ddc_i2c); | 1467 | &ddc_i2c, |
1468 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1444 | break; | 1469 | break; |
1445 | case CT_IMAC_G5_ISIGHT: | 1470 | case CT_IMAC_G5_ISIGHT: |
1446 | DRM_INFO("Connector Table: %d (imac g5 isight)\n", | 1471 | DRM_INFO("Connector Table: %d (imac g5 isight)\n", |
@@ -1453,7 +1478,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1453 | 0), | 1478 | 0), |
1454 | ATOM_DEVICE_DFP1_SUPPORT); | 1479 | ATOM_DEVICE_DFP1_SUPPORT); |
1455 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, | 1480 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, |
1456 | DRM_MODE_CONNECTOR_DVID, &ddc_i2c); | 1481 | DRM_MODE_CONNECTOR_DVID, &ddc_i2c, |
1482 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D); | ||
1457 | /* VGA - tv dac */ | 1483 | /* VGA - tv dac */ |
1458 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); | 1484 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); |
1459 | radeon_add_legacy_encoder(dev, | 1485 | radeon_add_legacy_encoder(dev, |
@@ -1462,7 +1488,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1462 | 2), | 1488 | 2), |
1463 | ATOM_DEVICE_CRT2_SUPPORT); | 1489 | ATOM_DEVICE_CRT2_SUPPORT); |
1464 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1490 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
1465 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1491 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1492 | CONNECTOR_OBJECT_ID_VGA); | ||
1466 | /* TV - TV DAC */ | 1493 | /* TV - TV DAC */ |
1467 | radeon_add_legacy_encoder(dev, | 1494 | radeon_add_legacy_encoder(dev, |
1468 | radeon_get_encoder_id(dev, | 1495 | radeon_get_encoder_id(dev, |
@@ -1471,7 +1498,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1471 | ATOM_DEVICE_TV1_SUPPORT); | 1498 | ATOM_DEVICE_TV1_SUPPORT); |
1472 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1499 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1473 | DRM_MODE_CONNECTOR_SVIDEO, | 1500 | DRM_MODE_CONNECTOR_SVIDEO, |
1474 | &ddc_i2c); | 1501 | &ddc_i2c, |
1502 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1475 | break; | 1503 | break; |
1476 | case CT_EMAC: | 1504 | case CT_EMAC: |
1477 | DRM_INFO("Connector Table: %d (emac)\n", | 1505 | DRM_INFO("Connector Table: %d (emac)\n", |
@@ -1484,7 +1512,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1484 | 1), | 1512 | 1), |
1485 | ATOM_DEVICE_CRT1_SUPPORT); | 1513 | ATOM_DEVICE_CRT1_SUPPORT); |
1486 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, | 1514 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, |
1487 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1515 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1516 | CONNECTOR_OBJECT_ID_VGA); | ||
1488 | /* VGA - tv dac */ | 1517 | /* VGA - tv dac */ |
1489 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); | 1518 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); |
1490 | radeon_add_legacy_encoder(dev, | 1519 | radeon_add_legacy_encoder(dev, |
@@ -1493,7 +1522,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1493 | 2), | 1522 | 2), |
1494 | ATOM_DEVICE_CRT2_SUPPORT); | 1523 | ATOM_DEVICE_CRT2_SUPPORT); |
1495 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1524 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
1496 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1525 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1526 | CONNECTOR_OBJECT_ID_VGA); | ||
1497 | /* TV - TV DAC */ | 1527 | /* TV - TV DAC */ |
1498 | radeon_add_legacy_encoder(dev, | 1528 | radeon_add_legacy_encoder(dev, |
1499 | radeon_get_encoder_id(dev, | 1529 | radeon_get_encoder_id(dev, |
@@ -1502,7 +1532,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1502 | ATOM_DEVICE_TV1_SUPPORT); | 1532 | ATOM_DEVICE_TV1_SUPPORT); |
1503 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1533 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1504 | DRM_MODE_CONNECTOR_SVIDEO, | 1534 | DRM_MODE_CONNECTOR_SVIDEO, |
1505 | &ddc_i2c); | 1535 | &ddc_i2c, |
1536 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1506 | break; | 1537 | break; |
1507 | default: | 1538 | default: |
1508 | DRM_INFO("Connector table: %d (invalid)\n", | 1539 | DRM_INFO("Connector table: %d (invalid)\n", |
@@ -1596,11 +1627,46 @@ static bool radeon_apply_legacy_tv_quirks(struct drm_device *dev) | |||
1596 | return true; | 1627 | return true; |
1597 | } | 1628 | } |
1598 | 1629 | ||
1630 | static uint16_t combios_check_dl_dvi(struct drm_device *dev, int is_dvi_d) | ||
1631 | { | ||
1632 | struct radeon_device *rdev = dev->dev_private; | ||
1633 | uint32_t ext_tmds_info; | ||
1634 | |||
1635 | if (rdev->flags & RADEON_IS_IGP) { | ||
1636 | if (is_dvi_d) | ||
1637 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D; | ||
1638 | else | ||
1639 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
1640 | } | ||
1641 | ext_tmds_info = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE); | ||
1642 | if (ext_tmds_info) { | ||
1643 | uint8_t rev = RBIOS8(ext_tmds_info); | ||
1644 | uint8_t flags = RBIOS8(ext_tmds_info + 4 + 5); | ||
1645 | if (rev >= 3) { | ||
1646 | if (is_dvi_d) | ||
1647 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D; | ||
1648 | else | ||
1649 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I; | ||
1650 | } else { | ||
1651 | if (flags & 1) { | ||
1652 | if (is_dvi_d) | ||
1653 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D; | ||
1654 | else | ||
1655 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I; | ||
1656 | } | ||
1657 | } | ||
1658 | } | ||
1659 | if (is_dvi_d) | ||
1660 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D; | ||
1661 | else | ||
1662 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
1663 | } | ||
1664 | |||
1599 | bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | 1665 | bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) |
1600 | { | 1666 | { |
1601 | struct radeon_device *rdev = dev->dev_private; | 1667 | struct radeon_device *rdev = dev->dev_private; |
1602 | uint32_t conn_info, entry, devices; | 1668 | uint32_t conn_info, entry, devices; |
1603 | uint16_t tmp; | 1669 | uint16_t tmp, connector_object_id; |
1604 | enum radeon_combios_ddc ddc_type; | 1670 | enum radeon_combios_ddc ddc_type; |
1605 | enum radeon_combios_connector connector; | 1671 | enum radeon_combios_connector connector; |
1606 | int i = 0; | 1672 | int i = 0; |
@@ -1660,7 +1726,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1660 | radeon_add_legacy_connector(dev, i, devices, | 1726 | radeon_add_legacy_connector(dev, i, devices, |
1661 | legacy_connector_convert | 1727 | legacy_connector_convert |
1662 | [connector], | 1728 | [connector], |
1663 | &ddc_i2c); | 1729 | &ddc_i2c, |
1730 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D); | ||
1664 | break; | 1731 | break; |
1665 | case CONNECTOR_CRT_LEGACY: | 1732 | case CONNECTOR_CRT_LEGACY: |
1666 | if (tmp & 0x1) { | 1733 | if (tmp & 0x1) { |
@@ -1685,7 +1752,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1685 | devices, | 1752 | devices, |
1686 | legacy_connector_convert | 1753 | legacy_connector_convert |
1687 | [connector], | 1754 | [connector], |
1688 | &ddc_i2c); | 1755 | &ddc_i2c, |
1756 | CONNECTOR_OBJECT_ID_VGA); | ||
1689 | break; | 1757 | break; |
1690 | case CONNECTOR_DVI_I_LEGACY: | 1758 | case CONNECTOR_DVI_I_LEGACY: |
1691 | devices = 0; | 1759 | devices = 0; |
@@ -1714,6 +1782,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1714 | ATOM_DEVICE_DFP2_SUPPORT, | 1782 | ATOM_DEVICE_DFP2_SUPPORT, |
1715 | 0), | 1783 | 0), |
1716 | ATOM_DEVICE_DFP2_SUPPORT); | 1784 | ATOM_DEVICE_DFP2_SUPPORT); |
1785 | connector_object_id = combios_check_dl_dvi(dev, 0); | ||
1717 | } else { | 1786 | } else { |
1718 | devices |= ATOM_DEVICE_DFP1_SUPPORT; | 1787 | devices |= ATOM_DEVICE_DFP1_SUPPORT; |
1719 | radeon_add_legacy_encoder(dev, | 1788 | radeon_add_legacy_encoder(dev, |
@@ -1722,19 +1791,24 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1722 | ATOM_DEVICE_DFP1_SUPPORT, | 1791 | ATOM_DEVICE_DFP1_SUPPORT, |
1723 | 0), | 1792 | 0), |
1724 | ATOM_DEVICE_DFP1_SUPPORT); | 1793 | ATOM_DEVICE_DFP1_SUPPORT); |
1794 | connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
1725 | } | 1795 | } |
1726 | radeon_add_legacy_connector(dev, | 1796 | radeon_add_legacy_connector(dev, |
1727 | i, | 1797 | i, |
1728 | devices, | 1798 | devices, |
1729 | legacy_connector_convert | 1799 | legacy_connector_convert |
1730 | [connector], | 1800 | [connector], |
1731 | &ddc_i2c); | 1801 | &ddc_i2c, |
1802 | connector_object_id); | ||
1732 | break; | 1803 | break; |
1733 | case CONNECTOR_DVI_D_LEGACY: | 1804 | case CONNECTOR_DVI_D_LEGACY: |
1734 | if ((tmp >> 4) & 0x1) | 1805 | if ((tmp >> 4) & 0x1) { |
1735 | devices = ATOM_DEVICE_DFP2_SUPPORT; | 1806 | devices = ATOM_DEVICE_DFP2_SUPPORT; |
1736 | else | 1807 | connector_object_id = combios_check_dl_dvi(dev, 1); |
1808 | } else { | ||
1737 | devices = ATOM_DEVICE_DFP1_SUPPORT; | 1809 | devices = ATOM_DEVICE_DFP1_SUPPORT; |
1810 | connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
1811 | } | ||
1738 | radeon_add_legacy_encoder(dev, | 1812 | radeon_add_legacy_encoder(dev, |
1739 | radeon_get_encoder_id | 1813 | radeon_get_encoder_id |
1740 | (dev, devices, 0), | 1814 | (dev, devices, 0), |
@@ -1742,7 +1816,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1742 | radeon_add_legacy_connector(dev, i, devices, | 1816 | radeon_add_legacy_connector(dev, i, devices, |
1743 | legacy_connector_convert | 1817 | legacy_connector_convert |
1744 | [connector], | 1818 | [connector], |
1745 | &ddc_i2c); | 1819 | &ddc_i2c, |
1820 | connector_object_id); | ||
1746 | break; | 1821 | break; |
1747 | case CONNECTOR_CTV_LEGACY: | 1822 | case CONNECTOR_CTV_LEGACY: |
1748 | case CONNECTOR_STV_LEGACY: | 1823 | case CONNECTOR_STV_LEGACY: |
@@ -1756,7 +1831,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1756 | ATOM_DEVICE_TV1_SUPPORT, | 1831 | ATOM_DEVICE_TV1_SUPPORT, |
1757 | legacy_connector_convert | 1832 | legacy_connector_convert |
1758 | [connector], | 1833 | [connector], |
1759 | &ddc_i2c); | 1834 | &ddc_i2c, |
1835 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1760 | break; | 1836 | break; |
1761 | default: | 1837 | default: |
1762 | DRM_ERROR("Unknown connector type: %d\n", | 1838 | DRM_ERROR("Unknown connector type: %d\n", |
@@ -1788,7 +1864,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1788 | ATOM_DEVICE_CRT1_SUPPORT | | 1864 | ATOM_DEVICE_CRT1_SUPPORT | |
1789 | ATOM_DEVICE_DFP1_SUPPORT, | 1865 | ATOM_DEVICE_DFP1_SUPPORT, |
1790 | DRM_MODE_CONNECTOR_DVII, | 1866 | DRM_MODE_CONNECTOR_DVII, |
1791 | &ddc_i2c); | 1867 | &ddc_i2c, |
1868 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
1792 | } else { | 1869 | } else { |
1793 | uint16_t crt_info = | 1870 | uint16_t crt_info = |
1794 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); | 1871 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
@@ -1804,7 +1881,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1804 | 0, | 1881 | 0, |
1805 | ATOM_DEVICE_CRT1_SUPPORT, | 1882 | ATOM_DEVICE_CRT1_SUPPORT, |
1806 | DRM_MODE_CONNECTOR_VGA, | 1883 | DRM_MODE_CONNECTOR_VGA, |
1807 | &ddc_i2c); | 1884 | &ddc_i2c, |
1885 | CONNECTOR_OBJECT_ID_VGA); | ||
1808 | } else { | 1886 | } else { |
1809 | DRM_DEBUG("No connector info found\n"); | 1887 | DRM_DEBUG("No connector info found\n"); |
1810 | return false; | 1888 | return false; |
@@ -1903,7 +1981,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1903 | 5, | 1981 | 5, |
1904 | ATOM_DEVICE_LCD1_SUPPORT, | 1982 | ATOM_DEVICE_LCD1_SUPPORT, |
1905 | DRM_MODE_CONNECTOR_LVDS, | 1983 | DRM_MODE_CONNECTOR_LVDS, |
1906 | &ddc_i2c); | 1984 | &ddc_i2c, |
1985 | CONNECTOR_OBJECT_ID_LVDS); | ||
1907 | } | 1986 | } |
1908 | } | 1987 | } |
1909 | 1988 | ||
@@ -1923,7 +2002,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1923 | radeon_add_legacy_connector(dev, 6, | 2002 | radeon_add_legacy_connector(dev, 6, |
1924 | ATOM_DEVICE_TV1_SUPPORT, | 2003 | ATOM_DEVICE_TV1_SUPPORT, |
1925 | DRM_MODE_CONNECTOR_SVIDEO, | 2004 | DRM_MODE_CONNECTOR_SVIDEO, |
1926 | &ddc_i2c); | 2005 | &ddc_i2c, |
2006 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
1927 | } | 2007 | } |
1928 | } | 2008 | } |
1929 | } | 2009 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index ce3a785a633b..fb4d9184704a 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -823,7 +823,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
823 | int connector_type, | 823 | int connector_type, |
824 | struct radeon_i2c_bus_rec *i2c_bus, | 824 | struct radeon_i2c_bus_rec *i2c_bus, |
825 | bool linkb, | 825 | bool linkb, |
826 | uint32_t igp_lane_info) | 826 | uint32_t igp_lane_info, |
827 | uint16_t connector_object_id) | ||
827 | { | 828 | { |
828 | struct radeon_device *rdev = dev->dev_private; | 829 | struct radeon_device *rdev = dev->dev_private; |
829 | struct drm_connector *connector; | 830 | struct drm_connector *connector; |
@@ -862,6 +863,7 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
862 | radeon_connector->connector_id = connector_id; | 863 | radeon_connector->connector_id = connector_id; |
863 | radeon_connector->devices = supported_device; | 864 | radeon_connector->devices = supported_device; |
864 | radeon_connector->shared_ddc = shared_ddc; | 865 | radeon_connector->shared_ddc = shared_ddc; |
866 | radeon_connector->connector_object_id = connector_object_id; | ||
865 | switch (connector_type) { | 867 | switch (connector_type) { |
866 | case DRM_MODE_CONNECTOR_VGA: | 868 | case DRM_MODE_CONNECTOR_VGA: |
867 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); | 869 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
@@ -1013,7 +1015,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
1013 | uint32_t connector_id, | 1015 | uint32_t connector_id, |
1014 | uint32_t supported_device, | 1016 | uint32_t supported_device, |
1015 | int connector_type, | 1017 | int connector_type, |
1016 | struct radeon_i2c_bus_rec *i2c_bus) | 1018 | struct radeon_i2c_bus_rec *i2c_bus, |
1019 | uint16_t connector_object_id) | ||
1017 | { | 1020 | { |
1018 | struct radeon_device *rdev = dev->dev_private; | 1021 | struct radeon_device *rdev = dev->dev_private; |
1019 | struct drm_connector *connector; | 1022 | struct drm_connector *connector; |
@@ -1042,6 +1045,7 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
1042 | 1045 | ||
1043 | radeon_connector->connector_id = connector_id; | 1046 | radeon_connector->connector_id = connector_id; |
1044 | radeon_connector->devices = supported_device; | 1047 | radeon_connector->devices = supported_device; |
1048 | radeon_connector->connector_object_id = connector_object_id; | ||
1045 | switch (connector_type) { | 1049 | switch (connector_type) { |
1046 | case DRM_MODE_CONNECTOR_VGA: | 1050 | case DRM_MODE_CONNECTOR_VGA: |
1047 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); | 1051 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index ccb783868ad6..ace726aa0d76 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -317,6 +317,7 @@ struct radeon_connector { | |||
317 | struct edid *edid; | 317 | struct edid *edid; |
318 | void *con_priv; | 318 | void *con_priv; |
319 | bool dac_load_detect; | 319 | bool dac_load_detect; |
320 | uint16_t connector_object_id; | ||
320 | }; | 321 | }; |
321 | 322 | ||
322 | struct radeon_framebuffer { | 323 | struct radeon_framebuffer { |