]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
drm/i915: TVDAC_STATE_CHG does not indicate successful load-detect
authorKeith Packard <keithp@keithp.com>
Fri, 13 May 2011 00:10:58 +0000 (17:10 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 13 Jul 2011 18:07:55 +0000 (11:07 -0700)
Do not use this bit to indicate that load detection has completed,
instead just wait for vblank, at which point the load registers will
have been updated.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Yi Sun <yi.sun@intel.com>
drivers/gpu/drm/i915/intel_tv.c

index 950ae1477738b6c9765f3c39668759465f59c6c7..210d570fd51620c6562513a4e60e94e8e1e08fd0 100644 (file)
@@ -1283,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);