aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c69
-rw-r--r--drivers/gpu/drm/radeon/radeon_i2c.c28
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h6
3 files changed, 18 insertions, 85 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 83352bb4d607..ea3720cd98f2 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -430,55 +430,6 @@ int radeon_connector_set_property(struct drm_connector *connector, struct drm_pr
430 return 0; 430 return 0;
431} 431}
432 432
433/*
434 * Some integrated ATI Radeon chipset implementations (e. g.
435 * Asus M2A-VM HDMI) may indicate the availability of a DDC,
436 * even when there's no monitor connected. For these connectors
437 * following DDC probe extension will be applied: check also for the
438 * availability of EDID with at least a correct EDID header. Only then,
439 * DDC is assumed to be available. This prevents drm_get_edid() and
440 * drm_edid_block_valid() from periodically dumping data and kernel
441 * errors into the logs and onto the terminal.
442 */
443static bool radeon_connector_needs_extended_probe(struct radeon_device *dev,
444 uint32_t supported_device,
445 int connector_type)
446{
447 /* Asus M2A-VM HDMI board sends data to i2c bus even,
448 * if HDMI add-on card is not plugged in or HDMI is disabled in
449 * BIOS. Valid DDC can only be assumed, if also a valid EDID header
450 * can be retrieved via i2c bus during DDC probe */
451 if ((dev->pdev->device == 0x791e) &&
452 (dev->pdev->subsystem_vendor == 0x1043) &&
453 (dev->pdev->subsystem_device == 0x826d)) {
454 if ((connector_type == DRM_MODE_CONNECTOR_HDMIA) &&
455 (supported_device == ATOM_DEVICE_DFP2_SUPPORT))
456 return true;
457 }
458 /* ECS A740GM-M with ATI RADEON 2100 sends data to i2c bus
459 * for a DVI connector that is not implemented */
460 if ((dev->pdev->device == 0x796e) &&
461 (dev->pdev->subsystem_vendor == 0x1019) &&
462 (dev->pdev->subsystem_device == 0x2615)) {
463 if ((connector_type == DRM_MODE_CONNECTOR_DVID) &&
464 (supported_device == ATOM_DEVICE_DFP2_SUPPORT))
465 return true;
466 }
467 /* TOSHIBA Satellite L300D with ATI Mobility Radeon x1100
468 * (RS690M) sends data to i2c bus for a HDMI connector that
469 * is not implemented */
470 if ((dev->pdev->device == 0x791f) &&
471 (dev->pdev->subsystem_vendor == 0x1179) &&
472 (dev->pdev->subsystem_device == 0xff68)) {
473 if ((connector_type == DRM_MODE_CONNECTOR_HDMIA) &&
474 (supported_device == ATOM_DEVICE_DFP2_SUPPORT))
475 return true;
476 }
477
478 /* Default: no EDID header probe required for DDC probing */
479 return false;
480}
481
482static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder, 433static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
483 struct drm_connector *connector) 434 struct drm_connector *connector)
484{ 435{
@@ -719,8 +670,7 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
719 ret = connector_status_disconnected; 670 ret = connector_status_disconnected;
720 671
721 if (radeon_connector->ddc_bus) 672 if (radeon_connector->ddc_bus)
722 dret = radeon_ddc_probe(radeon_connector, 673 dret = radeon_ddc_probe(radeon_connector);
723 radeon_connector->requires_extended_probe);
724 if (dret) { 674 if (dret) {
725 radeon_connector->detected_by_load = false; 675 radeon_connector->detected_by_load = false;
726 if (radeon_connector->edid) { 676 if (radeon_connector->edid) {
@@ -902,8 +852,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
902 bool dret = false; 852 bool dret = false;
903 853
904 if (radeon_connector->ddc_bus) 854 if (radeon_connector->ddc_bus)
905 dret = radeon_ddc_probe(radeon_connector, 855 dret = radeon_ddc_probe(radeon_connector);
906 radeon_connector->requires_extended_probe);
907 if (dret) { 856 if (dret) {
908 radeon_connector->detected_by_load = false; 857 radeon_connector->detected_by_load = false;
909 if (radeon_connector->edid) { 858 if (radeon_connector->edid) {
@@ -1327,8 +1276,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
1327 if (encoder) { 1276 if (encoder) {
1328 /* setup ddc on the bridge */ 1277 /* setup ddc on the bridge */
1329 radeon_atom_ext_encoder_setup_ddc(encoder); 1278 radeon_atom_ext_encoder_setup_ddc(encoder);
1330 if (radeon_ddc_probe(radeon_connector, 1279 if (radeon_ddc_probe(radeon_connector)) /* try DDC */
1331 radeon_connector->requires_extended_probe)) /* try DDC */
1332 ret = connector_status_connected; 1280 ret = connector_status_connected;
1333 else if (radeon_connector->dac_load_detect) { /* try load detection */ 1281 else if (radeon_connector->dac_load_detect) { /* try load detection */
1334 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 1282 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
@@ -1346,8 +1294,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
1346 if (radeon_dp_getdpcd(radeon_connector)) 1294 if (radeon_dp_getdpcd(radeon_connector))
1347 ret = connector_status_connected; 1295 ret = connector_status_connected;
1348 } else { 1296 } else {
1349 if (radeon_ddc_probe(radeon_connector, 1297 if (radeon_ddc_probe(radeon_connector))
1350 radeon_connector->requires_extended_probe))
1351 ret = connector_status_connected; 1298 ret = connector_status_connected;
1352 } 1299 }
1353 } 1300 }
@@ -1492,9 +1439,7 @@ radeon_add_atom_connector(struct drm_device *dev,
1492 radeon_connector->shared_ddc = shared_ddc; 1439 radeon_connector->shared_ddc = shared_ddc;
1493 radeon_connector->connector_object_id = connector_object_id; 1440 radeon_connector->connector_object_id = connector_object_id;
1494 radeon_connector->hpd = *hpd; 1441 radeon_connector->hpd = *hpd;
1495 radeon_connector->requires_extended_probe = 1442
1496 radeon_connector_needs_extended_probe(rdev, supported_device,
1497 connector_type);
1498 radeon_connector->router = *router; 1443 radeon_connector->router = *router;
1499 if (router->ddc_valid || router->cd_valid) { 1444 if (router->ddc_valid || router->cd_valid) {
1500 radeon_connector->router_bus = radeon_i2c_lookup(rdev, &router->i2c_info); 1445 radeon_connector->router_bus = radeon_i2c_lookup(rdev, &router->i2c_info);
@@ -1842,9 +1787,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
1842 radeon_connector->devices = supported_device; 1787 radeon_connector->devices = supported_device;
1843 radeon_connector->connector_object_id = connector_object_id; 1788 radeon_connector->connector_object_id = connector_object_id;
1844 radeon_connector->hpd = *hpd; 1789 radeon_connector->hpd = *hpd;
1845 radeon_connector->requires_extended_probe = 1790
1846 radeon_connector_needs_extended_probe(rdev, supported_device,
1847 connector_type);
1848 switch (connector_type) { 1791 switch (connector_type) {
1849 case DRM_MODE_CONNECTOR_VGA: 1792 case DRM_MODE_CONNECTOR_VGA:
1850 drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); 1793 drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c
index 02cb7da4124d..5cabf8202007 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -32,7 +32,7 @@
32 * radeon_ddc_probe 32 * radeon_ddc_probe
33 * 33 *
34 */ 34 */
35bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool requires_extended_probe) 35bool radeon_ddc_probe(struct radeon_connector *radeon_connector)
36{ 36{
37 u8 out = 0x0; 37 u8 out = 0x0;
38 u8 buf[8]; 38 u8 buf[8];
@@ -47,15 +47,11 @@ bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool requires_e
47 { 47 {
48 .addr = 0x50, 48 .addr = 0x50,
49 .flags = I2C_M_RD, 49 .flags = I2C_M_RD,
50 .len = 1, 50 .len = 8,
51 .buf = buf, 51 .buf = buf,
52 } 52 }
53 }; 53 };
54 54
55 /* Read 8 bytes from i2c for extended probe of EDID header */
56 if (requires_extended_probe)
57 msgs[1].len = 8;
58
59 /* on hw with routers, select right port */ 55 /* on hw with routers, select right port */
60 if (radeon_connector->router.ddc_valid) 56 if (radeon_connector->router.ddc_valid)
61 radeon_router_select_ddc_port(radeon_connector); 57 radeon_router_select_ddc_port(radeon_connector);
@@ -64,17 +60,15 @@ bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool requires_e
64 if (ret != 2) 60 if (ret != 2)
65 /* Couldn't find an accessible DDC on this connector */ 61 /* Couldn't find an accessible DDC on this connector */
66 return false; 62 return false;
67 if (requires_extended_probe) { 63 /* Probe also for valid EDID header
68 /* Probe also for valid EDID header 64 * EDID header starts with:
69 * EDID header starts with: 65 * 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00.
70 * 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00. 66 * Only the first 6 bytes must be valid as
71 * Only the first 6 bytes must be valid as 67 * drm_edid_block_valid() can fix the last 2 bytes */
72 * drm_edid_block_valid() can fix the last 2 bytes */ 68 if (drm_edid_header_is_valid(buf) < 6) {
73 if (drm_edid_header_is_valid(buf) < 6) { 69 /* Couldn't find an accessible EDID on this
74 /* Couldn't find an accessible EDID on this 70 * connector */
75 * connector */ 71 return false;
76 return false;
77 }
78 } 72 }
79 return true; 73 return true;
80} 74}
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index e8860d984b17..2c2e75ef8a37 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -438,9 +438,6 @@ struct radeon_connector {
438 struct radeon_i2c_chan *ddc_bus; 438 struct radeon_i2c_chan *ddc_bus;
439 /* some systems have an hdmi and vga port with a shared ddc line */ 439 /* some systems have an hdmi and vga port with a shared ddc line */
440 bool shared_ddc; 440 bool shared_ddc;
441 /* for some Radeon chip families we apply an additional EDID header
442 check as part of the DDC probe */
443 bool requires_extended_probe;
444 bool use_digital; 441 bool use_digital;
445 /* we need to mind the EDID between detect 442 /* we need to mind the EDID between detect
446 and get modes due to analog/digital/tvencoder */ 443 and get modes due to analog/digital/tvencoder */
@@ -521,8 +518,7 @@ extern void radeon_i2c_put_byte(struct radeon_i2c_chan *i2c,
521 u8 val); 518 u8 val);
522extern void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector); 519extern void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector);
523extern void radeon_router_select_cd_port(struct radeon_connector *radeon_connector); 520extern void radeon_router_select_cd_port(struct radeon_connector *radeon_connector);
524extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector, 521extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector);
525 bool requires_extended_probe);
526extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector); 522extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector);
527 523
528extern struct drm_encoder *radeon_best_encoder(struct drm_connector *connector); 524extern struct drm_encoder *radeon_best_encoder(struct drm_connector *connector);