Subversion Repositories Kolibri OS

Rev

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

Rev 5060 Rev 5097
Line 3613... Line 3613...
3613
		return connector_status_disconnected;
3613
		return connector_status_disconnected;
Line 3614... Line 3614...
3614
 
3614
 
3615
	return intel_dp_detect_dpcd(intel_dp);
3615
	return intel_dp_detect_dpcd(intel_dp);
Line 3616... Line 3616...
3616
}
3616
}
3617
 
3617
 
3618
static enum drm_connector_status
3618
static int g4x_digital_port_connected(struct drm_device *dev,
3619
g4x_dp_detect(struct intel_dp *intel_dp)
-
 
3620
{
3619
				       struct intel_digital_port *intel_dig_port)
3621
	struct drm_device *dev = intel_dp_to_dev(intel_dp);
-
 
3622
	struct drm_i915_private *dev_priv = dev->dev_private;
3620
{
Line 3623... Line -...
3623
	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-
 
3624
	uint32_t bit;
-
 
3625
 
-
 
3626
	/* Can't disconnect eDP, but you can close the lid... */
-
 
3627
	if (is_edp(intel_dp)) {
-
 
3628
		enum drm_connector_status status;
-
 
3629
 
-
 
3630
		status = intel_panel_detect(dev);
-
 
3631
		if (status == connector_status_unknown)
-
 
3632
			status = connector_status_connected;
-
 
3633
		return status;
3621
	struct drm_i915_private *dev_priv = dev->dev_private;
3634
	}
3622
	uint32_t bit;
3635
 
3623
 
3636
	if (IS_VALLEYVIEW(dev)) {
3624
	if (IS_VALLEYVIEW(dev)) {
3637
		switch (intel_dig_port->port) {
3625
		switch (intel_dig_port->port) {
Line 3643... Line 3631...
3643
			break;
3631
			break;
3644
		case PORT_D:
3632
		case PORT_D:
3645
			bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
3633
			bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
3646
			break;
3634
			break;
3647
		default:
3635
		default:
3648
			return connector_status_unknown;
3636
			return -EINVAL;
3649
		}
3637
		}
3650
	} else {
3638
	} else {
3651
	switch (intel_dig_port->port) {
3639
	switch (intel_dig_port->port) {
3652
	case PORT_B:
3640
	case PORT_B:
3653
			bit = PORTB_HOTPLUG_LIVE_STATUS_G4X;
3641
			bit = PORTB_HOTPLUG_LIVE_STATUS_G4X;
Line 3657... Line 3645...
3657
		break;
3645
		break;
3658
	case PORT_D:
3646
	case PORT_D:
3659
			bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
3647
			bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
3660
		break;
3648
		break;
3661
	default:
3649
	default:
3662
		return connector_status_unknown;
3650
			return -EINVAL;
3663
	}
3651
	}
3664
	}
3652
	}
Line 3665... Line 3653...
3665
 
3653
 
-
 
3654
	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
-
 
3655
		return 0;
-
 
3656
	return 1;
-
 
3657
}
-
 
3658
 
-
 
3659
static enum drm_connector_status
-
 
3660
g4x_dp_detect(struct intel_dp *intel_dp)
-
 
3661
{
-
 
3662
	struct drm_device *dev = intel_dp_to_dev(intel_dp);
-
 
3663
	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-
 
3664
	int ret;
-
 
3665
 
-
 
3666
	/* Can't disconnect eDP, but you can close the lid... */
-
 
3667
	if (is_edp(intel_dp)) {
-
 
3668
		enum drm_connector_status status;
-
 
3669
 
-
 
3670
		status = intel_panel_detect(dev);
-
 
3671
		if (status == connector_status_unknown)
-
 
3672
			status = connector_status_connected;
-
 
3673
		return status;
-
 
3674
	}
-
 
3675
 
-
 
3676
	ret = g4x_digital_port_connected(dev, intel_dig_port);
-
 
3677
	if (ret == -EINVAL)
-
 
3678
		return connector_status_unknown;
3666
	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
3679
	else if (ret == 0)
Line 3667... Line 3680...
3667
		return connector_status_disconnected;
3680
		return connector_status_disconnected;
3668
 
3681
 
Line 4014... Line 4027...
4014
 
4027
 
4015
	power_domain = intel_display_port_power_domain(intel_encoder);
4028
	power_domain = intel_display_port_power_domain(intel_encoder);
Line 4016... Line 4029...
4016
	intel_display_power_get(dev_priv, power_domain);
4029
	intel_display_power_get(dev_priv, power_domain);
-
 
4030
 
-
 
4031
	if (long_hpd) {
4017
 
4032
 
4018
	if (long_hpd) {
4033
		if (HAS_PCH_SPLIT(dev)) {
-
 
4034
		if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
-
 
4035
			goto mst_fail;
-
 
4036
		} else {
-
 
4037
			if (g4x_digital_port_connected(dev, intel_dig_port) != 1)
Line 4019... Line 4038...
4019
		if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
4038
				goto mst_fail;
4020
			goto mst_fail;
4039
		}
4021
 
4040