drm/i915/tv: Sleep before checking for state changes.
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 22 Sep 2010 18:10:09 +0000 (19:10 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Sep 2010 10:05:44 +0000 (11:05 +0100)
We need to wait for the PLLs to settle prior to detecting the state
changes. The BIOS writers guide suggests waiting for the next vblank.

Reported-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_tv.c

index 49ab11c667bb9bb0e1fdbf33f3295bba183123c0..106560bc84db0292b0cfacb2efb63ef0e8780bac 100644 (file)
@@ -1271,8 +1271,12 @@ intel_tv_detect_type (struct intel_tv *intel_tv)
        I915_WRITE(TV_DAC, tv_dac);
        POSTING_READ(TV_DAC);
 
+       intel_wait_for_vblank(intel_tv->base.base.dev,
+                             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
@@ -1289,8 +1293,7 @@ intel_tv_detect_type (struct intel_tv *intel_tv)
                        DRM_DEBUG_KMS("Detected Component TV connection\n");
                        type = DRM_MODE_CONNECTOR_Component;
                } else {
-                       DRM_DEBUG_KMS("Unrecognised TV connection: %x\n",
-                                     tv_dac);
+                       DRM_DEBUG_KMS("Unrecognised TV connection\n");
                }
        }