diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 15:08:05 +0200 | 
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 15:08:18 +0200 | 
| commit | e060c38434b2caa78efe7cedaff4191040b65a15 (patch) | |
| tree | 407361230bf6733f63d8e788e4b5e6566ee04818 /drivers/gpu/drm/i915/intel_tv.c | |
| parent | 10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff) | |
| parent | cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff) | |
| download | olio-linux-3.10-e060c38434b2caa78efe7cedaff4191040b65a15.tar.xz olio-linux-3.10-e060c38434b2caa78efe7cedaff4191040b65a15.zip  | |
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches
based on more recent version of the tree.
Diffstat (limited to 'drivers/gpu/drm/i915/intel_tv.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 46 | 
1 files changed, 26 insertions, 20 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 113e4e7264c..210d570fd51 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1236,6 +1236,8 @@ intel_tv_detect_type (struct intel_tv *intel_tv,  		      struct drm_connector *connector)  {  	struct drm_encoder *encoder = &intel_tv->base.base; +	struct drm_crtc *crtc = encoder->crtc; +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);  	struct drm_device *dev = encoder->dev;  	struct drm_i915_private *dev_priv = dev->dev_private;  	unsigned long irqflags; @@ -1258,6 +1260,10 @@ intel_tv_detect_type (struct intel_tv *intel_tv,  	/* Poll for TV detection */  	tv_ctl &= ~(TV_ENC_ENABLE | TV_TEST_MODE_MASK);  	tv_ctl |= TV_TEST_MODE_MONITOR_DETECT; +	if (intel_crtc->pipe == 1) +		tv_ctl |= TV_ENC_PIPEB_SELECT; +	else +		tv_ctl &= ~TV_ENC_PIPEB_SELECT;  	tv_dac &= ~(TVDAC_SENSE_MASK | DAC_A_MASK | DAC_B_MASK | DAC_C_MASK);  	tv_dac |= (TVDAC_STATE_CHG_EN | @@ -1277,26 +1283,26 @@ intel_tv_detect_type (struct intel_tv *intel_tv,  			      to_intel_crtc(intel_tv->base.base.crtc)->pipe);  	type = -1; -	if (wait_for((tv_dac = I915_READ(TV_DAC)) & TVDAC_STATE_CHG, 20) == 0) { -		DRM_DEBUG_KMS("TV detected: %x, %x\n", tv_ctl, tv_dac); -		/* -		 *  A B C -		 *  0 1 1 Composite -		 *  1 0 X svideo -		 *  0 0 0 Component -		 */ -		if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) { -			DRM_DEBUG_KMS("Detected Composite TV connection\n"); -			type = DRM_MODE_CONNECTOR_Composite; -		} else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) { -			DRM_DEBUG_KMS("Detected S-Video TV connection\n"); -			type = DRM_MODE_CONNECTOR_SVIDEO; -		} else if ((tv_dac & TVDAC_SENSE_MASK) == 0) { -			DRM_DEBUG_KMS("Detected Component TV connection\n"); -			type = DRM_MODE_CONNECTOR_Component; -		} else { -			DRM_DEBUG_KMS("Unrecognised TV connection\n"); -		} +	tv_dac = I915_READ(TV_DAC); +	DRM_DEBUG_KMS("TV detected: %x, %x\n", tv_ctl, tv_dac); +	/* +	 *  A B C +	 *  0 1 1 Composite +	 *  1 0 X svideo +	 *  0 0 0 Component +	 */ +	if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) { +		DRM_DEBUG_KMS("Detected Composite TV connection\n"); +		type = DRM_MODE_CONNECTOR_Composite; +	} else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) { +		DRM_DEBUG_KMS("Detected S-Video TV connection\n"); +		type = DRM_MODE_CONNECTOR_SVIDEO; +	} else if ((tv_dac & TVDAC_SENSE_MASK) == 0) { +		DRM_DEBUG_KMS("Detected Component TV connection\n"); +		type = DRM_MODE_CONNECTOR_Component; +	} else { +		DRM_DEBUG_KMS("Unrecognised TV connection\n"); +		type = -1;  	}  	I915_WRITE(TV_DAC, save_tv_dac & ~TVDAC_STATE_CHG_EN);  |