diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_combios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 162 |
1 files changed, 121 insertions, 41 deletions
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 | } |