Subversion Repositories Kolibri OS

Rev

Rev 2005 | Rev 2997 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2005 Rev 2160
Line 428... Line 428...
428
	}
428
	}
Line 429... Line 429...
429
 
429
 
430
	return 0;
430
	return 0;
Line -... Line 431...
-
 
431
}
-
 
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
 */
-
 
443
static 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
 
-
 
468
	/* Default: no EDID header probe required for DDC probing */
-
 
469
	return false;
431
}
470
}
432
 
471
 
433
static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
472
static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
434
					  struct drm_connector *connector)
473
					  struct drm_connector *connector)
435
{
474
{
Line 659... Line 698...
659
	encoder = radeon_best_single_encoder(connector);
698
	encoder = radeon_best_single_encoder(connector);
660
	if (!encoder)
699
	if (!encoder)
661
		ret = connector_status_disconnected;
700
		ret = connector_status_disconnected;
Line 662... Line 701...
662
 
701
 
663
	if (radeon_connector->ddc_bus)
702
	if (radeon_connector->ddc_bus)
-
 
703
		dret = radeon_ddc_probe(radeon_connector,
664
	    dret = radeon_ddc_probe(radeon_connector);
704
					radeon_connector->requires_extended_probe);
665
	if (dret) {
705
	if (dret) {
666
		if (radeon_connector->edid) {
706
		if (radeon_connector->edid) {
667
			kfree(radeon_connector->edid);
707
			kfree(radeon_connector->edid);
668
			radeon_connector->edid = NULL;
708
			radeon_connector->edid = NULL;
Line 831... Line 871...
831
	int i;
871
	int i;
832
	enum drm_connector_status ret = connector_status_disconnected;
872
	enum drm_connector_status ret = connector_status_disconnected;
833
	bool dret = false;
873
	bool dret = false;
Line 834... Line 874...
834
 
874
 
835
	if (radeon_connector->ddc_bus)
875
	if (radeon_connector->ddc_bus)
-
 
876
		dret = radeon_ddc_probe(radeon_connector,
836
	dret = radeon_ddc_probe(radeon_connector);
877
					radeon_connector->requires_extended_probe);
837
	if (dret) {
878
	if (dret) {
838
		if (radeon_connector->edid) {
879
		if (radeon_connector->edid) {
839
			kfree(radeon_connector->edid);
880
			kfree(radeon_connector->edid);
840
			radeon_connector->edid = NULL;
881
			radeon_connector->edid = NULL;
Line 1249... Line 1290...
1249
		} else {
1290
		} else {
1250
		if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
1291
		if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
1251
			if (radeon_dp_getdpcd(radeon_connector))
1292
			if (radeon_dp_getdpcd(radeon_connector))
1252
				ret = connector_status_connected;
1293
				ret = connector_status_connected;
1253
		} else {
1294
		} else {
1254
			if (radeon_ddc_probe(radeon_connector))
1295
				if (radeon_ddc_probe(radeon_connector,
-
 
1296
						     radeon_connector->requires_extended_probe))
1255
			ret = connector_status_connected;
1297
			ret = connector_status_connected;
1256
		}
1298
		}
1257
	}
1299
	}
Line 1258... Line 1300...
1258
 
1300
 
Line 1404... Line 1446...
1404
	radeon_connector->connector_id = connector_id;
1446
	radeon_connector->connector_id = connector_id;
1405
	radeon_connector->devices = supported_device;
1447
	radeon_connector->devices = supported_device;
1406
	radeon_connector->shared_ddc = shared_ddc;
1448
	radeon_connector->shared_ddc = shared_ddc;
1407
	radeon_connector->connector_object_id = connector_object_id;
1449
	radeon_connector->connector_object_id = connector_object_id;
1408
	radeon_connector->hpd = *hpd;
1450
	radeon_connector->hpd = *hpd;
-
 
1451
	radeon_connector->requires_extended_probe =
-
 
1452
		radeon_connector_needs_extended_probe(rdev, supported_device,
-
 
1453
							connector_type);
1409
	radeon_connector->router = *router;
1454
	radeon_connector->router = *router;
1410
	if (router->ddc_valid || router->cd_valid) {
1455
	if (router->ddc_valid || router->cd_valid) {
1411
		radeon_connector->router_bus = radeon_i2c_lookup(rdev, &router->i2c_info);
1456
		radeon_connector->router_bus = radeon_i2c_lookup(rdev, &router->i2c_info);
1412
		if (!radeon_connector->router_bus)
1457
		if (!radeon_connector->router_bus)
1413
			DRM_ERROR("Failed to assign router i2c bus! Check dmesg for i2c errors.\n");
1458
			DRM_ERROR("Failed to assign router i2c bus! Check dmesg for i2c errors.\n");
Line 1750... Line 1795...
1750
 
1795
 
1751
	radeon_connector->connector_id = connector_id;
1796
	radeon_connector->connector_id = connector_id;
1752
	radeon_connector->devices = supported_device;
1797
	radeon_connector->devices = supported_device;
1753
	radeon_connector->connector_object_id = connector_object_id;
1798
	radeon_connector->connector_object_id = connector_object_id;
-
 
1799
	radeon_connector->hpd = *hpd;
-
 
1800
	radeon_connector->requires_extended_probe =
-
 
1801
		radeon_connector_needs_extended_probe(rdev, supported_device,
1754
	radeon_connector->hpd = *hpd;
1802
							connector_type);
1755
	switch (connector_type) {
1803
	switch (connector_type) {
1756
	case DRM_MODE_CONNECTOR_VGA:
1804
	case DRM_MODE_CONNECTOR_VGA:
1757
		drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
1805
		drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
1758
		drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs);
1806
		drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs);