diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-12-04 14:45:27 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-07 19:46:28 -0500 |
commit | eed45b30cd1423f8dc10b4312700773cac13c1c8 (patch) | |
tree | f47c667d753ce1fc2abd116449ca7c2ce290cecf /drivers/gpu/drm/radeon/radeon_combios.c | |
parent | 53c1e09fea4cf3fc0ec1f735a5fcab78c43cb55d (diff) |
drm/radeon/kms: get HPD info for connectors
This populates the connectors with HPD (Hot Plug Detect)
information. This will be used in subsequent patches
for automatic digital monitor connect/disconnect handling.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_combios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 176 |
1 files changed, 136 insertions, 40 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index b6761cde1ecb..c5021a3445de 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -50,7 +50,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
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 | uint16_t connector_object_id, |
54 | struct radeon_hpd *hpd); | ||
54 | 55 | ||
55 | /* from radeon_legacy_encoder.c */ | 56 | /* from radeon_legacy_encoder.c */ |
56 | extern void | 57 | extern void |
@@ -1226,6 +1227,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1226 | { | 1227 | { |
1227 | struct radeon_device *rdev = dev->dev_private; | 1228 | struct radeon_device *rdev = dev->dev_private; |
1228 | struct radeon_i2c_bus_rec ddc_i2c; | 1229 | struct radeon_i2c_bus_rec ddc_i2c; |
1230 | struct radeon_hpd hpd; | ||
1229 | 1231 | ||
1230 | rdev->mode_info.connector_table = radeon_connector_table; | 1232 | rdev->mode_info.connector_table = radeon_connector_table; |
1231 | if (rdev->mode_info.connector_table == CT_NONE) { | 1233 | if (rdev->mode_info.connector_table == CT_NONE) { |
@@ -1287,6 +1289,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1287 | if (rdev->flags & RADEON_SINGLE_CRTC) { | 1289 | if (rdev->flags & RADEON_SINGLE_CRTC) { |
1288 | /* VGA - primary dac */ | 1290 | /* VGA - primary dac */ |
1289 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1291 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1292 | hpd.hpd = RADEON_HPD_NONE; | ||
1290 | radeon_add_legacy_encoder(dev, | 1293 | radeon_add_legacy_encoder(dev, |
1291 | radeon_get_encoder_id(dev, | 1294 | radeon_get_encoder_id(dev, |
1292 | ATOM_DEVICE_CRT1_SUPPORT, | 1295 | ATOM_DEVICE_CRT1_SUPPORT, |
@@ -1296,10 +1299,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1296 | ATOM_DEVICE_CRT1_SUPPORT, | 1299 | ATOM_DEVICE_CRT1_SUPPORT, |
1297 | DRM_MODE_CONNECTOR_VGA, | 1300 | DRM_MODE_CONNECTOR_VGA, |
1298 | &ddc_i2c, | 1301 | &ddc_i2c, |
1299 | CONNECTOR_OBJECT_ID_VGA); | 1302 | CONNECTOR_OBJECT_ID_VGA, |
1303 | &hpd); | ||
1300 | } else if (rdev->flags & RADEON_IS_MOBILITY) { | 1304 | } else if (rdev->flags & RADEON_IS_MOBILITY) { |
1301 | /* LVDS */ | 1305 | /* LVDS */ |
1302 | ddc_i2c = combios_setup_i2c_bus(rdev, 0); | 1306 | ddc_i2c = combios_setup_i2c_bus(rdev, 0); |
1307 | hpd.hpd = RADEON_HPD_NONE; | ||
1303 | radeon_add_legacy_encoder(dev, | 1308 | radeon_add_legacy_encoder(dev, |
1304 | radeon_get_encoder_id(dev, | 1309 | radeon_get_encoder_id(dev, |
1305 | ATOM_DEVICE_LCD1_SUPPORT, | 1310 | ATOM_DEVICE_LCD1_SUPPORT, |
@@ -1309,10 +1314,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1309 | ATOM_DEVICE_LCD1_SUPPORT, | 1314 | ATOM_DEVICE_LCD1_SUPPORT, |
1310 | DRM_MODE_CONNECTOR_LVDS, | 1315 | DRM_MODE_CONNECTOR_LVDS, |
1311 | &ddc_i2c, | 1316 | &ddc_i2c, |
1312 | CONNECTOR_OBJECT_ID_LVDS); | 1317 | CONNECTOR_OBJECT_ID_LVDS, |
1318 | &hpd); | ||
1313 | 1319 | ||
1314 | /* VGA - primary dac */ | 1320 | /* VGA - primary dac */ |
1315 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1321 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1322 | hpd.hpd = RADEON_HPD_NONE; | ||
1316 | radeon_add_legacy_encoder(dev, | 1323 | radeon_add_legacy_encoder(dev, |
1317 | radeon_get_encoder_id(dev, | 1324 | radeon_get_encoder_id(dev, |
1318 | ATOM_DEVICE_CRT1_SUPPORT, | 1325 | ATOM_DEVICE_CRT1_SUPPORT, |
@@ -1322,10 +1329,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1322 | ATOM_DEVICE_CRT1_SUPPORT, | 1329 | ATOM_DEVICE_CRT1_SUPPORT, |
1323 | DRM_MODE_CONNECTOR_VGA, | 1330 | DRM_MODE_CONNECTOR_VGA, |
1324 | &ddc_i2c, | 1331 | &ddc_i2c, |
1325 | CONNECTOR_OBJECT_ID_VGA); | 1332 | CONNECTOR_OBJECT_ID_VGA, |
1333 | &hpd); | ||
1326 | } else { | 1334 | } else { |
1327 | /* DVI-I - tv dac, int tmds */ | 1335 | /* DVI-I - tv dac, int tmds */ |
1328 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 1336 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
1337 | hpd.hpd = RADEON_HPD_1; | ||
1329 | radeon_add_legacy_encoder(dev, | 1338 | radeon_add_legacy_encoder(dev, |
1330 | radeon_get_encoder_id(dev, | 1339 | radeon_get_encoder_id(dev, |
1331 | ATOM_DEVICE_DFP1_SUPPORT, | 1340 | ATOM_DEVICE_DFP1_SUPPORT, |
@@ -1341,10 +1350,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1341 | ATOM_DEVICE_CRT2_SUPPORT, | 1350 | ATOM_DEVICE_CRT2_SUPPORT, |
1342 | DRM_MODE_CONNECTOR_DVII, | 1351 | DRM_MODE_CONNECTOR_DVII, |
1343 | &ddc_i2c, | 1352 | &ddc_i2c, |
1344 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | 1353 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, |
1354 | &hpd); | ||
1345 | 1355 | ||
1346 | /* VGA - primary dac */ | 1356 | /* VGA - primary dac */ |
1347 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1357 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1358 | hpd.hpd = RADEON_HPD_NONE; | ||
1348 | radeon_add_legacy_encoder(dev, | 1359 | radeon_add_legacy_encoder(dev, |
1349 | radeon_get_encoder_id(dev, | 1360 | radeon_get_encoder_id(dev, |
1350 | ATOM_DEVICE_CRT1_SUPPORT, | 1361 | ATOM_DEVICE_CRT1_SUPPORT, |
@@ -1354,11 +1365,14 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1354 | ATOM_DEVICE_CRT1_SUPPORT, | 1365 | ATOM_DEVICE_CRT1_SUPPORT, |
1355 | DRM_MODE_CONNECTOR_VGA, | 1366 | DRM_MODE_CONNECTOR_VGA, |
1356 | &ddc_i2c, | 1367 | &ddc_i2c, |
1357 | CONNECTOR_OBJECT_ID_VGA); | 1368 | CONNECTOR_OBJECT_ID_VGA, |
1369 | &hpd); | ||
1358 | } | 1370 | } |
1359 | 1371 | ||
1360 | if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { | 1372 | if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { |
1361 | /* TV - tv dac */ | 1373 | /* TV - tv dac */ |
1374 | ddc_i2c.valid = false; | ||
1375 | hpd.hpd = RADEON_HPD_NONE; | ||
1362 | radeon_add_legacy_encoder(dev, | 1376 | radeon_add_legacy_encoder(dev, |
1363 | radeon_get_encoder_id(dev, | 1377 | radeon_get_encoder_id(dev, |
1364 | ATOM_DEVICE_TV1_SUPPORT, | 1378 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1368,7 +1382,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1368 | ATOM_DEVICE_TV1_SUPPORT, | 1382 | ATOM_DEVICE_TV1_SUPPORT, |
1369 | DRM_MODE_CONNECTOR_SVIDEO, | 1383 | DRM_MODE_CONNECTOR_SVIDEO, |
1370 | &ddc_i2c, | 1384 | &ddc_i2c, |
1371 | CONNECTOR_OBJECT_ID_SVIDEO); | 1385 | CONNECTOR_OBJECT_ID_SVIDEO, |
1386 | &hpd); | ||
1372 | } | 1387 | } |
1373 | break; | 1388 | break; |
1374 | case CT_IBOOK: | 1389 | case CT_IBOOK: |
@@ -1376,6 +1391,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1376 | rdev->mode_info.connector_table); | 1391 | rdev->mode_info.connector_table); |
1377 | /* LVDS */ | 1392 | /* LVDS */ |
1378 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 1393 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
1394 | hpd.hpd = RADEON_HPD_NONE; | ||
1379 | radeon_add_legacy_encoder(dev, | 1395 | radeon_add_legacy_encoder(dev, |
1380 | radeon_get_encoder_id(dev, | 1396 | radeon_get_encoder_id(dev, |
1381 | ATOM_DEVICE_LCD1_SUPPORT, | 1397 | ATOM_DEVICE_LCD1_SUPPORT, |
@@ -1383,9 +1399,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1383 | ATOM_DEVICE_LCD1_SUPPORT); | 1399 | ATOM_DEVICE_LCD1_SUPPORT); |
1384 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1400 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1385 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, | 1401 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1386 | CONNECTOR_OBJECT_ID_LVDS); | 1402 | CONNECTOR_OBJECT_ID_LVDS, |
1403 | &hpd); | ||
1387 | /* VGA - TV DAC */ | 1404 | /* VGA - TV DAC */ |
1388 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1405 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1406 | hpd.hpd = RADEON_HPD_NONE; | ||
1389 | radeon_add_legacy_encoder(dev, | 1407 | radeon_add_legacy_encoder(dev, |
1390 | radeon_get_encoder_id(dev, | 1408 | radeon_get_encoder_id(dev, |
1391 | ATOM_DEVICE_CRT2_SUPPORT, | 1409 | ATOM_DEVICE_CRT2_SUPPORT, |
@@ -1393,8 +1411,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1393 | ATOM_DEVICE_CRT2_SUPPORT); | 1411 | ATOM_DEVICE_CRT2_SUPPORT); |
1394 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1412 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
1395 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, | 1413 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1396 | CONNECTOR_OBJECT_ID_VGA); | 1414 | CONNECTOR_OBJECT_ID_VGA, |
1415 | &hpd); | ||
1397 | /* TV - TV DAC */ | 1416 | /* TV - TV DAC */ |
1417 | ddc_i2c.valid = false; | ||
1418 | hpd.hpd = RADEON_HPD_NONE; | ||
1398 | radeon_add_legacy_encoder(dev, | 1419 | radeon_add_legacy_encoder(dev, |
1399 | radeon_get_encoder_id(dev, | 1420 | radeon_get_encoder_id(dev, |
1400 | ATOM_DEVICE_TV1_SUPPORT, | 1421 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1403,13 +1424,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1403 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1424 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1404 | DRM_MODE_CONNECTOR_SVIDEO, | 1425 | DRM_MODE_CONNECTOR_SVIDEO, |
1405 | &ddc_i2c, | 1426 | &ddc_i2c, |
1406 | CONNECTOR_OBJECT_ID_SVIDEO); | 1427 | CONNECTOR_OBJECT_ID_SVIDEO, |
1428 | &hpd); | ||
1407 | break; | 1429 | break; |
1408 | case CT_POWERBOOK_EXTERNAL: | 1430 | case CT_POWERBOOK_EXTERNAL: |
1409 | DRM_INFO("Connector Table: %d (powerbook external tmds)\n", | 1431 | DRM_INFO("Connector Table: %d (powerbook external tmds)\n", |
1410 | rdev->mode_info.connector_table); | 1432 | rdev->mode_info.connector_table); |
1411 | /* LVDS */ | 1433 | /* LVDS */ |
1412 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 1434 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
1435 | hpd.hpd = RADEON_HPD_NONE; | ||
1413 | radeon_add_legacy_encoder(dev, | 1436 | radeon_add_legacy_encoder(dev, |
1414 | radeon_get_encoder_id(dev, | 1437 | radeon_get_encoder_id(dev, |
1415 | ATOM_DEVICE_LCD1_SUPPORT, | 1438 | ATOM_DEVICE_LCD1_SUPPORT, |
@@ -1417,9 +1440,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1417 | ATOM_DEVICE_LCD1_SUPPORT); | 1440 | ATOM_DEVICE_LCD1_SUPPORT); |
1418 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1441 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1419 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, | 1442 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1420 | CONNECTOR_OBJECT_ID_LVDS); | 1443 | CONNECTOR_OBJECT_ID_LVDS, |
1444 | &hpd); | ||
1421 | /* DVI-I - primary dac, ext tmds */ | 1445 | /* DVI-I - primary dac, ext tmds */ |
1422 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1446 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1447 | hpd.hpd = RADEON_HPD_2; /* ??? */ | ||
1423 | radeon_add_legacy_encoder(dev, | 1448 | radeon_add_legacy_encoder(dev, |
1424 | radeon_get_encoder_id(dev, | 1449 | radeon_get_encoder_id(dev, |
1425 | ATOM_DEVICE_DFP2_SUPPORT, | 1450 | ATOM_DEVICE_DFP2_SUPPORT, |
@@ -1435,8 +1460,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1435 | ATOM_DEVICE_DFP2_SUPPORT | | 1460 | ATOM_DEVICE_DFP2_SUPPORT | |
1436 | ATOM_DEVICE_CRT1_SUPPORT, | 1461 | ATOM_DEVICE_CRT1_SUPPORT, |
1437 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, | 1462 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1438 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I); | 1463 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I, |
1464 | &hpd); | ||
1439 | /* TV - TV DAC */ | 1465 | /* TV - TV DAC */ |
1466 | ddc_i2c.valid = false; | ||
1467 | hpd.hpd = RADEON_HPD_NONE; | ||
1440 | radeon_add_legacy_encoder(dev, | 1468 | radeon_add_legacy_encoder(dev, |
1441 | radeon_get_encoder_id(dev, | 1469 | radeon_get_encoder_id(dev, |
1442 | ATOM_DEVICE_TV1_SUPPORT, | 1470 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1445,13 +1473,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1445 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1473 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1446 | DRM_MODE_CONNECTOR_SVIDEO, | 1474 | DRM_MODE_CONNECTOR_SVIDEO, |
1447 | &ddc_i2c, | 1475 | &ddc_i2c, |
1448 | CONNECTOR_OBJECT_ID_SVIDEO); | 1476 | CONNECTOR_OBJECT_ID_SVIDEO, |
1477 | &hpd); | ||
1449 | break; | 1478 | break; |
1450 | case CT_POWERBOOK_INTERNAL: | 1479 | case CT_POWERBOOK_INTERNAL: |
1451 | DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", | 1480 | DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", |
1452 | rdev->mode_info.connector_table); | 1481 | rdev->mode_info.connector_table); |
1453 | /* LVDS */ | 1482 | /* LVDS */ |
1454 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 1483 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
1484 | hpd.hpd = RADEON_HPD_NONE; | ||
1455 | radeon_add_legacy_encoder(dev, | 1485 | radeon_add_legacy_encoder(dev, |
1456 | radeon_get_encoder_id(dev, | 1486 | radeon_get_encoder_id(dev, |
1457 | ATOM_DEVICE_LCD1_SUPPORT, | 1487 | ATOM_DEVICE_LCD1_SUPPORT, |
@@ -1459,9 +1489,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1459 | ATOM_DEVICE_LCD1_SUPPORT); | 1489 | ATOM_DEVICE_LCD1_SUPPORT); |
1460 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1490 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1461 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, | 1491 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1462 | CONNECTOR_OBJECT_ID_LVDS); | 1492 | CONNECTOR_OBJECT_ID_LVDS, |
1493 | &hpd); | ||
1463 | /* DVI-I - primary dac, int tmds */ | 1494 | /* DVI-I - primary dac, int tmds */ |
1464 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1495 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1496 | hpd.hpd = RADEON_HPD_1; /* ??? */ | ||
1465 | radeon_add_legacy_encoder(dev, | 1497 | radeon_add_legacy_encoder(dev, |
1466 | radeon_get_encoder_id(dev, | 1498 | radeon_get_encoder_id(dev, |
1467 | ATOM_DEVICE_DFP1_SUPPORT, | 1499 | ATOM_DEVICE_DFP1_SUPPORT, |
@@ -1476,8 +1508,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1476 | ATOM_DEVICE_DFP1_SUPPORT | | 1508 | ATOM_DEVICE_DFP1_SUPPORT | |
1477 | ATOM_DEVICE_CRT1_SUPPORT, | 1509 | ATOM_DEVICE_CRT1_SUPPORT, |
1478 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, | 1510 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1479 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | 1511 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, |
1512 | &hpd); | ||
1480 | /* TV - TV DAC */ | 1513 | /* TV - TV DAC */ |
1514 | ddc_i2c.valid = false; | ||
1515 | hpd.hpd = RADEON_HPD_NONE; | ||
1481 | radeon_add_legacy_encoder(dev, | 1516 | radeon_add_legacy_encoder(dev, |
1482 | radeon_get_encoder_id(dev, | 1517 | radeon_get_encoder_id(dev, |
1483 | ATOM_DEVICE_TV1_SUPPORT, | 1518 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1486,13 +1521,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1486 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1521 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1487 | DRM_MODE_CONNECTOR_SVIDEO, | 1522 | DRM_MODE_CONNECTOR_SVIDEO, |
1488 | &ddc_i2c, | 1523 | &ddc_i2c, |
1489 | CONNECTOR_OBJECT_ID_SVIDEO); | 1524 | CONNECTOR_OBJECT_ID_SVIDEO, |
1525 | &hpd); | ||
1490 | break; | 1526 | break; |
1491 | case CT_POWERBOOK_VGA: | 1527 | case CT_POWERBOOK_VGA: |
1492 | DRM_INFO("Connector Table: %d (powerbook vga)\n", | 1528 | DRM_INFO("Connector Table: %d (powerbook vga)\n", |
1493 | rdev->mode_info.connector_table); | 1529 | rdev->mode_info.connector_table); |
1494 | /* LVDS */ | 1530 | /* LVDS */ |
1495 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 1531 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
1532 | hpd.hpd = RADEON_HPD_NONE; | ||
1496 | radeon_add_legacy_encoder(dev, | 1533 | radeon_add_legacy_encoder(dev, |
1497 | radeon_get_encoder_id(dev, | 1534 | radeon_get_encoder_id(dev, |
1498 | ATOM_DEVICE_LCD1_SUPPORT, | 1535 | ATOM_DEVICE_LCD1_SUPPORT, |
@@ -1500,9 +1537,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1500 | ATOM_DEVICE_LCD1_SUPPORT); | 1537 | ATOM_DEVICE_LCD1_SUPPORT); |
1501 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1538 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
1502 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, | 1539 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
1503 | CONNECTOR_OBJECT_ID_LVDS); | 1540 | CONNECTOR_OBJECT_ID_LVDS, |
1541 | &hpd); | ||
1504 | /* VGA - primary dac */ | 1542 | /* VGA - primary dac */ |
1505 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1543 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1544 | hpd.hpd = RADEON_HPD_NONE; | ||
1506 | radeon_add_legacy_encoder(dev, | 1545 | radeon_add_legacy_encoder(dev, |
1507 | radeon_get_encoder_id(dev, | 1546 | radeon_get_encoder_id(dev, |
1508 | ATOM_DEVICE_CRT1_SUPPORT, | 1547 | ATOM_DEVICE_CRT1_SUPPORT, |
@@ -1510,8 +1549,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1510 | ATOM_DEVICE_CRT1_SUPPORT); | 1549 | ATOM_DEVICE_CRT1_SUPPORT); |
1511 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, | 1550 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, |
1512 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, | 1551 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1513 | CONNECTOR_OBJECT_ID_VGA); | 1552 | CONNECTOR_OBJECT_ID_VGA, |
1553 | &hpd); | ||
1514 | /* TV - TV DAC */ | 1554 | /* TV - TV DAC */ |
1555 | ddc_i2c.valid = false; | ||
1556 | hpd.hpd = RADEON_HPD_NONE; | ||
1515 | radeon_add_legacy_encoder(dev, | 1557 | radeon_add_legacy_encoder(dev, |
1516 | radeon_get_encoder_id(dev, | 1558 | radeon_get_encoder_id(dev, |
1517 | ATOM_DEVICE_TV1_SUPPORT, | 1559 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1520,13 +1562,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1520 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1562 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1521 | DRM_MODE_CONNECTOR_SVIDEO, | 1563 | DRM_MODE_CONNECTOR_SVIDEO, |
1522 | &ddc_i2c, | 1564 | &ddc_i2c, |
1523 | CONNECTOR_OBJECT_ID_SVIDEO); | 1565 | CONNECTOR_OBJECT_ID_SVIDEO, |
1566 | &hpd); | ||
1524 | break; | 1567 | break; |
1525 | case CT_MINI_EXTERNAL: | 1568 | case CT_MINI_EXTERNAL: |
1526 | DRM_INFO("Connector Table: %d (mini external tmds)\n", | 1569 | DRM_INFO("Connector Table: %d (mini external tmds)\n", |
1527 | rdev->mode_info.connector_table); | 1570 | rdev->mode_info.connector_table); |
1528 | /* DVI-I - tv dac, ext tmds */ | 1571 | /* DVI-I - tv dac, ext tmds */ |
1529 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); | 1572 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); |
1573 | hpd.hpd = RADEON_HPD_2; /* ??? */ | ||
1530 | radeon_add_legacy_encoder(dev, | 1574 | radeon_add_legacy_encoder(dev, |
1531 | radeon_get_encoder_id(dev, | 1575 | radeon_get_encoder_id(dev, |
1532 | ATOM_DEVICE_DFP2_SUPPORT, | 1576 | ATOM_DEVICE_DFP2_SUPPORT, |
@@ -1542,8 +1586,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1542 | ATOM_DEVICE_DFP2_SUPPORT | | 1586 | ATOM_DEVICE_DFP2_SUPPORT | |
1543 | ATOM_DEVICE_CRT2_SUPPORT, | 1587 | ATOM_DEVICE_CRT2_SUPPORT, |
1544 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, | 1588 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1545 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | 1589 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, |
1590 | &hpd); | ||
1546 | /* TV - TV DAC */ | 1591 | /* TV - TV DAC */ |
1592 | ddc_i2c.valid = false; | ||
1593 | hpd.hpd = RADEON_HPD_NONE; | ||
1547 | radeon_add_legacy_encoder(dev, | 1594 | radeon_add_legacy_encoder(dev, |
1548 | radeon_get_encoder_id(dev, | 1595 | radeon_get_encoder_id(dev, |
1549 | ATOM_DEVICE_TV1_SUPPORT, | 1596 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1552,13 +1599,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1552 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, | 1599 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, |
1553 | DRM_MODE_CONNECTOR_SVIDEO, | 1600 | DRM_MODE_CONNECTOR_SVIDEO, |
1554 | &ddc_i2c, | 1601 | &ddc_i2c, |
1555 | CONNECTOR_OBJECT_ID_SVIDEO); | 1602 | CONNECTOR_OBJECT_ID_SVIDEO, |
1603 | &hpd); | ||
1556 | break; | 1604 | break; |
1557 | case CT_MINI_INTERNAL: | 1605 | case CT_MINI_INTERNAL: |
1558 | DRM_INFO("Connector Table: %d (mini internal tmds)\n", | 1606 | DRM_INFO("Connector Table: %d (mini internal tmds)\n", |
1559 | rdev->mode_info.connector_table); | 1607 | rdev->mode_info.connector_table); |
1560 | /* DVI-I - tv dac, int tmds */ | 1608 | /* DVI-I - tv dac, int tmds */ |
1561 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); | 1609 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); |
1610 | hpd.hpd = RADEON_HPD_1; /* ??? */ | ||
1562 | radeon_add_legacy_encoder(dev, | 1611 | radeon_add_legacy_encoder(dev, |
1563 | radeon_get_encoder_id(dev, | 1612 | radeon_get_encoder_id(dev, |
1564 | ATOM_DEVICE_DFP1_SUPPORT, | 1613 | ATOM_DEVICE_DFP1_SUPPORT, |
@@ -1573,8 +1622,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1573 | ATOM_DEVICE_DFP1_SUPPORT | | 1622 | ATOM_DEVICE_DFP1_SUPPORT | |
1574 | ATOM_DEVICE_CRT2_SUPPORT, | 1623 | ATOM_DEVICE_CRT2_SUPPORT, |
1575 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, | 1624 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
1576 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | 1625 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, |
1626 | &hpd); | ||
1577 | /* TV - TV DAC */ | 1627 | /* TV - TV DAC */ |
1628 | ddc_i2c.valid = false; | ||
1629 | hpd.hpd = RADEON_HPD_NONE; | ||
1578 | radeon_add_legacy_encoder(dev, | 1630 | radeon_add_legacy_encoder(dev, |
1579 | radeon_get_encoder_id(dev, | 1631 | radeon_get_encoder_id(dev, |
1580 | ATOM_DEVICE_TV1_SUPPORT, | 1632 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1583,13 +1635,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1583 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, | 1635 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, |
1584 | DRM_MODE_CONNECTOR_SVIDEO, | 1636 | DRM_MODE_CONNECTOR_SVIDEO, |
1585 | &ddc_i2c, | 1637 | &ddc_i2c, |
1586 | CONNECTOR_OBJECT_ID_SVIDEO); | 1638 | CONNECTOR_OBJECT_ID_SVIDEO, |
1639 | &hpd); | ||
1587 | break; | 1640 | break; |
1588 | case CT_IMAC_G5_ISIGHT: | 1641 | case CT_IMAC_G5_ISIGHT: |
1589 | DRM_INFO("Connector Table: %d (imac g5 isight)\n", | 1642 | DRM_INFO("Connector Table: %d (imac g5 isight)\n", |
1590 | rdev->mode_info.connector_table); | 1643 | rdev->mode_info.connector_table); |
1591 | /* DVI-D - int tmds */ | 1644 | /* DVI-D - int tmds */ |
1592 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID); | 1645 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID); |
1646 | hpd.hpd = RADEON_HPD_1; /* ??? */ | ||
1593 | radeon_add_legacy_encoder(dev, | 1647 | radeon_add_legacy_encoder(dev, |
1594 | radeon_get_encoder_id(dev, | 1648 | radeon_get_encoder_id(dev, |
1595 | ATOM_DEVICE_DFP1_SUPPORT, | 1649 | ATOM_DEVICE_DFP1_SUPPORT, |
@@ -1597,9 +1651,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1597 | ATOM_DEVICE_DFP1_SUPPORT); | 1651 | ATOM_DEVICE_DFP1_SUPPORT); |
1598 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, | 1652 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, |
1599 | DRM_MODE_CONNECTOR_DVID, &ddc_i2c, | 1653 | DRM_MODE_CONNECTOR_DVID, &ddc_i2c, |
1600 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D); | 1654 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D, |
1655 | &hpd); | ||
1601 | /* VGA - tv dac */ | 1656 | /* VGA - tv dac */ |
1602 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 1657 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
1658 | hpd.hpd = RADEON_HPD_NONE; | ||
1603 | radeon_add_legacy_encoder(dev, | 1659 | radeon_add_legacy_encoder(dev, |
1604 | radeon_get_encoder_id(dev, | 1660 | radeon_get_encoder_id(dev, |
1605 | ATOM_DEVICE_CRT2_SUPPORT, | 1661 | ATOM_DEVICE_CRT2_SUPPORT, |
@@ -1607,8 +1663,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1607 | ATOM_DEVICE_CRT2_SUPPORT); | 1663 | ATOM_DEVICE_CRT2_SUPPORT); |
1608 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1664 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
1609 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, | 1665 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1610 | CONNECTOR_OBJECT_ID_VGA); | 1666 | CONNECTOR_OBJECT_ID_VGA, |
1667 | &hpd); | ||
1611 | /* TV - TV DAC */ | 1668 | /* TV - TV DAC */ |
1669 | ddc_i2c.valid = false; | ||
1670 | hpd.hpd = RADEON_HPD_NONE; | ||
1612 | radeon_add_legacy_encoder(dev, | 1671 | radeon_add_legacy_encoder(dev, |
1613 | radeon_get_encoder_id(dev, | 1672 | radeon_get_encoder_id(dev, |
1614 | ATOM_DEVICE_TV1_SUPPORT, | 1673 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1617,13 +1676,15 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1617 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1676 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1618 | DRM_MODE_CONNECTOR_SVIDEO, | 1677 | DRM_MODE_CONNECTOR_SVIDEO, |
1619 | &ddc_i2c, | 1678 | &ddc_i2c, |
1620 | CONNECTOR_OBJECT_ID_SVIDEO); | 1679 | CONNECTOR_OBJECT_ID_SVIDEO, |
1680 | &hpd); | ||
1621 | break; | 1681 | break; |
1622 | case CT_EMAC: | 1682 | case CT_EMAC: |
1623 | DRM_INFO("Connector Table: %d (emac)\n", | 1683 | DRM_INFO("Connector Table: %d (emac)\n", |
1624 | rdev->mode_info.connector_table); | 1684 | rdev->mode_info.connector_table); |
1625 | /* VGA - primary dac */ | 1685 | /* VGA - primary dac */ |
1626 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 1686 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
1687 | hpd.hpd = RADEON_HPD_NONE; | ||
1627 | radeon_add_legacy_encoder(dev, | 1688 | radeon_add_legacy_encoder(dev, |
1628 | radeon_get_encoder_id(dev, | 1689 | radeon_get_encoder_id(dev, |
1629 | ATOM_DEVICE_CRT1_SUPPORT, | 1690 | ATOM_DEVICE_CRT1_SUPPORT, |
@@ -1631,9 +1692,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1631 | ATOM_DEVICE_CRT1_SUPPORT); | 1692 | ATOM_DEVICE_CRT1_SUPPORT); |
1632 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, | 1693 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, |
1633 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, | 1694 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1634 | CONNECTOR_OBJECT_ID_VGA); | 1695 | CONNECTOR_OBJECT_ID_VGA, |
1696 | &hpd); | ||
1635 | /* VGA - tv dac */ | 1697 | /* VGA - tv dac */ |
1636 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); | 1698 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); |
1699 | hpd.hpd = RADEON_HPD_NONE; | ||
1637 | radeon_add_legacy_encoder(dev, | 1700 | radeon_add_legacy_encoder(dev, |
1638 | radeon_get_encoder_id(dev, | 1701 | radeon_get_encoder_id(dev, |
1639 | ATOM_DEVICE_CRT2_SUPPORT, | 1702 | ATOM_DEVICE_CRT2_SUPPORT, |
@@ -1641,8 +1704,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1641 | ATOM_DEVICE_CRT2_SUPPORT); | 1704 | ATOM_DEVICE_CRT2_SUPPORT); |
1642 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1705 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
1643 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, | 1706 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
1644 | CONNECTOR_OBJECT_ID_VGA); | 1707 | CONNECTOR_OBJECT_ID_VGA, |
1708 | &hpd); | ||
1645 | /* TV - TV DAC */ | 1709 | /* TV - TV DAC */ |
1710 | ddc_i2c.valid = false; | ||
1711 | hpd.hpd = RADEON_HPD_NONE; | ||
1646 | radeon_add_legacy_encoder(dev, | 1712 | radeon_add_legacy_encoder(dev, |
1647 | radeon_get_encoder_id(dev, | 1713 | radeon_get_encoder_id(dev, |
1648 | ATOM_DEVICE_TV1_SUPPORT, | 1714 | ATOM_DEVICE_TV1_SUPPORT, |
@@ -1651,7 +1717,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1651 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1717 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
1652 | DRM_MODE_CONNECTOR_SVIDEO, | 1718 | DRM_MODE_CONNECTOR_SVIDEO, |
1653 | &ddc_i2c, | 1719 | &ddc_i2c, |
1654 | CONNECTOR_OBJECT_ID_SVIDEO); | 1720 | CONNECTOR_OBJECT_ID_SVIDEO, |
1721 | &hpd); | ||
1655 | break; | 1722 | break; |
1656 | default: | 1723 | default: |
1657 | DRM_INFO("Connector table: %d (invalid)\n", | 1724 | DRM_INFO("Connector table: %d (invalid)\n", |
@@ -1668,7 +1735,8 @@ static bool radeon_apply_legacy_quirks(struct drm_device *dev, | |||
1668 | int bios_index, | 1735 | int bios_index, |
1669 | enum radeon_combios_connector | 1736 | enum radeon_combios_connector |
1670 | *legacy_connector, | 1737 | *legacy_connector, |
1671 | struct radeon_i2c_bus_rec *ddc_i2c) | 1738 | struct radeon_i2c_bus_rec *ddc_i2c, |
1739 | struct radeon_hpd *hpd) | ||
1672 | { | 1740 | { |
1673 | struct radeon_device *rdev = dev->dev_private; | 1741 | struct radeon_device *rdev = dev->dev_private; |
1674 | 1742 | ||
@@ -1792,6 +1860,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1792 | enum radeon_combios_connector connector; | 1860 | enum radeon_combios_connector connector; |
1793 | int i = 0; | 1861 | int i = 0; |
1794 | struct radeon_i2c_bus_rec ddc_i2c; | 1862 | struct radeon_i2c_bus_rec ddc_i2c; |
1863 | struct radeon_hpd hpd; | ||
1795 | 1864 | ||
1796 | if (rdev->bios == NULL) | 1865 | if (rdev->bios == NULL) |
1797 | return false; | 1866 | return false; |
@@ -1830,8 +1899,22 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1830 | break; | 1899 | break; |
1831 | } | 1900 | } |
1832 | 1901 | ||
1902 | switch (connector) { | ||
1903 | case CONNECTOR_PROPRIETARY_LEGACY: | ||
1904 | case CONNECTOR_DVI_I_LEGACY: | ||
1905 | case CONNECTOR_DVI_D_LEGACY: | ||
1906 | if ((tmp >> 4) & 0x1) | ||
1907 | hpd.hpd = RADEON_HPD_2; | ||
1908 | else | ||
1909 | hpd.hpd = RADEON_HPD_1; | ||
1910 | break; | ||
1911 | default: | ||
1912 | hpd.hpd = RADEON_HPD_NONE; | ||
1913 | break; | ||
1914 | } | ||
1915 | |||
1833 | if (!radeon_apply_legacy_quirks(dev, i, &connector, | 1916 | if (!radeon_apply_legacy_quirks(dev, i, &connector, |
1834 | &ddc_i2c)) | 1917 | &ddc_i2c, &hpd)) |
1835 | continue; | 1918 | continue; |
1836 | 1919 | ||
1837 | switch (connector) { | 1920 | switch (connector) { |
@@ -1848,7 +1931,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1848 | legacy_connector_convert | 1931 | legacy_connector_convert |
1849 | [connector], | 1932 | [connector], |
1850 | &ddc_i2c, | 1933 | &ddc_i2c, |
1851 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D); | 1934 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D, |
1935 | &hpd); | ||
1852 | break; | 1936 | break; |
1853 | case CONNECTOR_CRT_LEGACY: | 1937 | case CONNECTOR_CRT_LEGACY: |
1854 | if (tmp & 0x1) { | 1938 | if (tmp & 0x1) { |
@@ -1874,7 +1958,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1874 | legacy_connector_convert | 1958 | legacy_connector_convert |
1875 | [connector], | 1959 | [connector], |
1876 | &ddc_i2c, | 1960 | &ddc_i2c, |
1877 | CONNECTOR_OBJECT_ID_VGA); | 1961 | CONNECTOR_OBJECT_ID_VGA, |
1962 | &hpd); | ||
1878 | break; | 1963 | break; |
1879 | case CONNECTOR_DVI_I_LEGACY: | 1964 | case CONNECTOR_DVI_I_LEGACY: |
1880 | devices = 0; | 1965 | devices = 0; |
@@ -1920,7 +2005,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1920 | legacy_connector_convert | 2005 | legacy_connector_convert |
1921 | [connector], | 2006 | [connector], |
1922 | &ddc_i2c, | 2007 | &ddc_i2c, |
1923 | connector_object_id); | 2008 | connector_object_id, |
2009 | &hpd); | ||
1924 | break; | 2010 | break; |
1925 | case CONNECTOR_DVI_D_LEGACY: | 2011 | case CONNECTOR_DVI_D_LEGACY: |
1926 | if ((tmp >> 4) & 0x1) { | 2012 | if ((tmp >> 4) & 0x1) { |
@@ -1938,7 +2024,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1938 | legacy_connector_convert | 2024 | legacy_connector_convert |
1939 | [connector], | 2025 | [connector], |
1940 | &ddc_i2c, | 2026 | &ddc_i2c, |
1941 | connector_object_id); | 2027 | connector_object_id, |
2028 | &hpd); | ||
1942 | break; | 2029 | break; |
1943 | case CONNECTOR_CTV_LEGACY: | 2030 | case CONNECTOR_CTV_LEGACY: |
1944 | case CONNECTOR_STV_LEGACY: | 2031 | case CONNECTOR_STV_LEGACY: |
@@ -1953,7 +2040,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1953 | legacy_connector_convert | 2040 | legacy_connector_convert |
1954 | [connector], | 2041 | [connector], |
1955 | &ddc_i2c, | 2042 | &ddc_i2c, |
1956 | CONNECTOR_OBJECT_ID_SVIDEO); | 2043 | CONNECTOR_OBJECT_ID_SVIDEO, |
2044 | &hpd); | ||
1957 | break; | 2045 | break; |
1958 | default: | 2046 | default: |
1959 | DRM_ERROR("Unknown connector type: %d\n", | 2047 | DRM_ERROR("Unknown connector type: %d\n", |
@@ -1980,13 +2068,15 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1980 | ATOM_DEVICE_DFP1_SUPPORT); | 2068 | ATOM_DEVICE_DFP1_SUPPORT); |
1981 | 2069 | ||
1982 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); | 2070 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); |
2071 | hpd.hpd = RADEON_HPD_NONE; | ||
1983 | radeon_add_legacy_connector(dev, | 2072 | radeon_add_legacy_connector(dev, |
1984 | 0, | 2073 | 0, |
1985 | ATOM_DEVICE_CRT1_SUPPORT | | 2074 | ATOM_DEVICE_CRT1_SUPPORT | |
1986 | ATOM_DEVICE_DFP1_SUPPORT, | 2075 | ATOM_DEVICE_DFP1_SUPPORT, |
1987 | DRM_MODE_CONNECTOR_DVII, | 2076 | DRM_MODE_CONNECTOR_DVII, |
1988 | &ddc_i2c, | 2077 | &ddc_i2c, |
1989 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | 2078 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, |
2079 | &hpd); | ||
1990 | } else { | 2080 | } else { |
1991 | uint16_t crt_info = | 2081 | uint16_t crt_info = |
1992 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); | 2082 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
@@ -1998,12 +2088,14 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
1998 | 1), | 2088 | 1), |
1999 | ATOM_DEVICE_CRT1_SUPPORT); | 2089 | ATOM_DEVICE_CRT1_SUPPORT); |
2000 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); | 2090 | ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); |
2091 | hpd.hpd = RADEON_HPD_NONE; | ||
2001 | radeon_add_legacy_connector(dev, | 2092 | radeon_add_legacy_connector(dev, |
2002 | 0, | 2093 | 0, |
2003 | ATOM_DEVICE_CRT1_SUPPORT, | 2094 | ATOM_DEVICE_CRT1_SUPPORT, |
2004 | DRM_MODE_CONNECTOR_VGA, | 2095 | DRM_MODE_CONNECTOR_VGA, |
2005 | &ddc_i2c, | 2096 | &ddc_i2c, |
2006 | CONNECTOR_OBJECT_ID_VGA); | 2097 | CONNECTOR_OBJECT_ID_VGA, |
2098 | &hpd); | ||
2007 | } else { | 2099 | } else { |
2008 | DRM_DEBUG("No connector info found\n"); | 2100 | DRM_DEBUG("No connector info found\n"); |
2009 | return false; | 2101 | return false; |
@@ -2098,12 +2190,14 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
2098 | } else | 2190 | } else |
2099 | ddc_i2c.valid = false; | 2191 | ddc_i2c.valid = false; |
2100 | 2192 | ||
2193 | hpd.hpd = RADEON_HPD_NONE; | ||
2101 | radeon_add_legacy_connector(dev, | 2194 | radeon_add_legacy_connector(dev, |
2102 | 5, | 2195 | 5, |
2103 | ATOM_DEVICE_LCD1_SUPPORT, | 2196 | ATOM_DEVICE_LCD1_SUPPORT, |
2104 | DRM_MODE_CONNECTOR_LVDS, | 2197 | DRM_MODE_CONNECTOR_LVDS, |
2105 | &ddc_i2c, | 2198 | &ddc_i2c, |
2106 | CONNECTOR_OBJECT_ID_LVDS); | 2199 | CONNECTOR_OBJECT_ID_LVDS, |
2200 | &hpd); | ||
2107 | } | 2201 | } |
2108 | } | 2202 | } |
2109 | 2203 | ||
@@ -2114,6 +2208,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
2114 | if (tv_info) { | 2208 | if (tv_info) { |
2115 | if (RBIOS8(tv_info + 6) == 'T') { | 2209 | if (RBIOS8(tv_info + 6) == 'T') { |
2116 | if (radeon_apply_legacy_tv_quirks(dev)) { | 2210 | if (radeon_apply_legacy_tv_quirks(dev)) { |
2211 | hpd.hpd = RADEON_HPD_NONE; | ||
2117 | radeon_add_legacy_encoder(dev, | 2212 | radeon_add_legacy_encoder(dev, |
2118 | radeon_get_encoder_id | 2213 | radeon_get_encoder_id |
2119 | (dev, | 2214 | (dev, |
@@ -2124,7 +2219,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
2124 | ATOM_DEVICE_TV1_SUPPORT, | 2219 | ATOM_DEVICE_TV1_SUPPORT, |
2125 | DRM_MODE_CONNECTOR_SVIDEO, | 2220 | DRM_MODE_CONNECTOR_SVIDEO, |
2126 | &ddc_i2c, | 2221 | &ddc_i2c, |
2127 | CONNECTOR_OBJECT_ID_SVIDEO); | 2222 | CONNECTOR_OBJECT_ID_SVIDEO, |
2223 | &hpd); | ||
2128 | } | 2224 | } |
2129 | } | 2225 | } |
2130 | } | 2226 | } |